Please, need help with C++ codes..!
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Please, need help with C++ codes..!

  1. #1
    Join Date
    Sep 2013
    Posts
    1

    Exclamation Please, need help with C++ codes..!

    Write a C++ program that takes as inputs: an employee name, the hourly rate, and the number of
    hours s/he worked in the last week. The program then outputs all entered information in addition
    to the salary of the employee for the last week. The steps are as follows:

    (1) Write C++ statements that include the header files iostream and string.

    (2) Write C++ statements that declare the following variables: name of type string,
    hourlyRate of type double, hoursWorked of type int, and salary of type double.
    Write a C++ statement that computes the salary of the employee and stores the result in
    the variable salary.

    (3) Write a C++ statement(s) that output(s) the value of name, hourlyRate, hoursWorked,
    and salary with the appropriate text. For example, if the values of name, hourlyRate,
    hoursWorked are “Nancy”, 10.5 and 20, respectively, the outputs should be similar to
    below:
    Hello, Nancy! The last week you worked for 20 hours. Knowing that your hourly rate is
    10.5 dollars, your salary for the last week is 210 dollars.

  2. #2
    Join Date
    Apr 1999
    Posts
    27,444

    Re: Please, need help with C++ codes..!

    Quote Originally Posted by Doblomace View Post
    Write a C++ program that takes as inputs: an employee name, the hourly rate, and the number of
    hours s/he worked in the last week. The program then outputs all entered information in addition
    to the salary of the employee for the last week. The steps are as follows:

    (1) Write C++ statements that include the header files iostream and string.

    (2) Write C++ statements that declare the following variables: name of type string,
    hourlyRate of type double, hoursWorked of type int, and salary of type double.
    Write a C++ statement that computes the salary of the employee and stores the result in
    the variable salary.

    (3) Write a C++ statement(s) that output(s) the value of name, hourlyRate, hoursWorked,
    and salary with the appropriate text. For example, if the values of name, hourlyRate,
    hoursWorked are “Nancy”, 10.5 and 20, respectively, the outputs should be similar to
    below:
    Hello, Nancy! The last week you worked for 20 hours. Knowing that your hourly rate is
    10.5 dollars, your salary for the last week is 210 dollars.
    The homework tells you exactly what you need to do, and is very simple even for a beginner.

    So what work have you done? What exactly do you need help in?

    Regards,

    Paul McKenzie

  3. #3
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,754

    Re: Please, need help with C++ codes..!

    From the 3 steps provided for the assignment, what don't you understand how to do? As Paul said in post #2, this is very simple even for a beginner.

    You might like to have a look at this web site
    http://www.learncpp.com/
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center