#include <iostream>
using namespace std;
int main()
	{
		int code;
		int totalunit,totalpay;
		
		cout << "|| Muna's bill payment. ||" << endl;
		cout << "***|| USER CODE ||***" << endl;
		cout << "|1. Household \t 2. Office       |" << endl;
		cout << "| 3. Factory  \t 4. Program End  |" << endl << endl<<endl;
		cout << "Hi, Welcome! Please enter your user code: ";
		
		cin >> code;
		
		if (( code >0)&& (code <4))
		{
			cout << "Please enter your consumption total unit: ";
			cin >> totalunit;
			
		switch (code)
		{
			case 1 : if (totalunit <= 500)
						{
							totalpay = totalunit*0.10;
						} 
					else {
						totalpay=(500*0.10)+(totalunit-500)*0.25;
					}
					cout << "The total pay is RM "<< totalpay;
					break;		
			
			case 2 : if (totalunit <= 1000)
						{
							totalpay = totalunit*0.25;
						} 
					else {
						totalpay=(1000*0.25)+(totalunit-1000)*0.50;
					}
					cout << "The total pay is RM "<< totalpay;
					break;	
			
			case 3 : if (totalunit <= 1500)
						{
							totalpay = totalunit*0.5;
						} 
					else {
						totalpay=(1500*0.50)+(totalunit-1500)*0.75;
					}	
					cout << "The total pay is RM "<< totalpay;
					break;		
			
			case 4 : cout << "\nProgram is ended . Thankyou, come again!!\n";		
					break;		
					
		}	
		}
		else 
		cout << "Program is ended . Thankyou, come again!!\n";
		return 0;
	}
		
		
