67 135
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #31580 in C++ for REHAN

Question #31580
I WANT TO GET CODING C++ PROGRAMMING
WRITE A C PROGRAM THAT CALCULATE ELECTRICITY BILL WITH FOLLOWING CRITERIA
IF UNITS CONSUMED<300,UNITS*2
IF UNITS CONSUMED>300,<=500,UNITS*5
UNITS CONSUMED>500,UNITS*
LINE RENT 150........


THANKS
Expert's answer
#include <iostream>
#include <conio.h>

using namespace std;

//main function
int main()
{
float CONSUMED;
cout<<"Enter CONSUMED: ";//input CONSUMED
cin>>CONSUMED;//read CONSUMED
if(CONSUMED<300){
CONSUMED*=2;
}
if(CONSUMED>300 && CONSUMED<=500 ){
CONSUMED*=5;
}
if(CONSUMED>500){
CONSUMED*=150;
}
//show result
cout<<"You must pay $"<<CONSUMED;

int k;
cin>>k;
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions