Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Start with the supplied code template, editing the top of program @author tag to include your FULL NAME. Modify the provided template, to complete the
Start with the supplied code template, editing the top of program @author tag to include your FULL NAME.
Modify the provided template, to complete the program below,
which will read in a number of minutes from the user,
and convert those minutes to hours and minutes.
NOTE: All userdefined method definitions should appear after the main method definition.
Write a method definition to display the following program description:
Program to convert minutes to hours and minutes
There should be one blank line displayed after the program description.
Then call this method from within the main method.
Write a method definition for a method named calcHours
that takes the number of minutes as an input parameter,
calculates the whole hours within those minutes, and returns the result.
Then call the calcHours method from within the main method
and store the result returned into the wholeHours variable.
Write a method definition for a method named calcRemainingMinutes
that takes the number of minutes as an input parameter,
calculates the minutes remaining beyond the whole hours, and returns the result.
Then call the calcRemainingMinutes method from within the main method
and store the result returned into the remainingMinutes variable.
Remove all the FIX ME comments from the code.
Then, add code to the main method, that will use the values returned from the other two methods
to display the time in the format digits each:
Hours and minutes: HH:MM
WARNING:
This programs output could be generated without implementing any methods, and it would still pass many of the zyLabs tests.
However, if you do not implement the methods listed in the requirements, you will lose the majority of points for this program,
because implementing methods is the purpose of this assignment.
JAVA:
import java.util.Scanner;
public class MinuteConverter
public static void mainString args
int inputMinutes ;
int wholeHours ;
int remainingMinutes ;
Scanner keyboard new ScannerSystemin;
Fix me b Add method call to display program description
System.out.printlnEnter number of minutes to convert:";
inputMinutes keyboard.nextInt;
Fix me b Add method call to determine whole hours and store the result
Fix me b Add method call to determine remaining minutes and store the result
System.out.println;
Fix me Finish below code to display returned hours and minutes in format XX:XX
System.out.printfHours and minutes: ;
Fix me a Add code for method definition to display program description here
Fix me a Add code for method definition of calcHours to determine and return hours here
Fix me a Add code for method definition of calcRemainingMinutes to determine and return minutes here
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