PRF192_-_PE01_-_SU_2025_3994.webp
M

PRF192_-_PE01_-_SU_2025_3994.webp

  • Media owner Maki2001
  • Ngày thêm
Kizspy.me Do not edit given statements in the main function. If you change, the grading software
may not be able to mark and the exam result will be 0.
Question 1: (2 marks)
The given file Q1.c already contains statements to input the double variable named water_usage
(assume that the water_usage> 0). You should write statements to calculate the total water bill
based on the following pricing scheme:
Notes:
The first 5 cubic meters (m³) are charged at 3000 VND per m³.
The next 4 cubic meters (from 6m³ to 9m³) are charged at 5000 VND per m³.
From tenth cubic meters and above are charged at 7000 VND per m³.
- You can create new functions if you see it is necessary.
-Do not edit given statements in the main function.
-The output result is formatted in two decimal places
Sample input and output:
Input:
water_usage=12.5
After processing: 5*3000 + 4 * 5000+ 3.5 * 7000 = 59500
Output for marking:
OUTPUT:
59500.00
Question 2:
Zoom
+100%
Close
Chưa có bình luận nào.

Thông tin

Category
PRF192
Thêm bởi
Maki2001
Ngày thêm
Lượt xem
4,907
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom