/* Programmer: Dan Bennett Program 1, A demonstration of coding */ #include #include using namespace std; const float ADULT_TICKET_PRICE {8.00}; const float OTHER_TICKET_PRICE = 6.5; int main() { int adults {0}; // the number of adults 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; cout << endl; // cout << "The number of adults is " << adults << endl; cout << "Please enter the number of others "; cin >> others; // print a newline cout << endl; // cout << "The number of others is " << others << endl; // Compute the adult ticket cost adultCost = adults * ADULT_TICKET_PRICE; otherCost = others * OTHER_TICKET_PRICE; totalTicketPrice = adultCost + otherCost; /* cout << "The cost is " << adultCost << " " << otherCost << " " << totalTicketPrice << endl; */ cout << "For " << adults << " adults and " << others << " others the price will be:" << endl; cout << fixed << setprecision(2); cout << " Adult Tickets" << setw(10) << "$" << adultCost << endl; cout << " Other Tickets" << setw(10) << "$" << otherCost << endl; cout << endl; return 0; }