Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone help my correct my code to be able to do this outcome Lab 3 Part 2 Problem to solve: Given a specified number

image text in transcribed

can someone help my correct my code to be able to do this outcome

image text in transcribed

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, lum hours and num days int originalMins, remainingMins, numHours, numDays; //create Scanner object to read keyboard input Scanner keyboard = new Scanner (System.in); //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 afiter nemoving day mins 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: Enter a four digit binary number (no spaces): 101 You entered: 1011 byte3: 1 ; byte2: 0 ; byte1: 1 ; byte0: 1 The base ten representation of 1011 is: 11

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

Have roles been defined and assigned?

Answered: 1 week ago