What does the following program output?
Class Q4
{
Public static void main(String[] args)
{
int totalCost=6;
int items=12;
System.out.println("Cost per item: " + totalCost/items);
}
}
Cost per item: .5 Cost per item: 0 Cost per item: 1 Cost per item: +6/12 ما فهمت بهذا السؤال ليش با الاحمر ؟؟؟؟؟؟؟؟؟؟ مافهمت الله يستر
What does the following program output?
Class Q4
{
Public static void main(String[] args)
{
int totalCost=6;
int items=12;
System.out.println("Cost per item: " + totalCost/items);
}
}
Cost per item: .5 Cost per item: 0 Cost per item: 1 Cost per item: +6/12 ما فهمت بهذا السؤال ليش با الاحمر ؟؟؟؟؟؟؟؟؟؟ مافهمت الله يستر
عادي قسمة عادية لأنو هو بالكود حكالك أنو total cost=6
وitem=12
وتحتون مكتوب أطبع
totalcost/items يعني 12/6
بعض الاسئلة المهم ,,, بس شدو حيلكم نفكر فيها مع بعض ,,,
الجزء الاول في المرفقات
طبعاً حسب سرعة الاجابة راح انزل الي بعده ,,,,
تلميح اجوبة هذا الملف من شابتر 1
MY ANSWERS ARE:
- SYMBOLS
PROCESSING
9
10
ENIAC
ASSEMBLY LANGUAGE
HIGH LEVEL LANGUAGE
EDIT,COMPILE,RUN
THE DIAGRAM IS NOT CLEAR
THE DIAGRAM IS NOT CLEAR
getMaximumSpeed()
DESCENDENTS
SOFTWARE ENGINEERING
FALSE
TURE
TRUE
TRUE
TRUE
TRUE
FALSE
TRUE
TRUE
TRUE
TRUE
FALSE
السؤال الثاني public void sum (int number1, int number2) { int total = number1 + number2; System.out.println(“the total = “ + total); } The correct way to call this function is: sum (5, 10); sum (4); int total \= sum (4, 8, 9); int total \= sum (4, 8); و public int sum (int number1, int number2) { return number1 + number2; } 8 The correct way to call this function is: sum (4, 8); sum (4); int total \= sum (4, 8, 9); int total \= sum (4, 8);
شو الفرق بينهم لما بكون void ولما بكون int
الفرق كبير جدا
اول ميثود راح تطبع المجموع وماراح ترجع قيمة ,,, فيكون الـcall لها بمجرد كتابة اسم الميثود والـarrguments
الميثود الثانية ترجع قيمة عدد صحيح وماتطبع شيء ,,, الـ call لازم يكون بنقل القيمة الي بترجعها المثيود لمتغير بغرض استخدامها
وطبعا الشق الثاني من السؤال هو عدد البارميترز ,,, لازم تكون عددين صحيحين كما في التعريف
int select = 1; switch (select) { case 0: System.out.print(0); case 1: System.out.print(1); case 2: System.out.print(2); break; } The output of this switch statement is: 0 1 2 12
int select = 1; switch (select) { case 0: System.out.print(0); break; case 1: System.out.print(1); 10 break; case 2: System.out.print(2); break; } The output of this switch statement is: 0 1 2 12
أجابتي هون صحيحة ولا لاء
I have a lot of Qz Q88 – A java identifier consists of a sequence of letters and digits only True False wat else ?? Q83 – It is possible to write if tests in different ways to achieve the same result True False y ? if and while and for statments do the the same result don't they
المفضلات