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

[تنبيه - عنوان غير مناسب : ]مساعده

بدأه goodsteps في 8 مايو 2010 · 5 رد · 529 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

[لسلام عليكم

اخواني واخواتي انا عضو جديد في المنتدى ... وايضا مبتدئ في لغة الجافا ... اتمنى من الله ان اجد الفائدة عندكم

مطلوب مني برنامج !!!! انا قمت بالمحاولة وهذا هو حلي اتمنى منكم ان تبيوني لي خطئي

وهو ببرنامج JCreator

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

الحل (main)

/**
 * @(#)HW5.java
 *
 * HW5 application
 *
 * @author 
 * @version 1.00 2010/5/7
 */
 import java.util.*;
import java.text.*;
public class HW5 {

    public static void main(String[] args) {

    Lab lab1,lab2,lab3;
    lab1=new Lab (1,"A113",30);
    lab2=new Lab (1,"B50",40);
    lab3=new Lab (1,"B491",40);




		System.out.println("1.A113");
        System.out.println("2.B50");
        System.out.println("3.B49");

		do{

		System.out.println("Enter your choice:");
			Scanner sc=new Scanner(System.in);
	int	v=sc.nextInt();

		System.out.println("Enter number of student:");
		Scanner sc=new Scanner(System.in);
		int d=sc.nextInt();

		if(lab1.isEnough(d))

		{	System.out.println("Enter time(1,2,3):"); // the time between (8-10)=1 // (10-12)=2 // (12-2)=3
		Scanner sca=new Scanner(System.in);
		int g=sca.nextInt();}

		else 

		System.out.print("Sorry .The lab is available but it is small");


    }while(v==1||v==2|v==3)



    }
}

class))

import java.util.*;
import java.text.*;
public class Lab{

	private int floorNum;
	private String name;
	private int capacity;
	private boolean slot1, slot2, slot3;
	public int d;

	public Lab(Lab l1){
     slot1 = false ;
     slot2 = false ;
     slot3 = false ;
	int a,c;
	String b;
	a=l1.floorNum;
	b=l1.name;
	c=l1.capacity;
	Lab l2=new Lab(a,b,c);


	}




	public Lab( int f, String n, int c){
     slot1 = false ;
     slot2 = false ;
     slot3 = false ;

		floorNum=f;
		name=n;
		capacity=c;

	}


	public int getFloorNum(){



		return floorNum;
	}

	public String getName(){



		return name;
	}



	public boolean isEnough(int d){


		if (d>=capacity)
			return true;
		else
			return false;
	}


	public boolean isAvailable(int g){




       if(g==floorNum&&d<=capacity)

          return true;

       else

          return false;




	}



}

المطلوب

Create class Lab

Constructor :

1 parameter (Lab object), all slots :false

3 parameters (int,String,int) all slots :false

Get methods(for floorNum & name only)

isEnough: check if the capacity is larger or equal to argument number to return true, otherwise return false

isAvailable : check if the lab is available at the receiving slot time

reservation: make value for receiving slot true, so this slot can not be available any more

Create project HW#5

create 3 Lab objects with following information:

(1,”A113”,30)-(1,”B50”,40)-(1,”B49”,40)

Display labs names (getName)as menu ,Then ask user to choose one of them, and read the number of students.

Let hem to choose the slot time(8-10,10-12,12-2) , it equivalent to 1,2,3

Make sure the selected lab can handle the number of student(isEnough), and it available at entered time(isAvailable).

If these conditions satisfied make selected slot true and print “done”

Otherwise print “sorry”

Repeat until user enter n

post-228280-12732709201707_thumb.png

post-228280-12732709644709_thumb.png

تم تعديل هذه المشاركة بواسطة {هويدي} في 9 مايو 2010 في 21:33 — السبب: إضافة الوسم Tag

#2

الأخ الكريم/الأخت الكريمة

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

مرحباً بكم في منتدى الفريق العربي للبرمجة

نود تنبيهك أن العنوان غير مناسب.

الرجاء اختيار عنوان مناسب أكثر في مواضيعك القادمة، وهذا بمثابة إشعار للأهمية.

وفي حال التكرار سيتعرض موضوعك للإغلاق والحذف!!!

قواعد المشاركة

/index.php?showtopic=29343

شاكرين لكم حُسن تعاونكم

حزمة المحرك الإصدارة 0.8

أي أحد يجد أني ظلمته فليراسلني

وبإذن الله لو كان له حق سيأخذه

728x90.png

#3

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

ياليت احد يساعدنا في حله

بكرة عندي اختبار فيه يعني لازم افهمه

ياليت تردو بسرررعة اخواني

#4

يا أخواني, حددو المطلوب بالظبط عشان نقدر نساعدكو

#5

اخ علاء الصالحي شكرا

ولا يهمك ان شاء الله مرة تانية ما بنكتب هيك :)

ealian خلص حليتو ;)

#6
اقتباس
ealian خلص حليتو

طيب فين الحل علشان اليان تستفاد...!

00020309t.gif

1958_1963.gif

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

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

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

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

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