Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Essential Data Protection For Estate Agencies In Singapore 2024

Authors: Yang Yen Thaw Yt

1st Edition

B0CQK79WD3, 979-8872095392

More Books

Students also viewed these Databases questions