// "Answer on Question #37520, Programming, C++
#include<string.h>
#include<iostream>
using namespace std;
int main() {
int a, s, d, z;
cout << "Enter the number of units consumed by a customer: ";
cin >> a;
if (a < 200)
z = 1.9 * 200;
if (a > 200 && a < 300)
z = 1.9 * 200 + (a - 200) * 3;
if (a > 300 && a < 500)
z = 1.9 * 200 + 100 * 3 + (a - 300) * 5;
if (a > 500)
z = (1.9 * 200 + 100 * 3 + (a - 300) * 5) * 1.15;
cout << "Charges " << z << endl;
system("Pause");
}
Comments