Question
Write a program that accepts a number of minutes and converts it both to hours and days. For example, 6000 minutes is 100.0 hours or
Write a program that accepts a number of minutes and converts it both to hours and days. For example, 6000 minutes is 100.0 hours or 4.166666666666667 days.
Thid is what I have but it is only 50% correct:
import java.util.Scanner;
public class MinutesConversion {
public static void main(String args[]) { Scanner input = new Scanner(System.in); System.out.print("Enter the hours to convert:"); int minites =input.nextInt(); double hours=convertToHours(minites); double days=convertToDays(minites); System.out.println(minites+" minutes equals "+hours+" hours and equals "+days+" days"); } public static double convertToHours(int minites){ double hours=(double)minites/60.00; return hours; } public static double convertToDays(int minites){ double days=(double)minites/(60.00*24); return days; } }
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