Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is kicking my but. Need help for C programming code. For all programs, brief comments are required as follows: All preprocessor directives All function

This is kicking my but. Need help for C programming code.

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()

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.

Functions required:

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

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

Calculate the length of the hypotenuse

o Values should be saved using 3 decimal place precision

Print the results of all tests of a and b

o Print the array holding the results

o Use column headings for the output display

o All values displayed in 3 decimal-place precision

Program execution:

Define the array in main

o 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

o Display the results in table format, including appropriate column headings

o Use 3 decimal place precision

Call the calculate function

o Pass the side a and b values from the array

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

Call the print function

o Display the results in table format, including appropriate column headings

o Use 3 decimal place precision

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_2

Step: 3

blur-text-image_3

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

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions

Question

Under what circumstances would a company have a defensive strategy?

Answered: 1 week ago