Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <ctime>
- using namespace std;
- int main()
- {
- string date, rest_name, street_and_city;
- double bill, tax_rate, tip, final_bill;
- int num_people;
- srand(time(NULL));
- tip = rand() % (21 - 15) + 15;
- cout << "the tip amount is: " << tip << endl;
- cout << "Enter date: ";
- getline(cin,date);
- cout << date << endl;
- cout << "Enter restaurant name: ";
- getline(cin,rest_name);
- cout << rest_name << endl;
- cout << "Enter street and city: ";
- getline(cin,street_and_city);
- cout << street_and_city << endl;
- cout << "Enter bill amount: ";
- cin >> bill;
- cout << "Enter tax rate in %: ";
- cin >> tax_rate;
- cout << "Enter number of people to divide by: ";
- cin >> num_people;
- final_bill = bill + tax_rate;
- cout << "\nPress any key to continue. ";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement