Write a program that calculates average water consumption and average water cost of a house. Program must have the steps below: 1. Ask user to to input monthly consumption for 12 months and store this data in an array. 2. Define a function to calculate monthly cost of water. Store calculated results in an array. Water price is 4 tl/m³ up to 15 m/month (<=15) and 6 tl/m³ for more than 15 m/month. (Not the over consumption. For all consumption.) Display the calculated data on screen. 3. Define a function to calculate average water consumption. 4. Display the results on the screen just as shown below. Microsoft Visual Studio Debug Console Enter water consumption for one month: 5 Enter water consumption for one month: 10 Enter water consumption for one month: 15 Enter water consumption for one month: 20 Enter water consumption for one month: 5 Enter water consumption for one month: 10 Enter water consumption for one month: 15 Enter water consumption for one month: 20 Enter water consumption for one month: 5 Enter water consumption for one month : 10 Enter water consumption for one month: 15 Enter water consumption for one mon th: 20 Month Consumption Price 5.00 10.00 15.00 20.00 5.00 10.00 15.00 20.00 5.00 10.00 15.00 20.00 20.00 40.00 60.00 120.00 20.00 40.00 60.00 120.00 20.00 40.00 60.00 120.00 12 Average water consumption is 12.500000 m3. 123456709 11
Write a program that calculates average water consumption and average water cost of a house. Program must have the steps below: 1. Ask user to to input monthly consumption for 12 months and store this data in an array. 2. Define a function to calculate monthly cost of water. Store calculated results in an array. Water price is 4 tl/m³ up to 15 m/month (<=15) and 6 tl/m³ for more than 15 m/month. (Not the over consumption. For all consumption.) Display the calculated data on screen. 3. Define a function to calculate average water consumption. 4. Display the results on the screen just as shown below. Microsoft Visual Studio Debug Console Enter water consumption for one month: 5 Enter water consumption for one month: 10 Enter water consumption for one month: 15 Enter water consumption for one month: 20 Enter water consumption for one month: 5 Enter water consumption for one month: 10 Enter water consumption for one month: 15 Enter water consumption for one month: 20 Enter water consumption for one month: 5 Enter water consumption for one month : 10 Enter water consumption for one month: 15 Enter water consumption for one mon th: 20 Month Consumption Price 5.00 10.00 15.00 20.00 5.00 10.00 15.00 20.00 5.00 10.00 15.00 20.00 20.00 40.00 60.00 120.00 20.00 40.00 60.00 120.00 20.00 40.00 60.00 120.00 12 Average water consumption is 12.500000 m3. 123456709 11
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...
Related questions
Question
100%
C language

Transcribed Image Text:Write a program that calculates average water consumption and average water cost of a
house. Program must have the steps below:
1. Ask user to to input monthly consumption for 12 months and store this data in an
array.
2. Define a function to calculate monthly cost of water. Store calculated results in an
array.
Water price is 4 tl/m³ up to 15 m/month (<=15) and 6 tl/m? for more than 15
m/month. (Not the over consumption. For all consumption.) Display the calculated
data on screen.
3. Define a function to calculate average water consumption.
4. Display the results on the screen just as shown below.
E Microsoft Visual Studio Debug Console
Enter water consumption for one month: 5
Enter water consumption for one month: 10
Enter water consumption for one month: 15
Enter water consumption for one month: 20
Enter water consumption for one month: 5
Enter water consumption for one month: 10
Enter water consumption for one month: 15
Enter water consumption for one month: 20
Enter water consumption for one month: 5
Enter water consumption for one month: 10
Enter water consumption for one month:
Enter water consumption for one month: 20
15
Month
Consumption
Price
5.00
10.00
15.00
20.00
5.00
10.00
15.00
20.00
5.00
10.00
15.00
20.00
20.00
40.00
60.00
120.00
20.00
40.00
60.00
120.00
20.00
40.00
60.00
120.00
12
Average water consumption is 12.500000 m3.
Expert Solution

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 3 steps with 3 images

Recommended textbooks for you

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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

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
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY