Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program that: 1. Has three int pointers ptrHours, ptrMinutes, and ptrSeconds. 2. Has an int variable named inSeconds 3. Ask the user

Write a C program that:

1. Has three int pointers ptrHours, ptrMinutes, and ptrSeconds.

2. Has an int variable named inSeconds

3. Ask the user for the number of seconds

4. Read in the number of seconds into the variable inSeconds

5. Call the function convertTime

Write a C function named convertTime that will:

1. convert a time given in seconds, to the hours, minutes, and seconds represented by that time (in seconds)

2. accept an int (number of seconds)

3. given the number of seconds, the function will calculate the number of hours, minutes and seconds represented by the number of seconds given to the function

4. The function changes the values of the three variables pointed to by the pointers ptrHours, ptrMinutes, and ptrSeconds that are in main. Therefore, you will have to pass these three pointers to the function as well as the number of seconds

void convertTime(int seconds, int*, int*, int*)

in main

1. ask for the seconds

2. read in the seconds

3. call your function

4. the output should look like:

??? seconds

Converts to

??? hours

??? minutes

??? seconds

Example: 8412 seconds gives 2 hours,

20 minutes, and 12 seconds

Instruction for write:

1. indent about 4 spaces

2. { } are lined up one over the other

3. variables are listed right after the function header - one per line with a comment

4. variable names and function names should make sense and names should use a naming method such as camel casing or using an underscore

5. start with the 'skeleton' program I gave you (either the skeleton program I gave you for a C program or the skeleton I gave you for a C++ program

6. fill in the heading

7. don't copy from others

8. USE COMMENTS

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

Derive Eq. (17.55).

Answered: 1 week ago