2. Problem: Bills Description Write a program to calculate the average cost per month for a family over a period of time
Posted: Sun Jul 03, 2022 11:22 am
2. Problem: Bills Description Write a program to calculate the average cost per month for a family over a period of time. For each month the costs are as follows: ● For electricity - every month the bill is different and will be read from the console ● For water - 20$ For Internet - 15$ ● For others- sum the bills for electricity, water and Internet and add 20% For each bill, you need to calculate how much total is paid for all months. ● Input The input is read from the console: ● The months for which the average cost is searched - integer in range [1... 100] For each month - the bill for electricity - a real number in range [1.00... 1000.00] Output Print to the console 5 rows: ● ● "Electricity: electricity for all months" "Water: water for all months" "Internet: Internet for all months"
● The months for which the average cost is searched - integer in range [1... 100] For each month-the bill for electricity - a real number in range [1.00... 1000.00] ● Output Print to the console 5 rows: • "Electricity: electricity for all months" "Water: water for all months" ● "Internet: Internet for all months" ● "Other: Other for all months" • "Average: Average all costs per month" All bills should be formatted to the 2nd digit after the decimal point. Example 5 68.63 89.25 132.53 93.53 63.22 Input Output Electricity: 447.16 $ Water: 100.00 $ Internet: 75.00 $ Other: 746.59 $ Average: 273.75 $