Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7) (18 pts) The area A of a rectangle can be calculated by multiplying the length and the width: A=I w, where / is the
7) (18 pts) The area A of a rectangle can be calculated by multiplying the length and the width: A=I w, where / is the length and w is the width. The perimeter P of a rectangle can be calculated with P= 2(l+w). Write a program that: - Defines a variable called length and asks the user for its value. - Defines a variable called width and asks the user for its value. - Computes the area of the rectangle and stores it in a variable called area. - Computes the perimeter of the rectangle and stores it in a variable called perimeter. - Prints out he perimeter and area. Save your program as problem7.c. You will submit this file on Canvas. Below is example output if the user entered 5.5 for the length and 4 for the width. Be sure to follow the same format for your output. Sample Output: Enter the rectangle length: 5.5 Enter the rectangle width: 4 The area is: 22.000 The perimeter is: 19.000
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