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

دورة جافا : الدرس الثاني (كتابة برنامجك الأول)

بدأه loayyn في 14 سبتمبر 2004 · 34 رد · 14,426 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#26

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

والفرق بين overridden,هل ديه هيه ديهoverriding overloading

ويعني ايه clause

وبعدين انا فهمت انا احنا بنحط اكسبشن لو متوقعين اييرور وبنعمل تراي علشان يرن لما الايرور يحصل بس مش فاهمة ايه ال

catch

انامش فاهمة ايه الفرق بين الكلاس والابجكت

#27

الصور لا تظهر

فأرجو ان تجدوا حل لها :)

#28

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

#29

مراحبا

بس أنا عندي مكلة كل ما شغل برنامج بطلعلي خطأ بالكلاس أرجو المساعدة

#30

لو سمحت ساعدني في حل هذا السؤال

Object Oriented Programming

(JAVA)

Liz’s Taxi Service has proved so successful, boosted by her loyalty scheme for regular customers, that she has expanded her fleet to include vans and minibuses for hire, all driven by members of her highly-trained staff. Eager to maximise profits, she now wants to evaluate the efficiency of her drivers by logging each journey they make and analysing how swiftly they complete the job relative to the distance covered.

Each driver has a unique Driver Number. A journey takes place in a car, or van, or minibus (coded ‘C’, ‘V’ and ‘M’ respectively). The time taken (in whole minutes) and distance travelled (in whole miles) are both recorded.

To determine how speedily her drivers are working, Liz calculates the efficiency of each journey as the distance travelled divided by the time taken.*

Create a Java program to record each journey made by each driver in a file called journey.dat, and to perform various analysis tasks to assist Liz in monitoring driver efficiency. A typical line in the file might be

13 M 60 45

where driver 13 used a Minibus for 60 minutes and drove 45 miles. The efficiency value (calculated as necessary in the program, not stored in the file) would be 45 / 60 = 0.75

The system must be menu-driven and offer the following operations:

1.

Append a new line of journey data to the file;

2.

Provide a vehicle report for either

*

one specific category of vehicle (C / V / M) or for

*

each category of vehicle in turn (A for All)

showing for journeys in this vehicle either a

*

Summary (S) – number of journeys and average efficiency or a

*

Full report (F) – list of journeys (giving driver number and efficiency) plus summary information

3.

Provide a listing of the ten most efficient journeys (displaying driver number and efficiency value for each) in descending order. (Where fewer than ten journeys have been recorded all should be listed.)

Exit the system.

/index.ph...=46960#_ftnref1

#31

اسف على ازعاجكم وكنت متوقع منكم انكم تساعدوني ..... عالعموم شكرا

#32

شكرا لكم على مساعدتي وإن شاء الله بحاول احله وأحطه بالمنتدى لكي يستفيد الاخرووون وشكرا لكم على رفع معنوياتي وشكرا علي توضيح السؤال

#33

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

#34

السلام عليكم

شكراً لك اخي الكريم على الشرح لكن هناك استفسار ، لقد رأيت في احد الكتب عند كتابة string قد كتبها على النحو التالي

(string agrs[])

هل اسم المصفوفة agrs ? و إذا لم أكتبها ماذا سيحدث ؟

#35

بداية عليك الانتباه إلى أن جافا حساسة لحالة الأحرف.

أي عليك أن تكتب String

نعم args هو اسم المصفوفة هنا وبالطبعة يمكنك تغييرة إلى أي اسم ترغب به ...

يتم تمرير مصفوفة من String للتابع main وهي بمثابة وسائط arguments للبرنامج

	public static void main(String[] args) {}

يجب عليك كتابتها دائماً ... لن يتم ترجمة البرنامج إن لم تكتبها

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

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

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

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

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