Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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)

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

Step: 3

blur-text-image

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

Is there a clear hierarchy of points in my outline?

Answered: 1 week ago