Question
I have hit a wall. I keep getting confused on how to calculate the monthly costs and display it correctly. Below is an image of
I have hit a wall. I keep getting confused on how to calculate the monthly costs and display it correctly. Below is an image of the instructions for building the program and then my coding underneath it.
// This calculates the total monthly cost for a vacation plan if the employee has dependents
#include
using namespace std;
void welcome(); void vacayPlan(); int calcCosts(); void itemizedBill(); void goodbye();
int main() {
long int employeeID; int plan1 = 7.50; int plan2 = 9.75; int plan3 = 14.25; int dependents; int vacayChoice; int monthlyCost;
welcome();
cout > employeeID;
cout
vacayPlan();
cin >> vacayChoice;
cout > dependents;
monthlyCost = vacayChoice * dependents;
cout
if (vacayChoice = 1) { 7.50 * dependents; }
if (vacayChoice = 2) { 9.75 * dependents; }
if (vacayChoice = 3) { 14.25 * dependents; }
itemizedBill();
goodbye();
return 0;
}
void welcome() { cout
void vacayPlan() { cout
void itemizedBill() { cout
void goodbye() { cout Vacation plan charges are as follows: Plan A: costs are $7.50 per dependent per month Plan B: costs are $9.75 per dependent per month Plan C: costs are $14.25 per dependent per month The senior programmer has outlined function main(as shown below - she chooses to use pass-by-value arguments: 5. Write and call a function to display a welcome screen - use Program 6-5 as an example of calling a function without passing any data be sure to create a function prototype . function call function definition 6. Within function main() - prompt for and collect the following input data: ask the HR clerk to input the employee's ID. NOTE: the employee's input ID is numeric - it should have the data type of long int ask the HR clerk to input the desired vacation plan o display a menu of the vacation plan choices and the user will enter either a 1, 2 or 3 (or A, B or C) to reflect Plan A, Plan B or Plan C accordingly ask the HR clerk to input the number of dependents 7. Write and call a function to calculate the monthly cost of the selected vacation plan and to display an itemized bill (formatted) - be sure to display the: employee ID plan selected number of dependents monthly cost 8. Write and call a function to exit/terminate the program displaying the programming company's contact information - this is similar to the welcome screen function above
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started