Question: 1.1) There are numerous opportunities for error in any program, many times in places that seem too simple to require close attention. What do you

1.1) There are numerous opportunities for error in any program, many times in places that seem too simple to require close attention. What do you think the following program is supposed to do?

#include stdio.h int main() { double radius = 11; /* Centimeters double pi = 3.14159 double sphere_volume = (4 / 3) * pi *(radius * radius * radius); double surface_area = 5 * pi * radius; printf("Volume = %.2f", sphere_volume); printf("Area = %.2f", surface_area); return 0; }

1.2) Using Visual Studio:

Create a new empty Visual C++ Console Application project

Add a C source file (e.g., Source.c) to the project

Copy the code from Lab 1.1 into the source file.

Try compiling the program. What were the results? What error messages did you receive?

1.3) Fix the syntax errors in the program from Lab 1.1. What do you receive for output when you run the program?

1.4) The program from Lab 1.3 has two logic errors. Fix them both and show the corrected program. NOTE: the correct formulas for a sphere's volume V and a sphere's surface area A area:

1.1) There are numerous opportunities for error in any program, many times

in places that seem too simple to require close attention. What do

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!