0% found this document useful (0 votes)
15 views3 pages

Nama: Mustofa Kamal NPM: 2013020130 Kelas: 1C: Namespace

The document contains a C++ program that calculates water bills for different customer categories (general, residential, commercial) based on volume consumed. The program gets a category and volume from the user and outputs the total bill based on tiered rates.

Uploaded by

topa kamal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views3 pages

Nama: Mustofa Kamal NPM: 2013020130 Kelas: 1C: Namespace

The document contains a C++ program that calculates water bills for different customer categories (general, residential, commercial) based on volume consumed. The program gets a category and volume from the user and outputs the total bill based on tiered rates.

Uploaded by

topa kamal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Nama : Mustofa Kamal

NPM : 2013020130

Kelas : 1C

#include<iostream>
using namespace std;

int main(){
    char kat,y;
    
    cout<<">>>>>>PT Air Minum KAMAL <<<<<<\n\t";
    cout<<"F. Umum\n\t => 0-50 meter kubik 1000";
    cout<<"   \n\t => 51-100 meter kubik 1500";
    cout<<"   \n\t => >100 meter kubik 2500\n";
    cout<<"\n\tR. Perumahan Biasa\n\t => 0-50 meter kubik 4000";
    cout<<"   \n\t => 51-100 meter kubik 7000";
    cout<<"   \n\t => >100 meter kubik 10000\n";
    cout<<"\n\tN. Niaga\n\t => 0-50 meter kubik 7500";
    cout<<"   \n\t => 51-100 meter kubik 10000";
    cout<<"   \n\t => >100 meter kubik 13500\n";
    do{
        cout<<"\nMasukan Kategori (F, R, N): ";
        cin>>kat;
        if(kat == 'F'){
            int vol,jumlah;
            cout<<"Masukan jumlah Volume(meter kubik) : ";
            cin>>vol;
            if(vol < 50){
                jumlah=vol*1000;
                cout<<"Total Biaya : "<<jumlah;
            }else if(vol >50 && vol <101){
                jumlah=vol*1500;
                cout<<"Total Biaya : "<<jumlah;
            }else if(vol >100){
                jumlah=vol*2500;
                cout<<"Total Biaya : "<<jumlah;
            }
        }else if(kat == 'R'){
            int vol,jumlah;
            cout<<"Masukan jumlah Volume(meter kubik) : ";
            cin>>vol;
            if(vol < 50){
                jumlah=vol*4000;
                cout<<"Total Biaya : "<<jumlah;
            }else if(vol >50 && vol <101){
                jumlah=vol*7000;
                cout<<"Total Biaya : "<<jumlah;
            }else if(vol >100){
                jumlah=vol*10000;
                cout<<"Total Biaya : "<<jumlah;
            }
        }else if(kat == 'N'){
            int vol,jumlah;
            cout<<"Masukan jumlah Volume(meter kubik) : ";
            cin>>vol;
            if(vol < 50){
                jumlah=vol*7500;
                cout<<"Total Biaya : "<<jumlah;
            }else if(vol >50 && vol <101){
                jumlah=vol*10000;
                cout<<"Total Biaya : "<<jumlah;
            }else if(vol >100){
                jumlah=vol*13500;
                cout<<"Total Biaya : "<<jumlah;
            }
        }
        cout<<"\nInput Lagi? (y/n): ";
        cin>>y;
        if(y == 'n' || y == 'N'){
            break;
        }
    }while(true);
}

You might also like