الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ممكن مساعده في حل سؤال في c++

بدأه فوضوية في 18 يوليو 2011 · 5 رد · 1,250 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمه الله وبركاته

ابي حل لهالسؤآل آو شرح له لاهنتوآ

To parking your care in the Garage, the employee needs to check the availability of garage before parking your car, and he should know how many hours you will leave you car in the garage. The Garage gives an offer depends on the hours you will leave your car in the garage. ( if Hours of stay less than 4 hours the Fee is 10.00 SR per 1 hour, Hours of stay more than 4 hours and less than 6 hours Fee is 6.00 SR per 1 hour, if more than 4 hours Fee is 2.00 SR per 1 hour. The garage has fixed number of parking (which given based on the arranging of park in the list park).Use constructor to initialize the data member.

Make a menu driven main program to test all functions as followings:

1-Parking

- Develop a function parking the car, check available park, if all of them are full; alert message should be printed. If there is a one make sure to make it not available any more until the car is exit.

2- Exit

- Develop a function that exit(you need parking first) , ask the user to input the parking number, and validate it, is available. And give him the fee.

3- Print garage information

- Develop a function print which is global function that prints available and unavailable park information in the garage. (Use a copy constructor).

4- Get Number of parks in the Garage

Use this pointer in get all data members (You may not need set functions)

#2

معقوله مافي احد فاهم السوال :(

#3

ممكن تترجمي النص عشان في بعض المبرمجين امثالي ما يحبون الاسئلة بالغة الانجليزية :happy:

فهمت تقريبا ً 90% من السؤال ,

عموما ً السؤال حله اعتقد طويل شوية

اولا ً العمل راح يكون OOP

يبغاكي تسوي كلاس , للقراج

هذا الكلاس اولا يبغاكي تستخدمي فيه الـ constructor لتعريف المتغيرات الاساسية

يعني اول ما تسوي new object يعرف المستخدم المتغيرات تبع الكلاس

ايضا ً يبغاكي تستخدمي المؤشر Pointer

من خصائص هذا الكلام

اولا ً يحتوي على ركن

كل ركن له رقم وله سعر يحتسب بالساعة

الية العمل :

اول ما يجي الشخص بسيارته يشوف هل في مساحة متوفرة ام لا ثم يركن السيارة با لترتيب حسب المكان الفاضي اذا مافي مكان فاضي يظهر رسالة للمستخدم

سعر ركن السيارة في القراج يحتسب بالساعة وفيه تخفيظ للي يجلس اكثر وقت في القراج :cool:

ايضا ً يبغاكي تسوي دالة تجلب معلومات عن القراج مثل كم عدد الاركان وكم الفاضي والمحجوز هذا الشي يبغاكي تسويه في constructor

هذا الي قدرت افهمه من الكلاس لكن كيف نحل هذا السؤال اعتقد يبغاله جلسه ومخمخه شوية

انتي جربي وحاولي واذا اي مشكلة ممكن نساعدك فيها

تم تعديل هذه المشاركة بواسطة M.B.O في 19 يوليو 2011 في 01:40

M.B.O

Mohamed Bin Othman

إبن المكلا

يابني البشر ماذا فعلتم بالبشر !!

إسـألـنـي

#4

Int a[500]=0;

Int d=0,g=0;

Class parking

{

Double hours;

Double per;

Public:

Parking(double h,double p)

{

Hours=h;

Per=p;

}

Int park()

{

For(int i=0;i<500;i++)

If(a>0)

D++;

Else

G++;

If(d>g)

Return 1;

Else

Return 0;

}

Void exit()

{

Int n;

Cout<<"enter the number of parking : ";

Cin>>n;

For (Int j=0;j<500;j++)

If(a[n]>0)

cout<<"availabl"<<d;

Else

Cout<<" not available"<<g;

}

int main()

{

Int m,h,p;

Parking obj(0,0);

M=obj.park();

If(m==1)

{

Obj.exit();

Cout<<"enter hours :";

Cin>>h;

If(h<4)

P=10.00*h;

Else

If (h>4&&hours<6)

P=6.00*h;

Else

If(h>4)

P=2.00*h;

}

Opj.print();

Couy<<opj.gethours<<endl;

Cout<<opj.getpre<<endl;

هذي محاولتي لكن من غير الدالنين الاخيرة

#5
فوضوية كتب:

السلام عليكم ورحمه الله وبركاته

ابي حل لهالسؤآل آو شرح له لاهنتوآ

To parking your care in the Garage, the employee needs to check the availability of garage before parking your car, and he should know how many hours you will leave you car in the garage. The Garage gives an offer depends on the hours you will leave your car in the garage. ( if Hours of stay less than 4 hours the Fee is 10.00 SR per 1 hour, Hours of stay more than 4 hours and less than 6 hours Fee is 6.00 SR per 1 hour, if more than 4 hours Fee is 2.00 SR per 1 hour. The garage has fixed number of parking (which given based on the arranging of park in the list park).Use constructor to initialize the data member.

Make a menu driven main program to test all functions as followings:

1-Parking

- Develop a function parking the car, check available park, if all of them are full; alert message should be printed. If there is a one make sure to make it not available any more until the car is exit.

2- Exit

- Develop a function that exit(you need parking first) , ask the user to input the parking number, and validate it, is available. And give him the fee.

3- Print garage information

- Develop a function print which is global function that prints available and unavailable park information in the garage. (Use a copy constructor).

4- Get Number of parks in the Garage

Use this pointer in get all data members (You may not need set functions)

و علیکم السلام و رحمة الله و بركاته,

اختي الكريمة السؤال مليء من الاخطاء اللغویة و النحوية,

من اين حصلت على هذا السؤال؟ شبيه بترجمة جوجل بعض الشيء

وفقكم الله.

تم تعديل هذه المشاركة بواسطة IO JOC في 19 يوليو 2011 في 19:21

..:: رَبِّ زِدْني عِلْمًا ::..

#6

للآسف اخي استاذتنا هي اللي عطتنا :)

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…