Question: Using JAVA, write a nested loops program that collects, calculates, and displays the average lung cancer rate over a period of years. The user will

Using JAVA, write a nested loops program that collects, calculates, and displays the average lung cancer rate over a period of years. The user will be asked to enter the number of years.The outer loop will iterate once for every year. The inner loop will iterate 12 times, once for each month. Each iteration of the inner loop will ask the user for the number of cancer cases for that month. After all iterations, the program should display the number of months, the total number of lung cancer cases, and the average lung cancer cases per month for the entire period. Input Validation: Do not allow negative numbers for the monthly lung cancer cases.

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!