Skip Navigation
 

In Class Exercises

In Class Exercises(Arrays)

1. Write a program that allows the user to enter seven double values representing store sales for each day of one week. After all seven values are entered, echo them to the screen, and display the highest and lowest sales values.
2. Write a program that allows the user to eneter 12 double values representing store sales for each month of one year. After all 12 values are eneterd, display each month's sales amount and a message indicating whether it is higher, lower or equal to the average month's sales amount.
3. Addison High School is holding a fundraiser. The freshman, sophomores, juniors, and seniors hold a competition to see which class contributes the most money. Write a program that allows you to enter two numbers for each contribution as it comes in- the class of the contributoer(i.e. 1,2,3 or 4), and the amount contributed in dollars. For example, perhapsa junior contributes $20. The user would enter a 3 and a 20. The program continues to accept data until the user types 999 for the contributor's class. At that point, data entry is completed, so display the four class totalsas well as the number of the class (1,2,3 or 4) that contributed the most.
 
 
« go back|print