Plenitude Property Developer offers freehold land in Penang to buyers only originated from Penang. Buyers get to choose the shape of land they want to buy. The cost of 1 m land is RM 20.00. Write a program to calculate perimeter, area and price of the land based on input of land shape and its size from buyers. The land shape details approved by the company are shown in Table 1. Table 1: Land shape and details Shape Perimeter Measurement Area Measurement R: Rectangle Perimeter-2 x (width + length) Area= width x length P: Pentagon Perimeter side x 5 S: Square Area= 5.0/2.0 x side x apothem length Area side x side Perimeter= side x 4 The program must include the following functions: 1) void calculatesRectangle(float length, float width, float "perimeterR, float "areaR) accepts value of length and width of rectangle from main function accepts address location of perimeterR and areaR calculates perimeter and area and assign to perimeterR and areaR respectively 2) void calculatesPentagon(float side, float apothem, float "perimeterP, float "areaP) • accepts value of side and apothem of pentagon from main function • accepts address location of perimeterP and areaP • calculates perimeter and area and assign to perimeterP and areaP respectively 3) void calculatesSquare(float side, float "perimeterS, float "areaS) accepts value of side of square from main function accepts address location of perimeterS and areas calculates perimeter and area and assign to perimeterS and areas respectively 4) float calculatePrice(float area) accepts value of area from main() function calculates price based on area and return the value of price 5) void printingResult(float pmeter,float area, float price) • Display the result of pmeter, area and price Loop the program until user input is other than 'R' ,'P' or 'S'. The program output should be as follows:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write a C program
Plenitude Property Developer offers freehold land in Penang to buyers only originated from Penang.
Buyers get to choose the shape of land they want to buy. The cost of 1 m2 land is RM 20.00. Write a
program to calculate perimeter, area and price of the land based on input of land shape and its size
from buyers. The land shape details approved by the company are shown in Table 1
Table 1: Land shape and details
Shape
Perimeter Measurement
Area Measurement
R: Rectangle
Perimeter-2 x (width + length) Area= width x length
P: Pentagon
S: Square
Perimeter= side x 5
Area= 5.0/2.0 x side x apothem length
Area= side x side
Perimeter= side x 4
The program must include the following functions:
1) void calculatesRectangle(float length, float width, float *perimeterR, float *areaR)
• accepts value of length and width of rectangle from main function
accepts address location of perimeterR and areaR
• calculates perimeter and area and assign to perimeterR and areaR respectively
2) void calculatesPentagon(float side, float apothem, float *perimeterP, float *areaP)
accepts value of side and apothem of pentagon from main function
accepts address location of perimeterP and areaP
calculates perimeter and area and assign to perimeterP and areaP respectively
3) void calculatesSquare(float side, float *perimeterS, float *areaS)
accepts value of side of square from main function
accepts address location of perimeterS and areas
calculates perimeter and area and assign to perimeterS and areas respectively
4) float calculatePrice(float area)
accepts value of area from main() function
• calculates price based on area and return the value of price
5) void printingResult(float pmeter,float area, float price)
• Display the result of pmeter, area and price
Loop the program until user input is other than 'R' ,'P' or 'S'. The program output should be as
follows:
Plenitude Property Developer
---
-----
----
Enter shape of the land (R: Rectangle, P: Pentagon, S: Square) : R
Please enter length (m) : 10.5
Please enter width ( m) : 8.5
RESULT
Perimeter : 38.00m.
Area: 89.25m2
Price: RM 1785.00
Enter shape of land (R: Rectangle, P: Pentagon) : P
Please enter side length (m) : 11
Please enter apothem distance ( m) : 9.5
RESULT
Perimeter : 55.00m
Area: 261.25m2
Price: RM 5225.00
Transcribed Image Text:Plenitude Property Developer offers freehold land in Penang to buyers only originated from Penang. Buyers get to choose the shape of land they want to buy. The cost of 1 m2 land is RM 20.00. Write a program to calculate perimeter, area and price of the land based on input of land shape and its size from buyers. The land shape details approved by the company are shown in Table 1 Table 1: Land shape and details Shape Perimeter Measurement Area Measurement R: Rectangle Perimeter-2 x (width + length) Area= width x length P: Pentagon S: Square Perimeter= side x 5 Area= 5.0/2.0 x side x apothem length Area= side x side Perimeter= side x 4 The program must include the following functions: 1) void calculatesRectangle(float length, float width, float *perimeterR, float *areaR) • accepts value of length and width of rectangle from main function accepts address location of perimeterR and areaR • calculates perimeter and area and assign to perimeterR and areaR respectively 2) void calculatesPentagon(float side, float apothem, float *perimeterP, float *areaP) accepts value of side and apothem of pentagon from main function accepts address location of perimeterP and areaP calculates perimeter and area and assign to perimeterP and areaP respectively 3) void calculatesSquare(float side, float *perimeterS, float *areaS) accepts value of side of square from main function accepts address location of perimeterS and areas calculates perimeter and area and assign to perimeterS and areas respectively 4) float calculatePrice(float area) accepts value of area from main() function • calculates price based on area and return the value of price 5) void printingResult(float pmeter,float area, float price) • Display the result of pmeter, area and price Loop the program until user input is other than 'R' ,'P' or 'S'. The program output should be as follows: Plenitude Property Developer --- ----- ---- Enter shape of the land (R: Rectangle, P: Pentagon, S: Square) : R Please enter length (m) : 10.5 Please enter width ( m) : 8.5 RESULT Perimeter : 38.00m. Area: 89.25m2 Price: RM 1785.00 Enter shape of land (R: Rectangle, P: Pentagon) : P Please enter side length (m) : 11 Please enter apothem distance ( m) : 9.5 RESULT Perimeter : 55.00m Area: 261.25m2 Price: RM 5225.00
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY