Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can someone correct this code to be able to do this I keep getting 14 errors Lab 3 Part 2 Problem to solve: Given a
can someone correct this code to be able to do this I keep getting 14 errors
Lab 3 Part 2 Problem to solve: Given a specified number of minutes, convert these to the equivalent number of days, hours and minutes. / import java.util.Scanner; public class Minuteconverter \{ public static void main(string[] args) \{ //declare constants for num minutes in an hour and in a day final int NUM_HOUR_MINUTES =60; final int NUM_DAY_MINUTES = NUM_HOUR_MINUTES 24; //declare int variables to store original minutes, remaining minutes, /um hours and num days int originalMins, remainingMins, numHours, numDays; //create Scanner object to read keyboard input Scanner keyboard = new Scanner (System.in); l/use scanner object to collect user input for the number of original minutes System.out.println("Use Scanner object to collect user input for an integer:"); System.out.print("Enter an integer for the number of minutes to convert: "); originalMins = keyboard.nextLine(); //create bug by using nextline instead of System.out.println( "You entered " + originalMins + "minutes"); //determine how many days this is equivalent to numDays = (originalMins / NUM_DAY_MINUTES); //determine how many minutes remain after removing day mins L remainingMins = originalMins \% NUM_DAY_MINUTES; //determine how many hours are in these remaining minutes //determime how many minutes remain after removing hour mins //display results to the user System.out.println(originalMins + " minutes are equivalent to:"); \} Use Scanner object to collect user input for an integer: Enter an integer for the number of minutes to convert: 1919 You entered 1919 minutes 1919 minutes are equivalent to: Days: 1 Hours: 7 Minutes: 59
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started