Question: For all programs, brief comments are required as follows: All preprocessor directives All function prototypes All variables and arrays prototypes when defined Description of the

For all programs, brief comments are required as follows:

All preprocessor directives

All function prototypes

All variables and arrays prototypes when defined

Description of the output from printf()

Program #1

Create a program to calculate the hypotenuse of a right triangle. The values for the sides of the triangle will be input from the keyboard; the hypotenuse will be calculated using the equation c^ = ?(a^2+ b^2 ) where c is the length of the hypotenuse; a and b are the length of the two sides. (c is equal to the square root of the sum of a squared and b squared) (Requires the use of the SQRT() and POW() functions.

For all programs, brief comments are required as follows: All preprocessor directives

Functions required:

Populate a multidimensional array with random number in the range 3 to 19

Array has 4 rows and 3 columns (see table above)

Calculate the length of the hypotenuse

Values should be saved using 3 decimal place precision

Print the results of all tests of a and b

Print the array holding the results

Use column headings for the output display

All values displayed in 3 decimal-place precision

Program execution:

Define the array in main

Keep in mind the results of the calculations could have decimal places

Populate the array as described above but set the element that will contain the hypotenuse to 0 (zero).

Call the print function

Display the results in table format, including appropriate column headings

Use 3 decimal place precision

Call the calculate function

Pass the side a and b values from the array

Populate the appropriate array element with the value returned for the hypotenuse

Call the print function

Display the results in table format, including appropriate column headings

Use 3 decimal place precision

Program #2

Create a program with three string arrays, two 25-element arrays and one 100 element array.

Functions required:

Determine string equality

Display a message indicating the length of the string

Program execution:

Initialize the arrays in main()

Initialize the two 25-element arrays to 0

Initialize the 100-element array with: The quick brown fox jumps over the lazy dog.

Call the function to display the length of the 100-element array; use an appropriate message

Enter a string into each of the two 25-length arrays

Enter strings that match

Enter strings that do not match

Display the results with the appropriate message about comparing the two strings

Side A Side B Hypotenuse Side 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!