الموضوع: lab sheet 5
عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
  #1  
قديم 08-12-2011, 05:28 PM
الصورة الرمزية ميم 28

ميم 28 ميم 28 غير متواجد حالياً

Amerah

 
تاريخ التسجيل: Sep 2010
نوع الدراسة: إنتظام
المستوى: الثالث
الجنس: أنثى
المشاركات: 192
افتراضي lab sheet 5



لو سمحتوا فيه سؤالين في اللاب شيت 5 وقفت عندهااا اللي هو سوال 3 طبعا تابع للـ 2
وسوال 5 تابع لـ 4 مافهمت اش يبغى ؟

2 Write a Java application that inputs an integer and uses an if…else statement to determine whether the integer is odd or even. If it is odd, print the number followed by "is odd"; if it is even, print the number followed by "is even".
3. Rewrite your solution to Coding Exercise 2 so that it uses the conditional operator (?:), rather than an if…else statement.


4 Write a Java application that uses a counter-controlled loop to sum the integers in the range 1–10, then compute the average of those numbers (as an integer value). Display the sum and the average.
5 Modify your solution to Coding Exercise 4 so that a user can specify the range of numbers to average.


وبالنسبة للسؤالين الاخيرة اللي هي
Programming Challenges نحلهاا ولا لا
رد مع اقتباس