Question: // ticket.cpp - This program asks for an age and displays the cost of the ticket #include using namespace std; int main( ) { double
// ticket.cpp - This program asks for an age and displays the cost of the ticket #include
int main( ) { double age, ticket = 12;
cout << "Please enter the age "; cin >> age; if(age <= 8) ticket = 6;
cout << "Your ticket costs " << ticket << endl;
return 0; }
Exercise 2.2.1 Change the ticket.cpp program such that it displays $6 for people who are 8 years old or younger OR 65 years or older.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
