Table 1: Test cases to run and test the program (user inputs are shown in red-bold text) TEST CASE 1 Welcome to XYZ house price calculator Please enter house type (A/B/C): D Please enter house type (A/B/C): a Please enter house type (A/B/C): A Square-feet area of the house (840-1920) : 900 Price of a type A house (900 square-feet) is RM 357750 TEST CASE 2 Welcome to XYZ house price calculator Please enter house type (A/B/C): B Square-feet area of the house (840-1920): 839 Square-feet area of the house (840-1920): 1921 Square-feet area of the house (840-1920): 900 Price of a type B house (900 square-feet) is RM 268965

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

 Write a C++ program to implement the house price calculation as specified by the above
flowcharts. Table 1 is the test cases that you can use to test the program and the details of the
input/output style of the program 

Below is the table provided by the XYZ house developer to determine house price based
on its type.
Price/Square-Feet
RM 397.50
Туре
A
RM 298.85
RM 318.30
B
Figures 1(a) and 1(b) are the flowcharts of the program proposed to calculate house
price based on its type and square-feet area. It gets the inputs that are the type and the square-
feet area of the house from the user before calculating the price by following the rate given by
the developer.
Start
char houseType
int sqft = 0
double price = 0
price = calcPrice(houseType, sqft)
Display
Display "Welcome
to XYZ house price
calculator"
houseType, price
End
Get houseType
HouseType
is
A or B or C?
840 <= sqft <= 1920
F
Get sqft
Figure 1(a): Flowchart to calculate house price
2
calcPrice(houseType, sqft)
double p=0
HouseType
is A?
p= sqft x 397.50
HouseType
is B?
p= sqft x 298.85
HouseType
is C?
p= sqft x 318.30
Return p
Figure 1(b): Flowchart to calculate house price
Transcribed Image Text:Below is the table provided by the XYZ house developer to determine house price based on its type. Price/Square-Feet RM 397.50 Туре A RM 298.85 RM 318.30 B Figures 1(a) and 1(b) are the flowcharts of the program proposed to calculate house price based on its type and square-feet area. It gets the inputs that are the type and the square- feet area of the house from the user before calculating the price by following the rate given by the developer. Start char houseType int sqft = 0 double price = 0 price = calcPrice(houseType, sqft) Display Display "Welcome to XYZ house price calculator" houseType, price End Get houseType HouseType is A or B or C? 840 <= sqft <= 1920 F Get sqft Figure 1(a): Flowchart to calculate house price 2 calcPrice(houseType, sqft) double p=0 HouseType is A? p= sqft x 397.50 HouseType is B? p= sqft x 298.85 HouseType is C? p= sqft x 318.30 Return p Figure 1(b): Flowchart to calculate house price
Table 1: Test cases to run and test the program (user inputs are shown in red-bold text)
TEST CASE 1
Welcome to XYZ house price calculator
Please enter house type (A/B/C) : D
Please enter house type (A/B/C): a
Please enter house type (A/B/C) : A
Square-feet area of the house (840-1920): 900
Price of a type A house (900 square-feet) is RM 357750
TEST CASE 2
Welcome to XYZ house price calculator
Please enter house type (A/B/C) : B
Square-feet area of the house (840-1920) : 839
Square-feet area of the house (840-1920): 1921
Square-feet area of the house (840-1920): 900
Price of
ype B house (900 square-feet) is RM 268965
3
TEST CASE 3
Welcome to XYZ house price calculator
Please enter house type (A/B/C) : C
Square-feet area of the house (840-1920): 1920
Price of a type C house (1920 square-feet) is RM 611136
Transcribed Image Text:Table 1: Test cases to run and test the program (user inputs are shown in red-bold text) TEST CASE 1 Welcome to XYZ house price calculator Please enter house type (A/B/C) : D Please enter house type (A/B/C): a Please enter house type (A/B/C) : A Square-feet area of the house (840-1920): 900 Price of a type A house (900 square-feet) is RM 357750 TEST CASE 2 Welcome to XYZ house price calculator Please enter house type (A/B/C) : B Square-feet area of the house (840-1920) : 839 Square-feet area of the house (840-1920): 1921 Square-feet area of the house (840-1920): 900 Price of ype B house (900 square-feet) is RM 268965 3 TEST CASE 3 Welcome to XYZ house price calculator Please enter house type (A/B/C) : C Square-feet area of the house (840-1920): 1920 Price of a type C house (1920 square-feet) is RM 611136
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education