1. (20 points) a.) What kind of C language statement is the following? float com
ID: 3873713 • Letter: 1
Question
1. (20 points) a.) What kind of C language statement is the following? float computeDegreesF (float degreesc) b.) In the above line of code, what does the first occurrence of float tell the compiler (and anyone who reads the code)? c.) In the above line of code, what do we call the part that appears between the parentheses? 2. (40 pts) Write a complete function (with appropriate comments) named computeDegrees which given (as an input argument) a floating point value degreesc representing Centigrade degrees, computes and returns the corresponding Fahrenheit degrees (also floating point). The correct conversion formula is degreesF = 1.8 * degreesC + 32.0 3. (40 pts) Write a short program (called a driver program) which calls computeDegreesF after prompting the user and then scanning in the value of degreesc. Your program should display the values of degreesF and degreesc before stopping. No comments needed.Explanation / Answer
Answer 1.a) It is a type of "Function declaration" statement in which the return type of the function is "float" and the function name is "computeDegreeF". The sytax of declaring a function is :
return_type function_name(parameter list);
Answer 1.b) The first occurence of float will tell the compiler that the value which is going to be returned by the function after proper execution of the code written within it is going to be a floating type value.
Answer 1.c) The ones mentioned in between the paranthesis is known as the parameters list which are used to take in the values which are passed to the function whenever a function is called. In this, the value passed to function will be received and stored in the degreeC which is of floating type.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.