The detailed instructions on handing in assignments are located on the course Web page. Make sure to read the programming standards and course ethics material before attempting the assignment
Your tasks in modifying AccumAv are as follows:
- re-implement the constructor and addValue()
- implement average()
Warning: What is the average if no numbers have been entered? Since count is initialized at 1, the average is not usually total/count.
Use the AccumAv class in a program which prompts the user for a sequence of integers, sums the positive integers before the first zero in the sequence and reports their average (to 1 decimal place). You can include the declaration and implementation of AccumAv in the program file, so you will submit only the single file specified below.
Program to sum and average positive integers.
Enter integers on a single line, separated by spaces, and terminated with a zero
Integers>23 -4 4 6 -2 0 The sum of the positive integers is 33. The average is 11.0.
Write a program which calculates the cost to paint the walls the Room class by prompting the user for room dimensions(meters), door area(sq. meters) and paint cost (per sq. meter) and then reports the cost of painting the room.
The program should operate for several rooms by prompting the user for a repetition. Here you will submit two files, one containing the program, and a second file with the Room class.
Enter the room dimensions (L, W, H; in meters) and door area (sq. meters)> 3.0 4.0 2.0 2.0 Enter the paint cost ($ per sq. meter)> 2.50 The room costs $65.00 to paint. Do you want to price another room? (Type Y to continue)> N Goodbye. Thanks for using the paint cost calculator.