# Project 17

Passing arrays to functions & isdigit (100 points)

• Do not use printf or setprecision in this program.
• Your main program should contain three procedure funtions - one which will store a set of floats into a one-dimentional array, another which determines the area of those floats and rounds that result to the hundredths place with a user defined function, and a third which will output the final report.
• Make sure that you conserve memory by passing your aurguments to the functions wisely. Some aurguments will be passed by value and some by address.
• To fill your array of floats, enter a posttest loop and accept a real number as a string. Your string should allow up to nine characters. Check the first character of the string. Remember, a string is an array of characters, so if stg is the string, then stg[0] is the first character of that string. Using the isdigit function (uses ctype.h), check to see if the first character is not a digit. If it is not a digit, then break out of the loop to terminate the entry of string numbers. If the first character is a digit, then convert the entire string to a float, store it into a one-dimentional array, and go back to the top of the loop to pickup another string number.
• Using sample output 1 as an example, your one-dimentional array should be filled in the following manner :
`num[0] = 3  num[1] = 4  num[2] = 5  num[3] = 6.345  num[4] = 3.256`
• When finding the average, use a for loop to sum up the elements in the array. After exiting the loop, calculate the average and round it using a user defined function. This is an example of how you may call your user defined function :

*ave = round_hundredths( sum / ( c + 1) )

*ave is the parameter in the function holding the average, round_hundredths is the user defined function, sum is the sum of the floats, and c + 1 is how many floats being averaged.

• The report should displayed the dimensions and area to four significant digits.
• Make sure your program can display the sample outputs below.
• Your code must be well documented. Also include your name, date, project number and a breif description of the program.

` `
` `
` `
` `
` `
` `
` `
`Sample output 1`
` `
`Enter number 1 or a letter to quit: 3`
`Enter number 2 or a letter to quit: 4`
`Enter number 3 or a letter to quit: 5`
`Enter number 4 or a letter to quit: 6.345`
`Enter number 5 or a letter to quit: 3.256`
`Enter number 6 or a letter to quit: e`
`( 3.256 + 6.345 + 5 + 4 + 3 ) / 5 = 4.32`
` `
`Sample output 2`
` `
`Enter number 1 or a letter to quit: 5.5`
`Enter number 2 or a letter to quit: 8.4`
`Enter number 3 or a letter to quit: 8.596`
`Enter number 4 or a letter to quit: q`
`( 8.596 + 8.4 + 5.5 ) / 3 = 7.5`
` `
`Sample output 3`
` `
`Enter number 1 or a letter to quit: 45.6`
`Enter number 2 or a letter to quit: 6.356`
`Enter number 3 or a letter to quit: k`
`( 6.356 + 45.6 ) / 2 = 25.98`
` `
`Sample output 4`
` `
`Enter number 1 or a letter to quit: 5`
`Enter number 2 or a letter to quit: 9`
`Enter number 3 or a letter to quit: 2`
`Enter number 4 or a letter to quit: 4`
`Enter number 5 or a letter to quit: 6`
`Enter number 6 or a letter to quit: 3`
`Enter number 7 or a letter to quit: m`
`( 3 + 6 + 4 + 2 + 9 + 5 ) / 6 = 4.83`