Question: 1. Write a c++ program .to prompt the user to enter the length of a shape and the height of that same shape . Next,

 1. Write a c++ program .to prompt the user to enter

1. Write a c++ program .to prompt the user to enter the length of a shape and the height of that same shape . Next, prompt the user to enter the type of shape they would like to calculate the area of: a rectangle have them enter a character R) or a triangle(have them enter a character T) . Using an if structure, call a function caled AreaRect if the user entered R. AeaRect should accept two inputs(length and height) and should return the area to main .Else Call a function called AreaTri, AreaTri should accept two inputs(length and height) and should return the area to main. Using a second if structure, print "the area of the rectangle is %lf" if the user entered R Else print "the area of the triangle is %lf" . Run with sample data: h-43, 1-64, shape-T and h=3.7,7.2, shape-R Write a ctt program to calculate a student's grade based on three test scores, using the guidelines below: 2. Write a function readScores and call it three times to read three test scores (between 0 and 100 using data type float for the scores. Call a function calculateGrade to determine the student's grade from the three test scores using the algorithm below. The function calculateGrade receives the three scores and returns the grade as a character. Implement the algorithm using nested statements within a given range rather than merely simple if statements. The grade is not printed from this function. These are the guidelines: * - If the average score is 90% or more, the grade is A. If the average score is 70% or more and less than 90%, check the third score. If the third score is more than 90%, the grade is A, otherwise the grade is B If the average score is 50% or more and less than 70%, check the average of the second and third scores. If the average of the two is greater than 70%, the grade is C; otherwise the grade is D If the average score is less than 50% then the grade is F o Print the student's grade from function main (or if you prefer, from a printResults function) . Test with the following sets of scores: a.. Test 1 score: 74 b. Test 1 score: 62 Test 2 score: 82 Test 2 score: 84 Test 2 score: 64 Test 3 score: 92 Test 3 score: 73 Test 3 score: 85 C Test 1 score: 52

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!