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
1
Expert's answer
2013-06-05T08:51:33-0400
#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

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS
paypal