Question: Please write a c file. For each of the programs assig ned below, submit a c opy of the source code (.c , not .c

Please write a c file.

For each of the programs assigned below, submit a copy of the source code (.c, not .cpp file)

Observe the usual guidelines regarding the initial comment section, indenting, and so on. In addition, when functions are required, place function definitions following main. Before each function, use comments to explain what the function does. Do not use global variables.

1. In function main, prompt the user for a time in seconds. Call a function to calculate the equivalent time in hours, minutes, and seconds. Parameters should be the time in total seconds and pointers to the hours, minutes, and seconds. Print the equivalent in hours, minutes, and seconds in function main. (For example, 36884 seconds is equal to 10 hours, 14 minutes, and 44 seconds.)

2. In function main, declare a two-dimensional integer array with 5 rows and 6 columns and other variables for the minimum, row and column number, number of values evenly divisible by five and sum of these numbers, and any other necessary variables. Call the following functions from function main.

Call a function createArray to seed the random number generator and to fill the two-dimensional array with random integers between 1 and 250. Parameters for this function should be the array and the number of rows and columns or just the array if you are using symbolic constants for the number of rows and columns.

Call a second function minimum to find the smallest value in the array and its location. Return the smallest value and its row and column number as pointer parameters. (The function will have six parameters: the array, number of rows and columns and pointers to the largest value and its row and column number.

If you are using symbolic constants for the number of rows and columns there will be only four parameters.)

Call a function fives to calculate the number of values evenly divisible by 5 and their sum. Return these values to function main using pass by address with pointer parameters. The function should have five parameters: the array, the number of rows and columns, and pointers to the number of values and their sum. If you are using symbolic constants for the number of rows and columns there will be only three parameters.

Call a function printResults to print the array, smallest value and its row and column number, and the number of values evenly divisible by 5 and their sum. There will be six parameters, not counting numbers of rows and columns, none of which needs to be a pointer.

Function main should have only declarations and call statements.

For 2 points extra credit:

In function main declare three integers a, b, and c. Call a function randomNumbers to assign a random number between 1 and 50 to each and return using pointer parameters. Print the integers and their addresses in a function printNumbers.

Then call the function order to place the integers in numerical order using pass by address. Function order should have three parameters: int *aPtr, int *bPtr, and int *cPtr. The purpose of function order is to place the three integers in order so that a

The integers should be printed in order with addresses from printNumbers. When the steps of the function order have been completed the smallest value will be stored in a, the middle in b, and the largest in c.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!