-4
私はC++プログラムを作成しました。これで私はユーザーのための多くのオプションを追加しました。 しかし、すべての選択肢では、ユーザーがプログラムを終了するか、または彼の選択に応じてメインメニューに戻ることができる機能を追加する必要があります。私のC++コードの「メインメニューに戻る」機能が必要
#include<iostream.h>
#include<conio.h>
void main()
clrscr();
int choice,p_card;
char text0,text1;
cout<<"\n\n\t\t\t \"Welcome to Zinc hospital\"\n\n\n";
cout<<"\tMENU\n";
cout<<"\n\n1. Emergency treatment\n\n";
cout<<"2. Common treatment\n\n";
cout<<"3. Regular checkups\n\n";
cout<<"4. Get appointment\n\n";
cout<<"5. Consult specialist\n\n";
cout<<"6. Pay due amount\n\n";
cout<<"7. Log in for new patient card\n\n";
cout<<"8. For suggestions, feedbacks and register complains\n\n";
cout<<"\n\t\t\t\t\t\t\t\tChoice______";
cin>>choice;
clrscr();
if(choice==1)
{
int e_choice;
cout<<"\n\n\n Enter the type of emergency";
cout<<"\n\n1. Accidental case";
cout<<"\n\n2. Heavy injury case";
cout<<"\n\n3. Delicate organ injury\n\n";
cout<<"4. Any other\n\n";
cout<<"\n\n\t\t\t\t\t\t\tEmergency choice____";
cin>>e_choice;
if(e_choice==4)
{
cout<<"Please specify the type of emergency ";
cin>>text0;
}
cout<<"\n\n\n\n\t\t\t \"EMERGENCY DECLARED\"\n\n\t \'Please quickly proceed to the operation theatre with patient\'";
}
if(choice==2)
{
cout<<"\n\nEnter the patient card number\n\n\t";
cout<<"\t\t\tCard No.______";
cin>>p_card;
cout<<"\n\n\t\t\tYour card has been recognized succesfully.";
cout<<"\n\n\nNow enter the specific treatment to be provided___";
cin>>text0;
cout<<"\n\n\n\n \t\t\tDATA recorded succesfully";
cout<<"\n\nYour card has been charged $10.\n\n\n\n Please proceed to counter to get the room no. and wait list serial.";
}
else if(choice==3)
{
cout<<"";//Under construction
}
else if(choice==4)
{
cout<<"";//Under construction
}
else if(choice==5)
{
cout<<"";//Under construction
}
else if(choice==6)
{
cout<<"";//Under construction
}
else if(choice==7)
{
cout<<"";//Under construction
}
else if(choice==8)
{
cout<<"";//Under construction
}
else if(choice!=1&&choice!=2&&choice!=3&&choice!=4&&choice!=5&&choice!=6&&choice!=7&&choice!=8)
{
cout<<"Invalid choice inputed";
cout<<"\n\n\n\n\n\n\t\[email protected] ERROR";
}
getch();
}
スタックオーバーフローは、人々があなたのために無料で機能を書く場所ではありません。 –
意味は....私は助けてくれない! –
いいえ、それはそれが意味するものではありません。私が望むなら、あなたのためにこれを解決することができます。ニースを試してみてください。 –