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

[تنبيه - عنوان غير مناسب : ]مساعده عاجل من فضلكم

بدأه sogotra في 20 مايو 2009 · 2 رد · 594 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

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

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

هذه الاسئيله:

السؤال الاول:

1. Write statements that perform the following one-dimensional-array operations:

a. Set the 10 elements of integer array counts to zero.

b. Add one to each of the 15 elements of integer array bonus.

c. Display the five values of integer array bestScores in column format.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>

السؤال الثاني

2. Use a one-dimensional array to solve the following problem: Write an application that inputs five numbers, each of which is between 10 and 100, inclusive. As each number is read, display it only if it is not a duplicate of a number already read. Provide for the "worst case," in which all five numbers are different. Use the smallest possible array to solve this problem. Display the complete set of unique values input after the user inputs each new value.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>

السؤال الثالث

3. A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You are to write an application to assign seats on each flight of the airline's only plane (capacity: 10 seats). Your application should display the following alternatives: Please type 1 for First Class and Please type 2 for Economy. If the user types 1, your application should assign a seat in the first-class section (seats 15). If the user types 2, your application should assign a seat in the economy section (seats 610). Your application should then display a boarding pass indicating the person's seat number and whether it is in the first-class or economy section of the plane.

Use a one-dimensional array of primitive type boolean to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. As each seat is assigned, set the corresponding elements of the array to true to indicate that the seat is no longer available.

Your application should never assign a seat that has already been assigned. When the economy section is full, your application should ask the person if it is acceptable to be placed in the first-class section (and vice versa). If yes, make the appropriate seat assignment. If no, display the message "Next flight leaves in 3 hours."

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>

السؤال الرابع

1. Write the code to do the following

(a) create an instance of a vector

(B) insert a new element into a vector

© remove an element from a vector

(d) find the size of a vector

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>...

السؤال الخامس

1. Use a Vector to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9% of $5000, or a total of $650. Write an application (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is truncated to an integer amount):

$200-$299

$300-$399

$400-$499

$500-$599

$600-$699

$700-$799

$800-$899

$900-$999

$1000 and over

Summarize the results in tabular format.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >

السؤال السادس

1. Does the following program , TestHashSet.java, compile and run if line 7 (Set set = new HashSet()) is replaced by one of the following statements?

a) Collection set = new LinkedHashSet();

B) Collection set = new TreeSet();

c) Collection set = new ArrayList();

d) Collection set = new LinkedList();

e) Collection set = new Vector();

f) Collection set = new Stack();

import java.util.*;

public class TestHashSet {

public static void main(String[] args) {

// Create a hash set

Set<String> set = new HashSet<String>();

// Add strings to the set

set.add("London");

set.add("Paris");

set.add("New York");

set.add("San Francisco");

set.add("Beijing");

set.add("New York");

System.out.println(set);

// Obtain an iterator for the hash set

Iterator iterator = set.iterator();

// Display the elements in the hash set

while (iterator.hasNext()) {

System.out.print(iterator.next() + " ");

}

}

}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>

السؤال السابع

2. Suppose that set1 is a set that contains the strings "red", "yellow", "green", and that set2 is another set that contains the strings "red", "yellow", "blue". Answer the following questions:

a) What are set1 and set2 after executing set1.addAll(set2)?

B) What are set1 and set2 after executing set1.add(set2)?

c) What are set1 and set2 after executing set1.removeAll(set2)?

d) What are set1 and set2 after executing set1.remove(set2)?

e) What are set1 and set2 after executing set1.retainAll(set2)?

f) What is set1 after executing set1.clear()?

اخواني ساعدوني في حل هذه الاسئيله ولكم مني فائق الاحترام

#2

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

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

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

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

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

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

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

/index.php?showtopic=29343

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

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

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

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

728x90.png

#3
علاء الصالحي كتب:
الأخ الكريم/الأخت الكريمة

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

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

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

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

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

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

/index.php?showtopic=29343

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

جزاك الله خير اخي العزيز على التنبيه وبارك الله فيك

كوننا في البدايه بهذا المنتدى لا نعرف الكثير من قوانينه والان الحمدالله قرائنا القوانين ونسعى لتطبيقها

تقب تحياتي مشرفنا

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

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

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

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

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