Question

In: Computer Science

Write a C++ code that can convert time into hours, minutes, seconds. It can accept (seconds),...

Write a C++ code that can convert time into hours, minutes, seconds.

It can accept (seconds), (minutes, seconds), (hours, minutes, seconds)

The input can be written in main

It should produce the following output:

(67.4, 14, 5) is 67 Hours, 38 Minutes, 5 Seconds

(127.86) is 0 Hours, 2 Minutes, 8 Seconds

(-3, 73, 2) is -1 Hours, -46 Minutes, -58 Seconds

Solutions

Expert Solution

CODE:

OUTPUT:

if we give any negative value it would not work correctly kindly apologize me

**********For any queries comment me in the comment box*************


Related Solutions

Write a program that request a time interval in seconds and display it in hours, minutes,...
Write a program that request a time interval in seconds and display it in hours, minutes, second format. (java)
Design a clock display to show the time in hours, minutes, and seconds. Assume that we...
Design a clock display to show the time in hours, minutes, and seconds. Assume that we have a clock of exactly 1 KHz (1000 clock pulses per second). It will use 6 seven-segment displays and operate either in military time (hours 00 to 23) or regular time (1 to 12, with AM and PM). An input line, x, differentiates between the two. A seventh display is used to show A or P in the latter case; it is blank otherwise....
Using Quartus to design a stopwatch that can display tenths of seconds, minutes, and hours, with...
Using Quartus to design a stopwatch that can display tenths of seconds, minutes, and hours, with the gaps between HEX displays splitting the time units (i.e. minutes on HEX[5..4], hours on HEX[7..6]). Have the stopwatch cycle through 3 states of a state machine with a pushbutton. The 3 states are counter-clear, counter-start, and counter-stop
Write C code to create a structure called time_of_day, which stores the current time in hours,...
Write C code to create a structure called time_of_day, which stores the current time in hours, minutes, and seconds. All the fields should be integers except for seconds, which should be a floating point value. Write a C function called check_time, which takes a pointer to a time_of_day structure as input, and return 1 if the time is valid (0 to 23 hours, 0 to 59 minutes, 0 to 59.999999 seconds) and 0 otherwise. Assume that times are stored in...
Write the definition for a generic / Template class called time that has hours and minutes...
Write the definition for a generic / Template class called time that has hours and minutes as structure. The class has the following member functions: SetTime to set the specified value in object ShowTime to display time object Sum to sum two time object & return time Write the definitions for each of the above member functions. Write main function to create three time objects. Set the value in two objects and call sum() to calculate sum and assign it...
Time Remaining 2 hours 2 minutes 11 seconds 02:02:11 Item 6 Item 6 Time Remaining 2...
Time Remaining 2 hours 2 minutes 11 seconds 02:02:11 Item 6 Item 6 Time Remaining 2 hours 2 minutes 11 seconds 02:02:11 The Molson Company had budgeted production for the year as follows: Quarter 1 2 3 4 Production in units 11,700 13,700 19,600 15,700 Four pounds of raw materials are required for each unit produced. Raw materials on hand at the start of the year total 5,700 lbs. The raw materials inventory at the end of each quarter should...
1. Write a C++ code segment to read 50 temperature values in Fahrenheit and to convert...
1. Write a C++ code segment to read 50 temperature values in Fahrenheit and to convert them to Celsius. You convert a Fahrenheit temperature to Celsius by using the following formula: Celsius = 5.0 / 9 * (Fahrenheit - 32). 2.A client has purchased 20 products in a store. Write a C++ code segment to read the unit price and the number of items of each product and to compute and print the total price of all these products.
Can someone please convert this java code to C code? import java.util.LinkedList; import java.util.List; public class...
Can someone please convert this java code to C code? import java.util.LinkedList; import java.util.List; public class Phase1 { /* Translates the MAL instruction to 1-3 TAL instructions * and returns the TAL instructions in a list * * mals: input program as a list of Instruction objects * * returns a list of TAL instructions (should be same size or longer than input list) */ public static List<Instruction> temp = new LinkedList<>(); public static List<Instruction> mal_to_tal(List<Instruction> mals) { for (int...
Time Remaining 3 hours 5 minutes 26 seconds 03:05:26 eBook Check my work Check My Work...
Time Remaining 3 hours 5 minutes 26 seconds 03:05:26 eBook Check my work Check My Work button is now disabled Item 3 Item 3 Time Remaining 3 hours 5 minutes 26 seconds 03:05:26 Polaski Company manufactures and sells a single product called a Ret. Operating at capacity, the company can produce and sell 38,000 Rets per year. Costs associated with this level of production and sales are given below: Unit Total Direct materials $ 20 $ 760,000 Direct labor 10...
Time Remaining 5 minutes 19 seconds 00:05:19 Item 23 Item 23 Time Remaining 5 minutes 19...
Time Remaining 5 minutes 19 seconds 00:05:19 Item 23 Item 23 Time Remaining 5 minutes 19 seconds 00:05:19 On April 1st, Bob the Builder entered into a contract of one-month duration to build a barn for Nolan. Bob is guaranteed to receive a base fee of $5,800 for his services in addition to a bonus depending on when the project is completed. Nolan created incentives for Bob to finish the barn as soon as he can without jeopardizing the structural...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT