Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java please Your program will first read a number from 1 to 12 (included). This number will represent which month the user will input his

image text in transcribedimage text in transcribedimage text in transcribed

java please

Your program will first read a number from 1 to 12 (included). This number will represent which month the user will input his active minutes. Based on that, you should define how many days exist on the month. Assume that February always has 28 days. After, you will start reading the day and the active minutes of that day. You will keep reading day and minutes until you read 0 as an input for the day value. There can be multiple entries for the same day. Once you read zero for the day number, you should stop and not read the minutes. Please be aware that the user might mistakenly input a day value that is not within the range of numbers in a month (e.g., day 31 in April or -10). If that occurs, you should discard the minutes (you still need to read the user's minutes). Once you are done reading the information, your program will print the total amount of active minutes on the month and the average active minutes. Remember that each day has 24 hours, and each hour has 60 minutes. You must limit your average value to 2 decimal points. If you are writing your assignment in Java, you can use the System.out.printf method. Input One int representing the number of the month (1-12) One int representing the day One int representing the active minutes Output The total and average active minutes for that month Output On month #2, you were active 229 minutes or 0.57% of the time. Examples: Input 2 1 30 4 90 8 100 Nm 0 00 on month #7, you were active 1310 minutes or 2.93% of the time. 15 9 0 7 32 10000000 4 100 9 90 15 10 15 60 30 90 13 60 20 300 23 600 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions