Question: pic one and two are my problem 1 codeplease answer the problem 2 thanks Exit Full Screen Problemijava New import java.util. HashMap; import java.util.Scanner; public

pic one and two are my problem 1 codeplease answer the problem 2 thanks
pic one and two are my problem 1 codeplease answer the problem
2 thanks Exit Full Screen Problemijava New import java.util. HashMap; import java.util.Scanner;
public class Probleml{ public static void main(String[] args) { HashMap Integer, Integer
monthDaysMap new HashMap 0; monthDaysMap.put(1,31); monthDaysMap.put(2,28); monthDaysMap.put(3, 31); monthDaysMap.put(4,30): monthDaysMap.put(5,31); monthDaysMap.put(6,38): monthDaysMap.put(7,31):
monthDaysMap.put(8,31); monthDaysMap.put(9,30); monthDaysMap.put(10,31); monthDaysMap.put(11,30); monthDaysMap.put(12,31); Scanner scanner new Scanner(System.in); int month -

Exit Full Screen Problemijava New import java.util. HashMap; import java.util.Scanner; public class Probleml{ public static void main(String[] args) { HashMap Integer, Integer monthDaysMap new HashMap 0; monthDaysMap.put(1,31); monthDaysMap.put(2,28); monthDaysMap.put(3, 31); monthDaysMap.put(4,30): monthDaysMap.put(5,31); monthDaysMap.put(6,38): monthDaysMap.put(7,31): monthDaysMap.put(8,31); monthDaysMap.put(9,30); monthDaysMap.put(10,31); monthDaysMap.put(11,30); monthDaysMap.put(12,31); Scanner scanner new Scanner(System.in); int month - scanner.nextInt(); int totalMinutes ; 1f (monthDaysMap.containskey(month)) { int day scanner.nextInto; while (day - 0){ if(day monthDaysMap.get(month)){ scanner.nextInto; day scanner.nextInt(); continue, } int minutes - scanner.nextInt(: totalMinutes minutes; day scanner.nextInt(); } } else return; double totalMins InMonth monthDaysMap.get(month) 24*60; double cent (100.0d/totalMinsInMonth) totalMinutes: System.out.println("On month #month", you were active totalMinutes minutes or "String.format("%.2f",cent)." } } Problem 2 - The most active day 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 10 array to keep track of the active minutes. Remember that arrays begin at 0 in most programming languages. Examples: Input 2 1 30 4 Output On month #2, you were active 229 minutes or 0.57% of the time. You were most active on day 8 with 100 minutes 0 90 8 100 15 9 On month #7, you were active 1310 minutes or 2.93% 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

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!