Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program uses an array to store the amount of money a game show contestant won in each of five days. The program should display

The program uses an array to store the amount of money a game show contestant won in each of five days. The program should display the total amount won and the average daily amount won. It should also display the day number (1 through 5) corresponding to the highest amount won. Complete the program. Save and then run the program. in c++

#include #include using namespace std;

//function prototypes void getTotal(); double getAvg(); int getHighDay();

int main() { int winnings[5] = {12500, 9000, 2400, 15600, 5400}; int total = 0; double average = 0.0; int highDay = 0;

cout << fixed << setprecision(2); cout << "Total amount won: $" << total << endl; cout << "Average daily amount won: $" << average << endl; cout << "The contestant's highest amount won was on day " << highDay << "." << endl; return 0; } //end of main function

//*****function definitions***** void getTotal() {

} //end of getTotal function

double getAvg() {

} //end of getAvg function

int getHighDay() {

} //end of getHighDay function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

LO2 Discuss important legal areas regarding safety and health.

Answered: 1 week ago