Houl 4O Part E Question 1 Part E Question 2 Part E Question 3 Part E Question 4 Part E Question 5 Part F Question 6 Question 6 Write a program to calculate the perimeter of a square, a rectangle and the circumference of a circle. Ask user to key in the required details depending on their selected shape. The program will keep asking user for input unless the user enters 0 to exit. The following functions have to be used in the program: i. double square (double s); - this function will return perimeter of square ii. double rectangle (double 1, double w) ; - this function will return perimeter of rectangle iii. double circle (double r): - this function will return circumference of circle The following formulas are to be used to calculate the perimeter of a square, a triangle and the circumference of a circle: Perimeter of a square = 4s where s is the side of the square. Perimeter of a rectange = a +b +cwhere a, b and c are the sides of the rectangle. Circumference of a circle = 2 mr where TT= 3.142 and r= radius. Please write your answer below: A Source D BI 作 量 ST2 Styles Fornat Size A- A 32°C Light rain
Houl 4O Part E Question 1 Part E Question 2 Part E Question 3 Part E Question 4 Part E Question 5 Part F Question 6 Question 6 Write a program to calculate the perimeter of a square, a rectangle and the circumference of a circle. Ask user to key in the required details depending on their selected shape. The program will keep asking user for input unless the user enters 0 to exit. The following functions have to be used in the program: i. double square (double s); - this function will return perimeter of square ii. double rectangle (double 1, double w) ; - this function will return perimeter of rectangle iii. double circle (double r): - this function will return circumference of circle The following formulas are to be used to calculate the perimeter of a square, a triangle and the circumference of a circle: Perimeter of a square = 4s where s is the side of the square. Perimeter of a rectange = a +b +cwhere a, b and c are the sides of the rectangle. Circumference of a circle = 2 mr where TT= 3.142 and r= radius. Please write your answer below: A Source D BI 作 量 ST2 Styles Fornat Size A- A 32°C Light rain
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter7: User-defined Simple Data Types, Namespaces, And The String Type
Section: Chapter Questions
Problem 7PE
Related questions
Question
![Houl 4O
Part E Question 1 Part E Question 2 Part E Question 3 Part E Question 4 Part E Question 5 Part F Question 6
Question 6
Write a program to calculate the perimeter of a square, a rectangle and the circumference of a circle. Ask user to key in the required details
depending on their selected shape. The program will keep asking user for input unless the user enters 0 to exit.
The following functions have to be used in the program:
i. double square (double s); - this function will return perimeter of square
ii. double rectangle (double 1, double w) ; - this function will return perimeter of rectangle
iii. double circle (double r): - this function will return circumference of circle
The following formulas are to be used to calculate the perimeter of a square, a triangle and the circumference of a circle:
Perimeter of a square = 4s where s is the side of the square.
Perimeter of a rectange = a +b +cwhere a, b and c are the sides of the rectangle.
Circumference of a circle = 2 mr where TT= 3.142 and r= radius.
Please write your answer below:
A Source D
BI
作 量
ST2
Styles
Fornat
Size
A- A
32°C Light rain](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F457bb456-4a19-43a7-94e6-c04b13b6206a%2Faf113967-170e-4a23-83d5-40a37bd97294%2Fqdvae08_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Houl 4O
Part E Question 1 Part E Question 2 Part E Question 3 Part E Question 4 Part E Question 5 Part F Question 6
Question 6
Write a program to calculate the perimeter of a square, a rectangle and the circumference of a circle. Ask user to key in the required details
depending on their selected shape. The program will keep asking user for input unless the user enters 0 to exit.
The following functions have to be used in the program:
i. double square (double s); - this function will return perimeter of square
ii. double rectangle (double 1, double w) ; - this function will return perimeter of rectangle
iii. double circle (double r): - this function will return circumference of circle
The following formulas are to be used to calculate the perimeter of a square, a triangle and the circumference of a circle:
Perimeter of a square = 4s where s is the side of the square.
Perimeter of a rectange = a +b +cwhere a, b and c are the sides of the rectangle.
Circumference of a circle = 2 mr where TT= 3.142 and r= radius.
Please write your answer below:
A Source D
BI
作 量
ST2
Styles
Fornat
Size
A- A
32°C Light rain
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning