Take Customer number and no. of calls from user.
Calculate Bill as follows..
If number of calls <=100 : Free
Number of calls >=200 <=300 : 1.40 per call on over 100
Number of calls >=300 <=400 : 140+1.60 per call on over 200
Number of calls >=300 <=400 : 300+1.80 per call on over 300
Number of calls >=400 : 480+2.10 per call on over 400
And Fixed monthly rental: RS 100
And generate bill.
Select To use this code as it is.. select and copy paste this code into code.cpp file :)
- #include <iostream.h>
- #include <conio.h>
- void main()
- {
- clrscr();
- float id,qty,tot,amt;
- cout<<"Enter Customer No.: ";
- cin>>id;
- cout<<"Please Enter No. of Calls: ";
- cin>>qty;
- if(qty<=100)
- amt=0;
- else if(qty>100&&qty<=200)
- amt=1.40*(qty-100);
- //Coding by: Snehil Khanor
- //http://WapCPP.blogspot.com
- else if(qty>200&&qty<=300)
- amt=140+1.60*(qty-200);
- else if(qty>300&&qty<=400)
- amt=300+1.80*(qty-300);
- else
- amt=480+2.10*(qty-400);
- tot=100+amt;
- cout<<"\n\n\nCustomer NO.: "<<id<<"\nNo. of Calls: "<<qty<<"\nMonthly Rental:
- INR 100\nTotal amt: INR "<<tot;
- getch();
- }
0 comments:
Post a Comment