بليييييييييز أرجو تساعدوني ضروري الله يسعدكم
بسم الله الرحمن الرحيم
هاي شباب كيفكم ان شاء الله بخير
شباب أبي فزعتكم عندي واجب في الجامعة في ال ++C
وأبغاه بطريقة الفانكش function الله يخليكم عشان لازم أسلمه للدكتورة
وهذا السؤوال :
--------------------------------------------------------------------------------------
write a program for a fast food restaurant.
the program will contain the followingt menu.
1- food menu.
2- Calculate daily prfits. (أرباح).
3- Quit.
when the user chooses the first choixe Food Menu the following menu will appear :
choixes Prices
1- Beef Burger . 10 SR
2-French fires. 4 SR
3-Pepsi. 2 SR
4-Pizza. 15 SR
When the user chooses any of the above the program will ask hem if he wants to add
another order (Y,N) . If the user chooses Y as a yes answer that means he wants to
continue to add another order so the program will wiew the menu again to enable the user
to choose another order .
That process continues tell the user press N as a no answer for the question.
DO YOU WANT TO CONTINUE ?
After letter N is pressed by the user the program will calculate the total price of the things
he has chosen and then wiew the first menu.
After the first menu appears the user will be anle to choose the second choice Calculate
daily profits , if so the program will ask the user about the day outcome and income . After
that, the program will be be able to calculate.
Day profit = income - outcome
Print the Day Profit for the user on the screen then return to the first menu.
if the user chooses the third choice Quit the program terminates.
ومشكورين مقدما
بليز الله يوفقكم يااااااارب وياليت باسرع وقت
باااااااااااااااااااااااااااااااااااااااااااااااي
مشاركة: بليييييييييز أرجو تساعدوني ضروري الله يسعدكم
مو معقوله الزوار للدرس كثير
وانتو ولا واحد يريد يساعدني
وربي حرام عليكم
بلييييييييييييييييييز
ردو على موضوعي
وحاولو معاي
الله لا يحرمني منكم
اختكم
ظل القمر حنين
مشاركة: بليييييييييز أرجو تساعدوني ضروري الله يسعدكم
الله يعينك .. أنا تواني مبتدأ في c++ والـ vb6 , vb.net
مشاركة: بليييييييييز أرجو تساعدوني ضروري الله يسعدكم
تفظلي اختي: و سامحينا على التأخير:
كود:
#include "stdafx.h"
#include
<iostream>
using
namespace std;
int
ListMainOptions()
{
int choice;
cout<<"Please Select One Of The Following:" << endl;
cout<<"1- Food Menu. " << endl;
cout<<"2- Calculate Daily Profits."<<endl;
cout<<"3- Quit."<<endl;
cin>>choice;
return choice;
}
bool
OtherChoice ()
{
char c;
cout << "\nDo You Want To Add Another Order?\n";
cin >> c;
if ( c == 'Y' || c == 'y' )
returntrue;
elseif ( c == 'N' || c == 'n' )
returnfalse;
returnfalse;
}
void
FoodMenu()
{
int sum = 0;
int choice;
while ( true )
{
cout << "1- Beef Burger . 10 SR\n2-French fires. 4 SR\n3-Pepsi. 2 SR\n4-Pizza. 15 SR\n";
cin >> choice;
if ( choice == 1 )
{
sum += 10;
if ( OtherChoice() )
continue;
else
{
cout << "\nTotal price: "<<sum;
break;
}
}
elseif ( choice == 2 )
{
sum += 4;
if ( OtherChoice() )
continue;
else
{
cout << "\nTotal price: "<<sum;
break;
}
}
elseif ( choice == 3 )
{
sum += 2;
if ( OtherChoice() )
continue;
else
{
cout << "\nTotal price: "<<sum;
break;
}
}
elseif ( choice == 4 )
{
sum += 15;
if ( OtherChoice() )
continue;
else
{
cout << "\nTotal price: "<<sum;
break;
}
}
else
cout<<"Invalid Selection, Please Select 1, 2, 3 or 4\n";
}
}
void
CalculateProfits()
{
int outcome, income;
cout<<"\nPlease enter the day outcome: ";
cin >> outcome;
cout << "Please enter the day income";
cin >> income;
cout << "The Day Profit is : " << income - outcome ;
}
int
main()
{
while ( true )
{
int userChoice;
userChoice = ListMainOptions();
if ( userChoice == 1 )
FoodMenu();
elseif ( userChoice == 2 )
CalculateProfits();
elseif ( userChoice == 3 )
break;
else
cout << "Invalid Selection, Please Select 1, 2 or 3";
continue;
}
return 0;
}
و انشا الله ما يطلع فيه error لأني استخدمت ال notepad في كتابته!!
1 مرفق
مشاركة: بليييييييييز أرجو تساعدوني ضروري الله يسعدكم
مشاركة: بليييييييييز أرجو تساعدوني ضروري الله يسعدكم
شبيه بهذا السؤال جانا في الاختبار النهائي
أخوي القبقوب فيه error عند"include"stdafx.h#
مشاركة: بليييييييييز أرجو تساعدوني ضروري الله يسعدكم
الحمد لله أن هناك من استفاد من الموضوع لأنه يبدو أن الأخت السائلة لم تزر المقال ثانية ...
أخوي العسيري لا يوجد إررور:no: ، المشكلة ببساطة أنك تعمل include لfile غير موجود في الproject مالك،،،:pat:
فأمامك أحد حلين:
1- إما أن تزيل ال#include "stdafx.h"
2-أو أنك تعمل New Project و تختار : Create Simple Project على ما أذكر و الله أعلم:eek2:
و سامحني لأني أصلا من زماااااااان شلت الفيجول ستديو 6...
و الحين كل الشغل على ال.NET :biggthump
و مشكورين على المتابعة...
السلام عليكم
مشاركة: بليييييييييز أرجو تساعدوني ضروري الله يسعدكم
اخوي عبدالله
اذا مسحت الــ#include "stdafx.h" بيمشي البرنامج معاك عادي
مشاركة: بليييييييييز أرجو تساعدوني ضروري الله يسعدكم
يعطيك العافيه اخوي القبقوب بجرب وبشوف وهالاشياء تونا ماخذناها المستوى الجاي ناخذها:33:
مشكلة المبتدئين أمثالي:D
مشاركة: بليييييييييز أرجو تساعدوني ضروري الله يسعدكم
حياكم الله يا إخوان....
و ترى أي سؤال C++ أو ASP.NET جاهزييييين
و فالكم طيييب...
و السموحة:ciao: