Question: Write Python programs for each of the following problems. Use example s shown in class as guide to solving the problems below . If you

Write Python programs for each of the following problems. Use examples shown in class as guide to solving the problems below.

If you want to check if your program is producing the right output then do the calculations by hand and then check against your programs output.

Take input widths and heights of two rectangles. Compute the area of each rectangle and output them. Also output one of the following,

First rectangle is larger than the second rectangle

(if the area of first rectangle > area of second rectangle)

OR

Second rectangle is larger than the first rectangle

(if the area of second rectangle > area of first rectangle)

Hint:

You will need variables such as width1, height1, width2, height2 to hold user inputs for widths and heights of the two rectangles. You will also need area1 and area2 to hold the areas of rectangles 1 and 2 respectively (these are calculated values and not user input).

It is OK to use digits in variable names as long as they are not at the beginning of the name.

You will also need a two-way decision structure in this problem.

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!