Question
Part A Calculate the rectangles area and perimeter. In this section of the lab, you will be creating a python program to calculate the rectangles
Part A
Calculate the rectangles area and perimeter.
In this section of the lab, you will be creating a python program to calculate the rectangles area and perimeter based on the input width and height.
You will be using the Python IDLE (a text editor and programming environment that comes with python). Name your file lab02_XX.py where you replace the XX with your initials.
Your program must include:
A comment on the top line of your program containing your name.
A comment on the second line containing your section number.
A comment on the third line containing the date.
A comment on the fourth line containing your email address.
A comment with the lab number and purpose of this lab.
Prompt the user to enter a number and assign this number to the variable width.
Prompt the user to enter another number and assign this number to the variable height.
Everything user input is a string. You must convert the input string to int or float.
Print the width and height.
Declare a variable to store the calculated area.
Declare another variable to store the calculated perimeter.
You need to get a similar result with the following example when running your code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started