Question: C++ ONLY 1: Area of a Rectangle Write a program to calculate the area of a rectangle and display it. Your main() function should call

C++ ONLY

1: Area of a Rectangle

Write a program to calculate the area of a rectangle and display it. Your main() function should call the following functions:

getLength() This function should ask the user to enter the rectangles length, and then return that value as a double.

getWidth() This function should ask the user to enter the rectangles width, and then return that value as a double

getArea() This function should accept the rectangles length and width as parameters, and returns the rectangles area.

displayData() This function should accept the rectangles length, width and area as parameters, and display them in an appropriate message on the screen.

2: Area of Several Rectangles

Create and array of type double which holds the area of up-to 5 rectangles. Use the code from postlab 1 to get the length and width for each rectangle and eventually calculate the area of rectangle and store it in the array.

3: Lowest Score Drop

Write a program that gets the scores of several tests and stores them in an array. Then, it calculates the average of the test score by first dropping the lowest score in the group. It should use the following functions:

void getScore() should accept 4 test scores from the user, store the test scores in an array, and validate them. This function should be called once by your main() function.

void calcAverage() should calculate and display the average of the three highest scores. This function should only be called once by main(), and should be passed the array which holds the four test scores.

int findLowest() should find and return the lowest of the four test scores passed to it. This function should be called by calcAverage(), which uses the function to determine which of the four test scores to drop.

Input Validation: Do not accept test scores lower than 0 or higher than 100

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!