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
icon
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
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
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,