Menu

Programmer Asned Write Program Calculates Conecv Given Radius N Heightch Based Formula Pro Q43858712

A programmer was asned to write a program that calculates a conecv) given its radius (n) and its heightch) based on the formu

Unfortunately, despite the fact this program goes through the compiler Without errors it produces completely false results, -

A programmer was asned to write a program that calculates a conecv) given its radius (n) and its heightch) based on the formula The program that made was the following: #include cstdio.h> #define PI 3.14 float Compute Volume (float rifloat wi int main (0 L float radius, heighti Printf (“Radius:”); scanf(“%f”, &radusli printf (“Height: scanf(“%f”, d heightli ans-ComputeVolume Cheight, Vadius); printf(Volume %fh, ans) return o float Compute Volume (float r, floath) flout ansi float vzi V2=8*r; anse (1.13.) *P1 * 2 *hi return=andi Unfortunately, despite the fact this program goes through the compiler Without errors it produces completely false results, – You are asuedi Li) To find and explain program. the errors of the above il Mane that the the necessary Changes (Where is needed) so above code worus correctly e) What modifications are needed to the above (corrected) program to produce the same results when we declare the function Compute Volume float ComputeVolume (float Ar, float xh). Show transcribed image text A programmer was asned to write a program that calculates a conecv) given its radius (n) and its heightch) based on the formula The program that made was the following: #include cstdio.h> #define PI 3.14 float Compute Volume (float rifloat wi int main (0 L float radius, heighti Printf (“Radius:”); scanf(“%f”, &radusli printf (“Height: scanf(“%f”, d heightli ans-ComputeVolume Cheight, Vadius); printf(Volume %fh, ans) return o float Compute Volume (float r, floath) flout ansi float vzi V2=8*r; anse (1.13.) *P1 * 2 *hi return=andi
Unfortunately, despite the fact this program goes through the compiler Without errors it produces completely false results, – You are asuedi Li) To find and explain program. the errors of the above il Mane that the the necessary Changes (Where is needed) so above code worus correctly e) What modifications are needed to the above (corrected) program to produce the same results when we declare the function Compute Volume float ComputeVolume (float Ar, float xh).

Expert Answer


Answer to A programmer was asned to write a program that calculates a conecv) given its radius (n) and its heightch) based on the …

OR