Question: Write a program in a Java source file called AverageMults.java that reads integer values from the user until the user has entered 15 values. The

Write a program in a Java source file called AverageMults.java that reads integer values from the user until the user has entered 15 values. The program should compute the average of the values entered by the user, but only those values that are multiples of either 4 or 7. All other values, including the non-positive value that ends user input should be ignored. Display the average or display the message "Average not computed; no multiples of 4 or 7 were entered." if no multiples of either 4 or 7 were entered by the user. For example, if the user enters 1, 2, 3, 4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, then the program would ignored all values except for 4, 7, 8, 12, and 14 and produce the average 9.00. If the user enters 2, 3 ,5, 6, 8, 9, 10, 11, 13, 15, 17, 18, 19, 22, 23, then the program would display the message "Average not computed; no multiples of 4 or 7 were entered."

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!