/* Programmer: Dan Bennett Program: One, demonstrate how to write a simple program. This program was written in class. */ #include #include using namespace std; const float ADULT_TICKET_PRICE {8.00}; const float OTHER_TICKET_PRICE = 6.5; int main() { int adults {0}; int others = 0; float adultCost{0}, otherCost=0; float totalTicketPrice{0}; // Get the number of adults. cout << "Please enter the number of adults "; cin >> adults; // print an endline cout << endl; //cout << "The number of adults is " << adults << endl; cout << "Please enter the number of others "; cin >> others; cout << endl; //cout << "The number of others is " << others << endl; // the adult cost is the number of adults times the ticket price // Compute the adult cost based on the adults and ticket price adultCost = adults * ADULT_TICKET_PRICE; /*cout << "The cost of adult tickets is " << adultCost << endl; */ otherCost = others * OTHER_TICKET_PRICE; /* cout << "The cost of other tickets is " << otherCost << endl; */ totalTicketPrice = adultCost + otherCost; //cout << "The total ticket price is " << totalTicketPrice << endl; // cout << "For " << adults << " adults and " << others << " others the price will be:" << endl; cout << fixed; cout << setprecision(2) ; cout << " Adult Tickets" << setw(10) << "$" << adultCost << endl; cout << " Other Tickets" << setw(10) << "$" << otherCost << endl; return 0; }