- 分享
- 0
- 人气
- 0
- 主题
- 11
- 帖子
- 370
- UID
- 511120
- 积分
- 229
- 阅读权限
- 14
- 注册时间
- 2012-7-23
- 最后登录
- 2014-1-24
- 在线时间
- 2157 小时
|
Super-Tomato 发表于 2013-3-27 10:08 PM
每寫到 { 后的下一行就加個間隔,好方便自己知道 body 結構有沒有錯
#include<iostream>
using namespace std;
int main()
{
double number=0;
double selected=0;
double member;
char yn;
do{
cout<<" BODY TREATMENT"<<endl;
cout<<"=============================================================="<<"\n";
cout<<" TREATMENTS RATES"<<"\n\n";
cout<<"1. HERBAL BATH\t\t\t\t RM 200"<<"\n\n";
cout<<"2. TRADITIONAL MASSAGE RM 110 (60 Minutes)"<<"\n\n";
cout<<"3. TRADITIONAL MASSAGE RM 150 (90 Minutes)"<<"\n\n";
cout<<"4. TRADITIONAL MASSAGE RM 190 (120 Minutes)"<<"\n\n";
cout<<"5. TRADITIONAL AROTHERAPY MASSAGE RM 130 (60 Minutes)"<<"\n\n";
cout<<"6. TRADITIONAL AROTHERAPY MASSAGE RM 170 (90 Minutes)"<<"\n\n";
cout<<"7. TRADITIONAL AROTHERAPY MASSAGE RM 210 (120 Minutes)"<<"\n\n";
cout<<"==============================================================="<<"\n\n\n";
cout<<" Hair Treatment"<<endl;
cout<<"==============================================================="<<"\n";
cout<<" TREATMENT RATES"<<"\n\n";
cout<<"8. HAIR CUT RM 35"<<"\n\n";
cout<<"9. SHAMPOO & BLOW RM 28 (Long)"<<"\n\n";
cout<<"10. SHAMPOO & BLOW RM 20 (SHort)"<<"\n\n";
cout<<"11. COLORING RM 110 (Long)"<<"\n\n";
cout<<"12. COLORING RM 95 (Short)"<<"\n\n";
cout<<"13. HAIR SPA RM 220 (Long)"<<"\n";
cout<<"*(Wash,hair mask, wash scalp massage with cream,steam shoulder scrub and massage, hair tonic & blow dry)"<<"\n\n";
cout<<"14. HAIR SPA RM 180 (Short)"<<"\n";
cout<<"*(Wash,hair mask, wash scalp massage with cream,steam shoulder scrub and massage, hair tonic & blow dry)"<<"\n\n";
cout<<"============================================================"<<"\n\n\n";
cout<<"PLEASE ENTER BODY/HAIR STREATMENT NUMBER:"<<"\n";
cin>>number;
cout<<"TOTAL:"<<number<<"\n\n";
if(number==1)
selected=selected+200;
else
if(number==2)
selected=selected+110;
else
if(number==3)
selected=selected+150;
else
if(number==4)
selected=selected+190;
else
if(number==5)
selected=selected+130;
else
if(number==6)
selected=selected+170;
else
if(number==7)
selected=selected+210;
else
if(number==8)
selected=selected+35;
else
if(number==9)
selected=selected+28;
else
if(number==10)
selected=selected+20;
else
if(number==11)
selected=selected+110;
else
if(number==12)
selected=selected+95;
else
if(number==13)
selected=selected+220;
else
if(number==14)
selected=selected+180;
else
cout<<"ERROR.PLEASE TRY AGAIN!\n\n\n";
cout<<"TOTAL PAYMENT: RM "<<selected<<"\n\n";
{
char userInput;
cout << "MEMBER ?"<<"\n";
cout<<"* y=YES;n=NO";
cin >> userInput;
if(userInput == 'Y' || userInput == 'y')
{
selected=selected-(selected*0.25);
}
}
cout<<"\n\n";
cout<<"TOTAL PAYMENT: RM "<<selected<<"\n\n\n";
cout<<"THANK YOU. PLEASE COME AGAIN!"<<"\n\n";
cout<<"DO YOU WANT TO DO THE NEXT PAYMENT?: "<<"\n";
cout<<"* y=YES;n=NO";
cin>>yn;
}while(yn=='y'||yn=='Y');
return 0;
}
解决了~~~比如我要付1个以上的钱来怎样弄? |
|