likereto84 likereto84
  • 11-02-2021
  • Computers and Technology
contestada

Write a program that calculates the area & perimeter of a rectangle, where
the values for width and length are given by the users.

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 16-02-2021

Answer:

In Python:

Length = float(input("Length: "))

Width = float(input("Width: "))

Area = Length * Width

Perimeter = 2*(Length + Width)

print(Area)

print(Perimeter)

Explanation:

This gets the length from the user

Length = float(input("Length: "))

This gets the width from the user

Width = float(input("Width: "))

This calculates the area

Area = Length * Width

This calculates the perimeter

Perimeter = 2*(Length + Width)

This prints the area

print(Area)

This prints the perimeter

print(Perimeter)

Answer Link

Otras preguntas

Someone please help.
which air mass is pushed above other air mass as the front moves?
True or false: Balanced forces can change an object's direction?
what is information based on
Find 1/8 of 12. Express your answer in simplest form. 1 1/2 2/3 1/96 12/8
if a rectangle has a meter of 70 a length of a x and a width of subtract by 9 find the value of the length of the rectangle
Strong bases such as NaOH follow the ionic IUPAC naming convention. Predict the name of this ternary compound.
What is the easiest and most recommended for changing the order of the slides
Which best describes the relationship between the successive terms in the sequence shown? 9, –1, –11, –21, … The common difference is –10.  The common differenc
You have referenced books of Robert Browning and Elizabeth Barrett Browning in the same sentence. Which parenthetical citation will you use?