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 4.166666666666667 days. Grading Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre- configured tests against your code to calculate a grade.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

/* comments are for your understanding, please remove them once you get the idea */

import java.util.*;

import java.lang.*;

class Solution

{

public static void main (String[] args) throws java.lang.Exception

{

Scanner sc = new Scanner(System.in);

double min = sc.nextDouble();//taking minutes input here

double hours = min/60;

double days = hours/24;

System.out.println(hours);//printing the hours here

System.out.println(days);//printing the days here

}

}

Add a comment
Know the answer?
Add Answer to:
Write a program that accepts a number of minutes and converts it both to hours and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I do not know how to code this. I have tried several times. Instructions CountByAnything.java +...

    I do not know how to code this. I have tried several times. Instructions CountByAnything.java + Modify the CountByFives application so that the user enters the value to count by. Start each new line after 10 values have been displayed. 1 public class CountByAnything 2 { // Modify the code below 4 public static void main(String args[]) { Grading final int START; final int STOP = 500; final int NUMBER_PER_LINE = 10; for(int i = START; i <= STOP; i...

  • Bottom section is the what they expect in the code in java Create a class in...

    Bottom section is the what they expect in the code in java Create a class in JobApplicant.java that holds data about a job applicant. Include a name, a phone number, and four Boolean fields that represent whether the applicant is skilled in each of the following areas: word processing, spreadsheets, databases, and graphics. Include a constructor that accepts values for each of the fields. Also include a get method for each field. The get method should be the field name...

  • PYTHON Write a program that converts a total number of seconds to hours, minutes, and seconds....

    PYTHON Write a program that converts a total number of seconds to hours, minutes, and seconds. It should (1) prompt the user for input, (2) read an integer from the keyboard, (3) and calculate the result. For example, "5000 seconds = 1 hours, 23 minutes, and 20 seconds". Hint: Use the modulus operator.

  • Create an abstract Student class for Parker University. The class contains fields for student ID number,...

    Create an abstract Student class for Parker University. The class contains fields for student ID number, last name, and annual tuition. Include a constructor that requires parameters for the ID number and name. Include get and set methods for each field; the setTuition() method is abstract. Create three Student subclasses named UndergraduateStudent, GraduateStudent, and StudentAtLarge, each with a unique setTuition() method. Tuition for an UndergraduateStudent is $4,000 per semester, tuition for a GraduateStudent is $6,000 per semester, and tuition for...

  • Write a program named FahrenheitToCelsius that accepts a temperature in Fahrenheit from a user and converts...

    Write a program named FahrenheitToCelsius that accepts a temperature in Fahrenheit from a user and converts it to Celsius by subtracting 32 from the Fahrenheit value and multiplying the result by 5/9. Display both values to one decimal place. For example, if 88.5 degrees is input, the output would be: 88.5 F is 31.4 C Answer in C# (Posting incomplete code i have so far that wont run correctly.) using System; using static System.Console; class FahrenheitToCelsius { static void Main()...

  • Create an algorithm to count the number of 1’s in a 32-bit number. Implement the program in a high level language like...

    Create an algorithm to count the number of 1’s in a 32-bit number. Implement the program in a high level language like C or Java. It does not need to run for me, but the code should be included in a text document called FirstnameLastnameHLA3.txt along with your assignment submission. Implement the program in MIPSzy Assembly language. Use the high level code as comments to the right of the Assembly code as the textbook does. If you write that MIPSzy...

  • Write a program that calculates and prints the number of minutes in a year. Assume the...

    Write a program that calculates and prints the number of minutes in a year. Assume the following: 1 year = 365 days (Ignore leap years) 1 day = 24 hours 1 hour = 60 minutes Below is an example of the correct output format: The number of minutes in a year is X

  • IN JAVA Write a program that uses a two-dimensional array to store daily minutes walked and...

    IN JAVA Write a program that uses a two-dimensional array to store daily minutes walked and carb intake for a week. Prompt the user for 7 days of minutes walked and carb intake; store in the array.   Write a sort ( your choice which sort ) to report out the sorted minute values -lowest to highest. Write another to report out the sorted carb intake - highest to lowest. These methods MUST be your original code.   Your program should output...

  • Steps: Write a program that upon getting mass value from user, converts it to energy using...

    Steps: Write a program that upon getting mass value from user, converts it to energy using Einstein’s mass-to-energy conversion equation. You must write a function to calculate energy. Writing the whole thing in main will not get any credit. Note: Conversion equation=> e = m x c^2 Please do these steps: 1-Draw flowchart diagram or write the pseudocode 2-Write your code 3-Run the code 4-Test for all possible inputs!

  • python In a program, write a function that accepts two arguments: a list, and a number...

    python In a program, write a function that accepts two arguments: a list, and a number n. Assume that the list contains numbers. The function should display the number n, the list of numbers, and a sub list of all the numbers in the list that are greater than the number n. Initialize the list and the number n in the main function of your code and call your function, passing the list and number as arguments. Run your code...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT