Question: Write a python program that: Takes two positive numerical number. Uses the first number as the length of side of a square, and second one

Write a python program that:

  • Takes two positive numerical number.
  • Uses the first number as the length of side of a square, and second one as the length of radius of a circle.
  • Calculates the area of both shapes given that input numbers.
  • Prints out the area for each shape (e.g. - "The square has an area of... and the circle has an area of...")
  • Compares the area of the square to the area of the circle.
  • If the area of the square is greater, prints "The area of the square is greater than the area of the circle".
  • If the area of the circle is greater, prints "The area of the circle is greater than the area of the square".
  • If the both shapes have the same area, prints "The area of the square is equal to the area of the circle".

Remember that:

  • Area of a square = side times side.
  • Area of a circle = pi times radius times radius.
  • You may use 3.14 as pi if you wish.

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!