Showing posts with label bill. Show all posts
Showing posts with label bill. Show all posts

Write a program to store consumer number and number of calls and calculate telephone bill accordin to condition

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 :)



  1. #include <iostream.h>
  2. #include <conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. float id,qty,tot,amt;
  7. cout<<"Enter Customer No.: ";
  8. cin>>id;
  9. cout<<"Please Enter No. of Calls: ";
  10. cin>>qty;
  11. if(qty<=100)
  12. amt=0;
  13. else if(qty>100&&qty<=200)
  14. amt=1.40*(qty-100);
  15. //Coding by: Snehil Khanor
  16. //http://WapCPP.blogspot.com
  17. else if(qty>200&&qty<=300)
  18. amt=140+1.60*(qty-200);
  19. else if(qty>300&&qty<=400)
  20. amt=300+1.80*(qty-300);
  21. else
  22. amt=480+2.10*(qty-400);
  23. tot=100+amt;
  24. cout<<"\n\n\nCustomer NO.: "<<id<<"\nNo. of Calls: "<<qty<<"\nMonthly Rental:
  25. INR 100\nTotal amt: INR "<<tot;
  26. getch();
  27. }

Write a program to store product number, price of each item, & quantity and calculate total ammount, then find disocunt at 30% and Generate bill

Product number, price of each item and quantity are taken from the user and dicount and net ammount is calculated.
Bill is Displayed as follows:
Product ID:
Quantity:
Total ammount:
Discount:
Net ammount:

Select To use this code as it is.. select and copy paste this code into code.cpp file :)



  1. #include <iostream.h>
  2. #include <conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. int id,qty;
  7. float tot,amt,price,dis;
  8. cout<<"Enter Product ID: ";
  9. cin>>id;
  10. cout<<"Please Enter Quantity: ";
  11. cin>>qty;
  12. cout<<"Please Enter Price per ITEM: INR ";
  13. cin>>price;
  14. tot=qty*price;
  15. dis=.3*tot;
  16. amt=tot-dis;
  17. //Coding by: Snehil Khanor
  18. //http://WapCPP.blogspot.com
  19. cout<<"\n\n\nProduct ID: "<<id<<"\nQuantity: "<<qty<<"\nPrice Per ITEM: INR
  20. "<<price<<"\nTotal amt: INR "<<tot<<"\nDiscount @ 30% : INR "<<dis<<"\nNet
  21. Ammount: INR "<<amt;
  22. getch();
  23. }

Write a program to store product ID and sales ammount and calculate discount accordin to condition and calculate net ammount

Take Product ID and Sales ammount from user.
Calculated Discount ammount according to condition:
If amt < 5000 then discount = 20%
If ammount >= 5000 And <= 10000 then discount = 30%
otherwise discount= 40%

Select To use this code as it is.. select and copy paste this code into code.cpp file :)



  1. #include <iostream.h>
  2. #include <conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. float id,amt,pd,d,net;
  7. cout<<"Please enter product ID: ";
  8. cin>>id;
  9. cout<<"Please enter Sales ammount: ";
  10. cin>>amt;
  11. if (amt<5000)
  12. d=.2*amt;
  13. else if (amt>=5000 && amt<=10000)
  14. d=.3*amt;
  15. //Coding by: Snehil Khanor
  16. //http://WapCPP.blogspot.com
  17. else
  18. d=.4*amt;
  19. net=amt-d;
  20. cout<<"Discount= "<<d;
  21. cout<<"\nNet ammount= "<<net;
  22. getch();
  23. }

Check out this stream