Problem Specification: Writing in c++ language write a program that will define
ID: 3673381 • Letter: P
Question
Problem Specification: Writing in c++ language
write a program that will define a structure consisting of the following data members, “fields”:
- name
- hours worked
- hourly rate
Use a structure to implement the following:
-Use a function to read the name, hours and rate, passing them by reference to the
main function.
-Call a function to print, this function accepts the entire structure by value.
This function will call a function that will return the
grosspay, a local variable in print(function), by multiplying the hours by the rate.
The function then prints each data member on a separate line followed by the
grosspay
Input of the program:
- name(cin, getline);
- Hours worked
- Hourly rate
Output should go to a file and should be a report like follows:
Employee Name: Jim Donavan
Hours worked:
40.00
Hourly Rate:
$ 9.75
Total Wages: $ 390.00
Structure implementation
10 points Good programming practices: Proper spacing, comments, use of variables, and typedef, indentation and programs appearance.
5 points Descriptive names are used.
5 points Hierarchical chart is handed-in and is correct.
5 points the function that reads the data passes the values entered back into the structure.
5 points the function that calculates, returns the gross as its value to the gross member.
5 points the function that prints accepts the entire structures value, prints all the members on a separate line each and the grosspay.
5 points test results are handed in.
10 points program designed as specified, runs and produces the correct results.
Explanation / Answer
prob_2.cpp
prob_2.h
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.