Looking for answers? Westonci.ca is your go-to Q&A platform, offering quick, trustworthy responses from a community of experts. Experience the convenience of getting reliable answers to your questions from a vast network of knowledgeable experts. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

1.5.5: Work Shift

5 points

Let's Go!

A doctor works 20 hours, 42 minutes, and 16 seconds in one shift at a hospital. Convert the total shift time into seconds and display that information.

NOTE: You must use at least ONE compound operator (+=, -=, *=, /=, %=) program.

Sagot :

The total works in seconds after we code in Java is 74536.

How to convert time in Java?

Operator in Java programming language is a symbol to perform mathematic operation. The compound operator is the compound symbol that combining two mathematic operation. For this code we gonna use compound operator +=, but before code I will provide you example.

a += b is equal to a = a + b.

The code is,

public class workshift {

   public static void main(String[] args) {

       int hours = 20, minutes = 42, seconds = 16;

       int tSeconds;

       tSeconds = (hours*60*60);

       tSeconds += (minutes*60);

       tSeconds += seconds;

       System.out.println(tSeconds);

   }

}

Learn more about operator here:

brainly.com/question/18088519

#SPJ4

View image rk16