(d) Identify the input, output and process required to solve this problem. (e) Write a function named aircondCost that performs this calculation. The function should accept the number of hours per day and number of operating days per month. It should return the total electricity cost per month. (f) Write the complete program source code for this problem. You must use function that created in Q3(b) in your program. Input Validation: Do not accept number of months that is less than 0.

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
Answer all
(d) Identify the input, output and process required to solve this problem.
(e) Write a function named aircondCost that performs this calculation. The function
should accept the number of hours per day and number of operating days per month. It
should return the total electricity cost per month.
(f) Write the complete program source code for this problem. You must use function that
created in Q3(b) in your program.
Input Validation: Do not accept number of months that is less than 0.
Transcribed Image Text:(d) Identify the input, output and process required to solve this problem. (e) Write a function named aircondCost that performs this calculation. The function should accept the number of hours per day and number of operating days per month. It should return the total electricity cost per month. (f) Write the complete program source code for this problem. You must use function that created in Q3(b) in your program. Input Validation: Do not accept number of months that is less than 0.
Assuming, a lhp air conditioner has a power consumption of 860W regardless of the Energy
Efficiency Ratio (EER) or any environmental and weather factors that can cause the air
conditioner to consume more energy or less power. As a programmer, you are required to
design a C++ program to calculate the cost of electricity used by the 1hp air conditioner in a
year. Table Q3 shows the electricity tariff per month. Figure Q3 shows an output example of
the program. kWh = power (kW) x hours (h).
Table Q3: Electricity usage tariff
Electricity Usage
Tariff
For the first 200 kWh (1-200 kWh) per month
25 cents/kWh
For the next kWh (201 kWh onwards) per month
30 cents/kWh
OUTPUT CONSOLE
Electricity Cost Calculator
(1hp Air Conditioner)
No. of operating hours per day: 8 [Enter]
No. of operating days per month: 20 [Enter]
No. of operating months per year: 12 [Enter]
Total electricity cost per year: RM 412.80
Figure Q3: Output sample
Transcribed Image Text:Assuming, a lhp air conditioner has a power consumption of 860W regardless of the Energy Efficiency Ratio (EER) or any environmental and weather factors that can cause the air conditioner to consume more energy or less power. As a programmer, you are required to design a C++ program to calculate the cost of electricity used by the 1hp air conditioner in a year. Table Q3 shows the electricity tariff per month. Figure Q3 shows an output example of the program. kWh = power (kW) x hours (h). Table Q3: Electricity usage tariff Electricity Usage Tariff For the first 200 kWh (1-200 kWh) per month 25 cents/kWh For the next kWh (201 kWh onwards) per month 30 cents/kWh OUTPUT CONSOLE Electricity Cost Calculator (1hp Air Conditioner) No. of operating hours per day: 8 [Enter] No. of operating days per month: 20 [Enter] No. of operating months per year: 12 [Enter] Total electricity cost per year: RM 412.80 Figure Q3: Output sample
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

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