Question: Write a C++ program, using C++ libraries, that demonstrates your mastery of the course and C++ statements learned in class: functions, arrays, looping, conditional logic,

Write a C++ program, using C++ libraries, that demonstrates your mastery of the course and C++ statements learned in class: functions, arrays, looping, conditional logic, operations and user interfaces.

The following functions are required. Your program will read the data in the file SomeData.txt into an array. The first row is a header and is text x, y. The remaining rows are numerical values for x and y respectively.

x

y

10

10

5.6

7.3

22.3

4

Create a simple menu from which an end user can select from one the following two options

Calculate the area and perimeter using x as the width and y as the length of a rectangle. Units are in cm.

Calculate the volume and surface area of a cylinder using x as the radius and y as the height. Units are in inches. You may use Google to find the formulas.

Allow the end user to select the name of the output file, which will include the input values and corresponding results.

You are required to perform the calculations using 2 separate functions. main() reads/writes the files and creates the end menu, as well as does the validity checking.

Do not Google for code. Impress your instructor that you have learned the basic statements.

Submit your main and 2 functions as a .txt file. Points will be deducted for improper format. Attach your output files for both cases. Clearly indicate with headers what your instructor is viewing when looking at your output files. Units are important. Include the input points along with the results of your calculations in your output file. Use meaningful variable, array and function names.

Below is the attached data file "SomeData.txt"

x y 10 10 5.6 7.3 2.3 2.3 22 13.2 12 12 15.0 17 1.2 3.5 22 22.6 100 15.5 32 54 11 39 22.3 4

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!