Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java In this first problem, will you start implementing a program that will keep track of the user's active time (in minutes) for a

In Java

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

In this first problem, will you start implementing a program that will keep track of the user's active time (in minutes) for a specified month. The program will also calculate the total amount of active minutes on that particular month. 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 for Java AND Python: Inputs are separated by Enter, that is, one number per line. 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 7 you were active 1310 minutes or 0.03% of On month #7, the time. 32 10000000 4 100 9 90 15 10 15 60 30 90 13 60 20 300 23 600 0 Now, you will add an extra functionally to your program: your program will identify and print the day in which the user was most active, that is, the day with the most active minutes. The program's input is still the same, a number representing the month, then days and active minutes. You can (and should) copy your code from Problem 1 and use it as a starter code. After your program prints the total and average of the active minutes (output from problem 1), you will print the most active day according to the examples below. Tip: You should use a 1D array to keep track of the active minutes. Remember that arrays begin at O in most programming languages. On month #7, you were active 1310 minutes or 0.03% of the time. You were most active on day 23 with 600 minutes. 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

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

Consider this article:...

Answered: 1 week ago

Question

4. Make recommendations on steps to take to melt the glass ceiling.

Answered: 1 week ago

Question

1. Discuss the potential legal issues that relate to training.

Answered: 1 week ago

Question

3. Design a program for preparing for cross-cultural assignments.

Answered: 1 week ago