Question
C++ PROGRAM Create a program that lets Dave choose between a tip calculator, stopwatch or a gas mileage calculator. Your main function should act as
C++ PROGRAM
Create a program that lets Dave choose between a tip calculator, stopwatch or a gas mileage calculator. Your main function should act as the menu for choosing a function. You should have 3 additional functions. One for each function. After Dave uses a function he should be asked if he would like to use the same function, choose a new one or end the program.
However, this will be free trial software. After Dave tries all three functions or uses any function 3 times the program should remind Dave that this is a free trial. The program should then end without Dave's consent.
Here's what I have so far:
#include
int main() { int people; double bill, tiptotal, total, tip; char ans;
cout << "Welcome to tip Calculator "; cout << "Enter bill amount: " << "$"; cin >> bill; cout << "How many people will be splitting the bill? "; cin >> people; cout << "Enter Tip: " << "%"; cin >> tip;
tiptotal = (bill * (tip / 100)) / people; total = ((tiptotal*people) + bill) / people;
cout << " Tip per person at " << tip << "% is $" << tiptotal << endl << "Each person will pay $"<< total << endl;
---------------------------
cout << "Welcome to Stopwatch. ";
int start_s=clock();
// the code you wish to time goes here int stop_s=clock();
cout << "time: " << (stop_s-start_s)/double(CLOCKS_PER_SEC)*1000 << endl;
----------------------------
cout << "Welcome to gas mileage calculator. ";
double capacity, miles, average;
cout << "Enter the number of size of the tank (gallons): "; cin >> capacity;
cout << "Enter the number of miles per tank of gas: "; cin >> miles;
average = miles/capacity; cout << "The car's MPG is: " << average << endl << endl;
return 0;
}
I have no idea how to finish the stopwatch and how to make my main function act as the menu. Please Help and please NO FANCY CODE.
remind: However, this will be free trial software. After Dave tries all three functions or uses any function 3 times the program should remind Dave that this is a free trial. The program should then end without Dave's consent.
If you have any question ask me. Thanks.
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