Question: Exercise 1: Design, code, and test a C++ program that accepts two corner points (x, y coordinate pairs) of a rectangle from the user. The

Exercise 1: Design, code, and test a C++ program that accepts two corner points (x, y coordinate pairs) of a rectangle from the user. The first point will be the lower-left corner and the second will be the upper-right corner. Use structured decision logic to determine whether the rectangle is a square, or is in "portrait" or "landscape" orientation. In this coordinate system you can assume that the rectangle's coordinates are all positive. Turn in input showing that your program correctly identified all three cases of rectangles.

Exercise 2: Design, code, and test a C++ program that allows a user to enter positive integers continuously until the value 0 is entered. Once the program has finished getting numbers from the user, output the number of numbers that were entered, the sum of those numbers, the average of those numbers, the largest value entered, and the smallest number entered. Note that 0 is the sentinel value and it is NOT part of the data. Submit output showing at least five input values. Note that you cannot use an integer for your average (averages must have a fractional component).

Notes:

Be sure to use only named constants for any constants used.

Be sure to comment your code.

Be sure to PROMPT the user when requesting input from the user.

Be sure to make it clear to the user the meaning of the things being output (for example: "largest number entered was 175" etc).

Make sure your loop is structured

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!