Write a Java program to generate a user's daily average number of walking steps for a given month of the year. To do so, write the appropriate code for each of the following steps: a) First the...


Write a Java program to generate a user's daily average number of walking steps for a given month of the year. To<br>do so, write the appropriate code for each of the following steps:<br>a) First the program should prompt the user to enter the month's number (from 1 to 12) as an integer type.<br>Assume all input is valid.<br>b) Use switch case to determine the number of days in the given month (Suppose that month 2 has 28 days,<br>months 1,3,5,7,8, 10,12 have 31 days and the other months have 30 days).<br>c) Use a counter-based loop (for-loop or while-loop) to ask the user to enter the number of steps walked in each<br>of the days of the entered month.<br>d) Calculate and display the daily average number of walked steps as follows:<br>Total steps walked in a given month<br>Daily Average of walked steps<br>Number of days of a given month<br>SAMPLE INPUT/OUTPUT<br>Input the month: 2<br>Input the num. of steps for each of the 28 days of month 2:<br>227 1232 119 12002 1222 ... ...<br>222<br>Daily Average of Walked Steps = 4732.28322<br>Note: Your answer should follow the given sample input / output.<br>

Extracted text: Write a Java program to generate a user's daily average number of walking steps for a given month of the year. To do so, write the appropriate code for each of the following steps: a) First the program should prompt the user to enter the month's number (from 1 to 12) as an integer type. Assume all input is valid. b) Use switch case to determine the number of days in the given month (Suppose that month 2 has 28 days, months 1,3,5,7,8, 10,12 have 31 days and the other months have 30 days). c) Use a counter-based loop (for-loop or while-loop) to ask the user to enter the number of steps walked in each of the days of the entered month. d) Calculate and display the daily average number of walked steps as follows: Total steps walked in a given month Daily Average of walked steps Number of days of a given month SAMPLE INPUT/OUTPUT Input the month: 2 Input the num. of steps for each of the 28 days of month 2: 227 1232 119 12002 1222 ... ... 222 Daily Average of Walked Steps = 4732.28322 Note: Your answer should follow the given sample input / output.

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here