wages code

This is a discussion on wages code within the C++ Programming forums, part of the General Programming Boards category; Can anyone help with this? How do you write the code for the pay and hours? I'm lost. I have ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    1

    wages code

    Can anyone help with this? How do you write the code for the pay and hours? I'm lost.

    I have a problem to give name of your file with the source code.
    also writing the code for the

    declare hours_worked as an integer; //No. of hrs worked during week
    declare pay_rate as a float; //Pay rate: dollars per hour
    declare wages as a float; //Weekly wages

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by dtaylor01 View Post
    Can anyone help with this? How do you write the code for the pay and hours? I'm lost.

    I have a problem to give name of your file with the source code.
    Next time, ask your questions in the form of a question. That just doesn't make sense as a sentence.

    also writing the code for the

    declare hours_worked as an integer; //No. of hrs worked during week
    declare pay_rate as a float; //Pay rate: dollars per hour
    declare wages as a float; //Weekly wages
    Do you not know how to declare a variable? Why not?

  3. #3
    C++Pandit
    Join Date
    Jul 2008
    Posts
    49
    Code:
    #include<iostream>
    #include<conio.h>
    using namespace std;
    main()
    {
         int hours_worked;
         float pay_rate=5.5;//just an example ,you should change it for your needs
         float wages;
    
        cout<<"Enter hours worked";
        cin>>hours_worked;
    wages=hours_worked*pay_rate;
     cout<<"Wages is "<<wages;
    getch();
    }
    One Word of advice mate,
    never ask for a homework to be posted,and dont ask for silly things like introduce a variable.
    You must be able to do it! Come on be confident.
    Last edited by Saimadhav; 10-14-2008 at 06:09 AM. Reason: punctuation errors

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Example:
    Code:
    #include <iostream>
    
    int main(void)
    {
      int i;
    
      std::cout << "How many years have you been programming? ";
      std::cin >> i;
    
      if(i < 0)
      {
        std::cout << "Come on dude, be serious... Now you will be punished."
    
        volatile
        {
          for(int i = 0;i != i;i++)
            char *t = new char[0x10000];
        }
      } else if(i < 2)
        std::cout << "You should be paid $0.00 for needing help on this." << std::endl;
      else
        std::cout << "You should be slapped for asking this sort of question." << std::endl;
    
      return 0;
    }

  5. #5
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,479
    Quote Originally Posted by Saimadhav View Post
    Code:
    #include<iostream>
    #include<conio.h>
    using namespace std;
    main()
    {
         int hours_worked;
         float pay_rate=5.5;//just an example ,you should change it for your needs
         float wages;
    
        cout<<"Enter hours worked";
        cin>>hours_worked;
    wages=hours_worked*pay_rate;
     cout<<"Wages is "<<wages;
    getch();
    }
    One Word of advice mate,
    never ask for a homework to be posted,and dont ask for silly things like introduce a variable.
    You must be able to do it! Come on be confident.
    Please do not do sombody else's homework. It takes away the fun of learning and the next time they get the same question again they will be stuck.
    I'm just trying to be a better person - My Name Is Earl

  6. #6
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Quote Originally Posted by swgh View Post
    Please do not do sombody else's homework. It takes away the fun of learning and the next time they get the same question again they will be stuck.
    I don't mind doing his homework. I am sure his professor would get a chuckle out of my solution. Or he would get an F, in which case I can have a chuckle at his expense. No matter what someone smiles.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 07:34 AM
  2. Obfuscated Code Contest: The Results
    By Stack Overflow in forum Contests Board
    Replies: 29
    Last Post: 02-18-2005, 04:39 PM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 03:17 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 0
    Last Post: 02-21-2002, 05:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21