Question: C++ Programming Language Please if at all possible show screenshots of the code and output. It would be very helpful to see the whitespace used
C++ Programming Language
Please if at all possible show screenshots of the code and output. It would be very helpful to see the whitespace used in the code and how to properly format it. Thanks so much.
I need a lttle help with this....
Program Directions:
In a header file named salary.h, implement a function that returns the annual bonus for an employee with the signature:
double calcBonus(double baseSalary, int yearsExperience)
where baseSalary represents an employee's salary and yearsExperience represents their years of experience. Bonuses are calculated as follows:
- More than 20 years experience gets a 5% bonus
- More than 10 years experience and up tp 20 gets a 3% bonus
- Employees with 10 years experience or less get a 2% bonus
In a source file named main.cpp, write a main method that does the following:
- create 4 vectors. nameVector is a vector of strings that holds names. salaryVector is a vector of doubles that holds salaries. experienceVector is a vector of ints that holds years of experience. bonusVector is a vector of doubles that holds bonuses.
- Prompts the user for names, salaries, and years of experience of employees, one employee at a time, and stores each piece of data in the appropriate vector above. If the user enters "DONE" for a name, the program should stop prompting.
- Once all employees have been entered, calculate the bonus for each employee using the calcBonus method in the salary.h header file, storing them in the bonusVector
- Print the name, salary, years of experience, and bonus for each employee, one employee per line, with tabs between each piece of data
- ends the program
You should compile your program using the c++ 11 standard, eg: g++ -std=c++11 -o myprogram main.cpp
Submit a zip file here that contains ONLY salary.h and main.cpp. The name of the zipfile should be yourLastName_assign2.zip
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
