1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Rashid [163]
3 years ago
13

Create a Time Conversion application that prompts the user for a time in minutes and then displays the time in hours and minutes

. Be sure to consider times whether the number of minutes left over is less than 10. For example, 184 minutes in hour:minute format is 3:04 (Hint: use the modulus operator). The application output should look similar to:
Computers and Technology
1 answer:
vagabundo [1.1K]3 years ago
7 0

Answer:

The following are the program in the Java Programming Language.

//import the following class

import java.util.Scanner;

//define class

public class TimeConversion  

{

 //define main function

 public static void main(String[] args)  

 {

   //create the object of the scanner class

   Scanner s = new Scanner(System.in);

   //print message

   System.out.println("Enter the minutes: ");

   //get input in the variable

   int t=s.nextInt();

   //initialize in the variable

   int hr=t/60;

   //initialize in the variable    

   int min=t%60;

   //declare the string type variable

   String result;

   //initialize in the variable

   result=""+hr;

   //check that the variable is less than 10

   if(min<10)

     //then, initialize this

     result=result +":0"+min;

   //otherwise

   else

     //initialize this

     result=result +":"+min;

   //print the result

   System.out.println(result);

 }

}

<u>Output</u>:

Enter the minutes:

184

3:04

Explanation:

<u>The following are the description in the program</u>.

  • Firstly, import the scanner class and define the class 'TimeConversion', inside the class, we define the main method and inside the main method.
  • Create the object of the scanner class 'c' and then get input from the user in the variable 't' through the scanner class object.
  • Then, declare the variable 'hr' and initialize the value input divided by 60. Declare the variable 'min' and initialize the value input mod by 60.
  • Declare the string data type variable 'result' then, check that the variable 'min' is less than 10 then, initialize the following format in the variable 'result' and otherwise the initialize the other formate in the variable 'result'.
  • Finally, we print the variable 'result'.
You might be interested in
Which of these can a worksheet within a spreadsheet contain?
Lisa [10]
<span>d) all of these is your correct answer</span>
3 0
4 years ago
Read 2 more answers
Corey wrote a code that will display his name every time he presses the down arrow key but there is a bug in it. Display letter
brilliants [131]

Answer:

Explanation:

display letter c, type letter r, type letter o, type letter 3, type letter y- i think thats it but i dee cay this is confusing

7 0
3 years ago
What is outlook used for?
Arte-miy333 [17]
Outlook is used for mainly emails. It also keeps track of your calendar, has contact and tasks.
4 0
3 years ago
Read 2 more answers
What are Operating Systems?
horrorfan [7]

Answer:

the software that supports a computer's basic functions, such as scheduling tasks, executing applications, and controlling peripherals.

5 0
3 years ago
How should the administrator enable users with permissions to use einstein analytics features
wariber [46]

Answer:

Einstein analytics plus user

Explanation:

Einstein data insights is a platform that can be used by a company to analyse Salesforce report. With a subscription to this platform, an administrator can grant limited access to users in the company and monitor the logs and reports.

To grant a user access to Einstein data insights, go to setup and find permission set on the quick find box, on the "permission set", click on "einstein analytics plus user", then click on "manage assignment | add assignment". Add the users you want and then click on "assign".

4 0
4 years ago
Other questions:
  • You can encrypt individual files, but microsoft recommends encrypting at what level?
    9·1 answer
  • The contents of an array of type ______ can be displayed with the cout operator (without specifying an element). - 1 point(s)
    14·1 answer
  • Using python:
    10·1 answer
  • one data is in memory the computer interpets and executeinstructions to process the data into informationA. TrueB. False
    8·1 answer
  • How do you create a formula in excel​
    10·1 answer
  • Mrs. Schlair has an annual salary of $96,402.<br> a. What would her semimonthly salary be?
    9·1 answer
  • Can someone please give me the 3.6 code practice answer I will mark you brainlyist
    13·1 answer
  • Someone help me out eh?
    10·2 answers
  • Write a program to sort the (name, age, score) tuples by descending order where name is string, age and score are numbers. The s
    6·1 answer
  • Complete the code to finish this program to analyze the inventory for a store that sells purses and backpacks. Each record is co
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!