لو سمحتوا فيه سؤالين في اللاب شيت 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 نحلهاا ولا لا