Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. In this exercise, you are required to write a C++ program that calculates a c

ID: 3606057 • Letter: 1

Question

1. In this exercise, you are required to write a C++ program that calculates a customer's monthly water usage bill, using tariffs given in Table 1 and Table 2. The total amount to pay is made up of Portable water cost+ Waste Water Costs. 2. ABC Corporation Tariffs Table 1: Domestic, Commercial &Industrial; Portable Water Tariffs EXCL.VATTdL.VAT.@12% | Tariff Block Category Minimum Charge 0 0-5 kl >5-15 kl 15-25 kl >25-40 kl 40 kl 3.50 10.40 18.20 28.00 35.00 3.92 11.65 20.38 31.36 39.20 DOMESTIC CONSUMERS ONLY: First 5 kl exempt from VAT Table 2: Domestic, Commercial & Industrial WASTE Water Tariffs Tariff Block Category Minimum Charge 0-5 kl >5-15 kl >15-25 kl >25-40 kl >40 kl EXCL. VAT | ICL. VAT @ 12% 0.65 2.60 3.90 5.20 6.50 0.73 2.91 4.37 5.82 7.28

Explanation / Answer

#include <iostream>
using namespace std;
int main()
{
int number, wat, ch;
double port, waste, tot;
char name[20], location[30];
cout<<" Please Enter Name, Plot Number and Location: ";
cin>>name >>number >>location;
cout<<" Please Enter the Amount of water you have used in kilo litres: ";
cin>>wat;
cout<<" Please Enter";
cout<<" 1. Domestic User: ";
cout<<" 2. Commercial or Industrial User: ";
cout<<" Enter ";
cin>>ch;
switch(ch)
{
case 1:
cout<<" Plot " <<number <<" monthly Bill";
if(wat > 0 && wat < 5)
{
port = wat * 3.50;
}
if(wat > 5 && wat < 15)
{
port = wat * 10.40;
}
if(wat > 15 && wat < 25)
{
port = wat * 18.20;
}
if(wat > 25 && wat < 40)
{
port = wat * 28.00;
}
if(wat > 40)
{
port = wat * 35;
}
if(wat < 0)
{
port = 0;
}
cout<<" Portable water cost : " <<port;
if(port < 0)
{
waste = 0;
}
if(port > 0 && port < 5)
{
waste = 0.65;
}
if(port > 5 && port < 15)
{
waste = 2.60;
}
if(port > 15 && port < 25)
{
waste = 3.90;
}
if(port > 25 && port < 40)
{
waste = 5.20;
}
if(port > 40)
{
waste = 6.50;
}
tot = port + waste;
cout<<" Waster Water: " <<waste;
cout<<" Total amount: " <<tot;
break;
case 2:
cout<<" Plot " <<number <<" monthly Bill";
if(wat < 0)
{
port = 0;
}
if(wat > 0 && wat < 5)
{
port = wat * 3.92;
}
if(wat > 5 && wat < 15)
{
port = wat * 11.65;
}
if(wat > 15 && wat < 25)
{
port = wat * 20.38;
}
if(wat > 25 && wat < 40)
{
port = wat * 31.36;
}
if(wat > 40)
{
port = wat * 39.20;
}
  
cout<<" Portable water cost : " <<port;
if(port < 0)
{
waste = 0;
}
if(port > 0 && port < 5)
{
waste = 0.73;
}
if(port > 5 && port < 15)
{
waste = 2.91;
}
if(port > 15 && port < 25)
{
waste = 4.37;
}
if(port > 25 && port < 40)
{
waste = 5.82;
}
if(port > 40)
{
waste = 7.28;
}
tot = port + waste;
cout<<" Waster Water: " <<waste;
cout<<" Total amount: " <<tot;
break;
  
}
}

OUTPUT


Please Enter Name, Plot Number and Location: Kgosi 20150986 Gaborone
Please Enter the Amount of water you have used in kilo litres: 4
Please Enter
1. Domestic User:
2. Commercial or Industrial User
Choice: 1
Enter
Plot 20150986 monthly Bill
Portable water cost : 14
Waster Water: 2.6
Total amount: 16.6