02-11-2013, 10:17 PM
|
|
|
تاريخ التسجيل: Nov 2013
الكلية: مسار السنة التحضيرية علمي
التخصص: اداري
نوع الدراسة: تحضيري علمي خطة أ
المستوى: الأول
البلد:
منطقة الرياض
الجنس: أنثى
المشاركات: 1
|
|
واجب برمجه:(
السلام عليكم
عندي واجب حل شيت وما عرفت هالسؤال
الله يسعدكم ساعدوني
(Optional question) Try to use labels and goto command to return To the main menu each time such that:
#include <iostream>
using namespace std;
int main()
{
char Answer; menu: / / menu return label
cout<<"\n\n***Welcome to the my Bookshelf***"<<endl;
cout<<"-******‐-******‐-******‐Whatdo you want to do?"<<endl;
cout<<"1-******‐Display my books..."<<endl;
cout<<"2-******‐Borrow a book..."<<endl;
cout<<"3-******‐Return a book..."<<endl;
cout<<"4-******‐Quit..."<<endl;
cout<<"enter 1,2,3 or 4 for the above menu:";
cin>>Answer; if(Answer=='1') {….}
if(Answer=='2') {….}
if(Answer=='3') {….}
if(Answer=='4') goto out; // to quit the program goto
menu; // goto menu label
out:// out label to quit the program
system("pause");
return 0;
}
</SPAN>
|