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 :)
- #include <iostream.h>
- #include <conio.h>
- void main()
- {
- clrscr();
- float id,amt,pd,d,net;
- cout<<"Please enter product ID: ";
- cin>>id;
- cout<<"Please enter Sales ammount: ";
- cin>>amt;
- if (amt<5000)
- d=.2*amt;
- else if (amt>=5000 && amt<=10000)
- d=.3*amt;
- //Coding by: Snehil Khanor
- //http://WapCPP.blogspot.com
- else
- d=.4*amt;
- net=amt-d;
- cout<<"Discount= "<<d;
- cout<<"\nNet ammount= "<<net;
- getch();
- }
0 comments:
Post a Comment