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
viva [34]
4 years ago
13

Create a new program called Time.java. From now on, we won’t remind you to start with a small, working program, but you should.

2. Following the example program in Section 2.4, create variables named hour, minute, and second. Assign values that are roughly the current time. Use a 24-hour clock so that at 2pm the value of hour is 14. 3. Make the program calculate and display the number of seconds since midnight. 4. Calculate and display the number of seconds remaining in the day. 5. Calculate and display the percentage of the day that has passed. You might run into problems when computing percentages with integers, so consider using floating-point. 6. Change the values of hour, minute, and second to reflect the current time. Then write code to compute the elapsed time since you started
Computers and Technology
1 answer:
alexgriva [62]4 years ago
3 0

Answer:

Explanation:

public class time {

public static void main (String[]args) {

 //Step 1  we declare the variables

 int hours, minutes, seconds;

 hours = 17;

 minutes = 12;

 seconds = 00;

 //For checking

 System.out.println(hours+":"+minutes+":"+seconds);

 //Step 2 we make the operation for the seconds since midnight

 int secSinceMidNite;

 secSinceMidNite = ((hours*60)+minutes)*60 + seconds;

 System.out.println("Seconds since midnight = "+secSinceMidNite);

 //Step 3 we make the operation for the seconds remaining in day

 int secRemainingInDay, totalSecInDay;

 totalSecInDay = 24*60*60;

 secRemainingInDay = totalSecInDay - secSinceMidNite;

 System.out.println("Seconds remaining in day = "+secRemainingInDay);

 //Step 4 in the operation for percentage of day that has passed

 int percentOfDayPassed;  

 percentOfDayPassed = (secSinceMidNite*100)/totalSecInDay;

 System.out.println("Percentage of day that has passed = " +percentOfDayPassed+"%");

}

}

You might be interested in
What advantage do ExpressCard modules and U.S.B adapters offer over expansion cards?
sladkih [1.3K]
The advantage does of ExpressCard modules and U.S.B adapters offer over expansion cards is that it can connect a variety of devices to a computer. The technical standard of ExpressCard specifies the design of slots built into the computer and of expansion of cards to insert in the slots including the mobile broadband modems. It is sometimes connectors for externals devices such as flash drives, USB connectors and other ports that need to connect to the computer.
4 0
4 years ago
Put these numbers in order from smallest to largest:<br> 1. 00101112<br> 2. 011110<br> 3. 011110112
Rina8888 [55]
The answer to this question is 3,2,1
8 0
3 years ago
Read 2 more answers
How do you perceive the importance of Internet?
Igoryamba

The Internet had been used since the 1960's. The internet has capability of giving any answer you need or just having fun. If you want more, wikipedia the internet.

8 0
3 years ago
Read 2 more answers
The dfs replication engine uses a form of replication called
polet [3.4K]
<span>The DFS replication engine uses a form of replication called </span>multiple master replication
3 0
3 years ago
Give me 3 companies that utilize audio/video technology
mestny [16]

Answer: I think Harman International. Bose.

Sennheiser, that ultilize audio And Zendesk

New Relic That ultilize video technology.

Explanation:

3 0
4 years ago
Other questions:
  • You created a database related to medicinal plants and their uses. For every plant, you would like to enter a description about
    11·1 answer
  • Write a Java program that generates a random number between 0 and 50. Then, the program prompts for guesses until the user is co
    14·1 answer
  • g Create your own data file consisting of integer, double or String values. Create your own unique Java application to read all
    7·1 answer
  • What is an end user license (EULA) agreement an example of?
    9·2 answers
  • How should the teachers respond to the parental complaints of student C? If they fail the student, the student will likely be re
    11·1 answer
  • If an individual receives 1.8 mGy while standing 4 ft from a source of radiation for 2 minutes, which of the following option(s)
    9·1 answer
  • As a basic user of SAP Business One, which feature of the application do you like most? Elaborate on your answer.
    15·1 answer
  • 3. Cellular phone technology works on a system of geographically separated zones
    12·1 answer
  • Which of the following is true of lossy and lossless compression techniques?
    13·1 answer
  • A ____ risk assessment evaluates threats to and vulnerabilities of the network.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!