Purchase Solution

Time Conversion Program in C

Not what you're looking for?

Ask Custom Question

1- inputs a time duration in hours, minutes, and seconds;
2-calculates the equivalent total number of seconds;
3-recalculates the hours, minutes, and seconds from the total;
4-displays the values of the hours, minutes, seconds, and total seconds.

Specific Requirements

1-The program must be otherwise formatted and documented
2-The program should contain a single method, main
3-The program should declare 4 variables, hours, minutes, seconds, and totalSeconds, all of type int. You may declare at most 1 additional variable for temporary usage. No other variable are allowed.
4- The program should declare and use exactly 2 constants, MIN_PER_HR and SEC_PER_MIN (minutes per hour and seconds per minute)
5-The input statement(s) must be preceded by a suitable prompt(s).
6-The output produced by your program should be a single line

Purchase this Solution

Solution Summary

Helps you understand how to write a C program to do the following:
1- Input a time duration in hours, minutes, and seconds;
2- Calculate the equivalent total number of seconds;
3- Re-calculate the hours, minutes, and seconds from the total;
4- Display the values of the hours, minutes, seconds, and total seconds.

Solution Preview

I have coded the required program along with remarks on different parts of the program.
Hope it helps you ...

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.