Deck 6: More Conditionals and Loops

ملء الشاشة (f)
exit full mode
سؤال
Each case in a switch statement must terminate with a break statement.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The do loop differs from the while loop in that

A) the while loop will always execute the body of the loop at least once
B) the do loop will always execute the body of the loop at least once
C) the do loop will continue to loop while condition in the while statement is false and the while loop will continue to loop while the condition in the while statement is True
D) the while loop will continue to loop while condition in the while statement is false and the do loop will continue to loop while the condition in the while statement is True
E) none of the above, there is absolutely no difference between the two types of loops
سؤال
Consider the following paint method to answer the questions below:
public void paint(Graphics page)
{
int x, y = 200;
page.setColor(Color.blue);
for (x = 100; x < 200; x += 20)
page.fillRect(x, y, 10, y-x);
}
Which of the following statements are True about Java loops?

A) all three loop statements are functionally equivalent
B) while loops and do loops are essentially the same; but while loops always execute at least once
C) if you know the number of times that a loop is to be performed, the best loop statement to use is a while loop
D) loops may be replaced by an appropriate combination of if-else and switch statements
E) none of the above
سؤال
Consider the following paint method to answer the questions below:
public void paint(Graphics page)
{
int x, y = 200;
page.setColor(Color.blue);
for (x = 100; x < 200; x += 20)
page.fillRect(x, y, 10, y-x);
}
The size of each rectangle (bar)

A) increases in height while staying the same width
B) increases in width while staying the same height
C) increases in both width and height
D) stays the same size
E) decreases in height while staying the same width
سؤال
Given the following switch statement where x is an int, answer the questions below
switch (x)
{
case 3 : x += 1;
case 4 : x += 2;
case 5 : x += 3;
case 6 : x++;
case 7 : x += 2;
case 8 : x--;
case 9 : x++
}
If x is currently equal to 3, what will the value of x be after the switch statement executes?

A) 5
B) 6
C) 11
D) 10
E) 12
سؤال
Given the following switch statement where x is an int, answer the questions below
switch (x)
{
case 3 : x += 1;
case 4 : x += 2;
case 5 : x += 3;
case 6 : x++;
case 7 : x += 2;
case 8 : x--;
case 9 : x++
}
If x is currently equal to 5, what will the value of x be after the switch statement executes?

A) 8
B) 6
C) 11
D) 5
E) 10
سؤال
Given that s is a String, what does the following loop do?
For (int j = s.length( ); j > 0; j--)
System.out.print(s.charAt(j-1));

A) it prints s out backwards
B) it prints s out forwards
C) it prints s out backwards after skipping the last character
D) it prints s out backwards but does not print the 0ᵗʰ character
E) it yields a run-time error because there is no character at s.charAt(j-1) for j = 0
سؤال
It is possible to convert any type of loop (while, do, or for) into any other.
سؤال
Consider the following paint method to answer the questions below:
public void paint(Graphics page)
{
int x, y = 200;
page.setColor(Color.blue);
for (x = 100; x < 200; x += 20)
page.fillRect(x, y, 10, y-x);
}
This paint method will draw several bars (sort of like a bar graph). How many bars will be displayed?

A) 4
B) 5
C) 6
D) 10
E) 20
سؤال
Given the following switch statement where x is an int, answer the questions below
switch (x)
{
case 3 : x += 1;
case 4 : x += 2;
case 5 : x += 3;
case 6 : x++;
case 7 : x += 2;
case 8 : x--;
case 9 : x++
}
The statement if (x < 0) y = x; else y = 0; can be rewritten using a conditional operator as

A) y = (x < 0) ? x : 0;
B) x = (x < 0) ? y : 0;
C) (x < 0) ? y = x : y = 0;
D) y = (x < 0);
E) y = if (x < 0) x : 0;
سؤال
Control in a switch statement jumps to the first matching case.
سؤال
Given the following switch statement where x is an int, answer the questions below
switch (x)
{
case 3 : x += 1;
case 4 : x += 2;
case 5 : x += 3;
case 6 : x++;
case 7 : x += 2;
case 8 : x--;
case 9 : x++
}
Given the following code, where x = 0, what is the resulting value of x after the for-loop terminates?
For (int i=0;i<5;i++)
X += i;

A) 0
B) 4
C) 5
D) 10
E) 15
سؤال
A switch statement must have a default clause.
سؤال
You might choose to use a switch statement instead of nested if-else statements if

A) the variable being tested might equal one of several hundred int values
B) the variable being tested might equal one of only a few int values
C) there are two or more int variables being tested, each of which could be one of several hundred values
D) there are two or more int variables being tested, each of which could be one of only a few values
E) none of the above, you would never choose to use a switch statement in place of nested if-else statements under any circumstance
سؤال
The following nested loop structure will execute the inner most statement (x++) how many times?
For (int j = 0; j < 100; j++)
For (int k = 100; k > 0; k--)
X++;

A) 100
B) 200
C) 10,000
D) 20,000
E) 1,000,000
سؤال
How many times will the following loop iterate?
Int x = 10;
Do {
System.out.println(x);
X--;
} while (x > 0);

A) 0 times
B) 1 time
C) 9 times
D) 10 times
E) 11 times
سؤال
A continue statement

A) may be used within a while or a do-while loop, but not a for loop
B) is identical to a break statement within Java loops
C) may be used within any Java loop statement
D) may be used within a for loop, but not within a while or a do-while loop
E) none of the above
سؤال
If a switch statement is written that contains no break statements whatsoever,

A) this is a syntax error and an appropriate error message will be generated
B) each of the case clauses will be executed every time the switch statement is encountered
C) this is equivalent to having the switch statement always take the default clause, if one is present
D) this is not an error, but nothing within the switch statement ever will be executed
E) none of the above
سؤال
Consider the following paint method to answer the questions below:
public void paint(Graphics page)
{
int x, y = 200;
page.setColor(Color.blue);
for (x = 100; x < 200; x += 20)
page.fillRect(x, y, 10, y-x);
}
What will the following code do? Assume s is a String, x is an int initialized to 10, page is a Graphics object, and this is part of a paint method for an applet.
Boolean isVowel = false;
String vowels = "aeiou";
For (int j = 0; j < s.length( ); j++)
{
For (int k = 0; k < 5; k++)
If (s.charAt(j) == vowels.charAt(k)) isVowel = True;
If (isVowel) page.drawString(""+s.charAt(j), 10, 15*x++);
Else page.drawString(""+s.charAt(j), 110, 15*x++);
IsVowel = false;
}

A) The String s is printed down the applet in two columns, alternating each letter
B) The String s is printed across the applet with vowels printed in one row and all other characters printed in a row above the vowels
C) The String s is printed across the applet with vowels printed in one row and all other characters printed in a row below the vowels
D) The String s is printed down the applet in two columns with vowels appearing in the left column and all other characters in the right column
E) The String s is printed down the applet in two columns with vowels appearing in the right column and all other characters in the left column
سؤال
The following for-loop is an infinite loop.
for (int j = 0; j < 1000; ) i++;
سؤال
Write a "query-controlled" loop that will continue to input int values from the user, adding each to the int value sum, and then ask if the user has another value to input, until the user says that there are no more values. Assume that cs1.Keyboard has been imported.
سؤال
Write a set of code that outputs all of the int values between 1 and 100 with 5 values per line, and each of those 5 values spaced out equally. Use a single for-loop to solve this problem.
سؤال
Rewrite the following nested if-else statement as an equivalent switch statement.
if (letter == 'A' | | letter == 'a') System.out.println("Excellent");
else if (letter == 'B' | | letter == 'b') System.out.println("You can do better");
else if (letter == 'C' | | letter == 'c') System.out.println("Try harder");
else if (letter == 'D' | | letter == 'd') System.out.println("Try much harder");
else System.out.println("Try another major! ");
سؤال
In Java, it is possible to create an infinite loop out of while and do loops, but not for-loops.
سؤال
The following for-loop is odd in that the loop increment value changes during iterations of the loop. Determine the number of times the loop iterates and the final value of j after the loop terminates.
int k = 0;
for (j = 0; j < 20; j += k)
k++;
سؤال
A data verification loop is a loop that asks the user to input a value within a restricted range repeatedly until the user has input a value within the requested range. Write a data verification loop that that inputs an int value x within the range 0 and 100. Assume cs1.Keyboard has been imported.
سؤال
Write a paint method to draw out an American flag. The flag will comprise a blue square in the upper left corner and 13 red and white stripes, starting with red, and alternating. 6 of the 13 stripes appear to the right of the blue square and the last 7 stripes appear beneath the blue square extending as far right as the other stripes. Use a for-loop to draw the stripes. Do not try to draw any stars in the blue square.
سؤال
How many times will the System.out.println(*); statement execute inside of the following nested for-loops?
for (j=0; j<10; j++)
for (k=10;k>j;k--)
System.out.println("*");
سؤال
Write some code that inputs a set of int values and computes its average. Ask the user first how many int values will be input. Make sure that your code cannot produce a division by zero error. Assume that cs1.Keyboard has been imported.
سؤال
Describe a situation where you should use a do loop and a situation where you should use a while loop.
سؤال
The following code has a syntax error immediately before the word else. What is the error and why does it arise?
Fix the code so that this statement is a legal if-else statement.
if (x < 0) ; x++;
else x--;
سؤال
Given the following tax table information, write Java code to assign the double taxRate appropriately given the double pay. Select the selection statement (if, if-else, switch) that makes the most sense.
If pay is more than 100,000, tax rate is 40%
If pay is more than 60,000 and less than or equal to 100,000, tax rate is 30%
If pay is more than 30,000 and less than or equal to 60,000, tax rate is 20%
If pay is more than 15,000 and less than or equal to 30,000, tax rate is 10%
If pay is more than 5,000 and less than or equal to 15,000, tax rate is 5%
If pay is less than or equal to 5,000, tax rate is 0%
سؤال
A dialog box is a device which accepts voice commands.
سؤال
The following loop is syntactically valid.
for (int j = 0; j < 1000; j++) j--;
سؤال
Show the output that would occur from the following code, including proper spacing.
for (j = 0; j < 5; j++)
{
for (k = 0; k < 5; k++)
if (j!=k)
System.out.print(' ');
else
System.out.print('*');
System.out.println( );
}
سؤال
Rewrite the following if-else statement using a conditional operator.
if (x > y) z = x; else z = y;
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/36
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 6: More Conditionals and Loops
1
Each case in a switch statement must terminate with a break statement.
False
Explanation: They often do, but if the break statement is not present, the flow of control continues into the next case.
2
The do loop differs from the while loop in that

A) the while loop will always execute the body of the loop at least once
B) the do loop will always execute the body of the loop at least once
C) the do loop will continue to loop while condition in the while statement is false and the while loop will continue to loop while the condition in the while statement is True
D) the while loop will continue to loop while condition in the while statement is false and the do loop will continue to loop while the condition in the while statement is True
E) none of the above, there is absolutely no difference between the two types of loops
B
Explanation: B) Because the do loop does not test the condition until after the body of the loop executes, the body will always execute at least one time, but the while loop tests the condition first, and so if the condition is false the first time, the body does not execute even one time.
3
Consider the following paint method to answer the questions below:
public void paint(Graphics page)
{
int x, y = 200;
page.setColor(Color.blue);
for (x = 100; x < 200; x += 20)
page.fillRect(x, y, 10, y-x);
}
Which of the following statements are True about Java loops?

A) all three loop statements are functionally equivalent
B) while loops and do loops are essentially the same; but while loops always execute at least once
C) if you know the number of times that a loop is to be performed, the best loop statement to use is a while loop
D) loops may be replaced by an appropriate combination of if-else and switch statements
E) none of the above
A
Explanation: A) In Java, as in most languages, the looping statements are all essentially equivalent (and almost interchangeable). Their principal difference(s) relate to when the controlling condition is evaluated and whether there is syntax for incrementation/update.
4
Consider the following paint method to answer the questions below:
public void paint(Graphics page)
{
int x, y = 200;
page.setColor(Color.blue);
for (x = 100; x < 200; x += 20)
page.fillRect(x, y, 10, y-x);
}
The size of each rectangle (bar)

A) increases in height while staying the same width
B) increases in width while staying the same height
C) increases in both width and height
D) stays the same size
E) decreases in height while staying the same width
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
5
Given the following switch statement where x is an int, answer the questions below
switch (x)
{
case 3 : x += 1;
case 4 : x += 2;
case 5 : x += 3;
case 6 : x++;
case 7 : x += 2;
case 8 : x--;
case 9 : x++
}
If x is currently equal to 3, what will the value of x be after the switch statement executes?

A) 5
B) 6
C) 11
D) 10
E) 12
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
6
Given the following switch statement where x is an int, answer the questions below
switch (x)
{
case 3 : x += 1;
case 4 : x += 2;
case 5 : x += 3;
case 6 : x++;
case 7 : x += 2;
case 8 : x--;
case 9 : x++
}
If x is currently equal to 5, what will the value of x be after the switch statement executes?

A) 8
B) 6
C) 11
D) 5
E) 10
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
7
Given that s is a String, what does the following loop do?
For (int j = s.length( ); j > 0; j--)
System.out.print(s.charAt(j-1));

A) it prints s out backwards
B) it prints s out forwards
C) it prints s out backwards after skipping the last character
D) it prints s out backwards but does not print the 0ᵗʰ character
E) it yields a run-time error because there is no character at s.charAt(j-1) for j = 0
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
8
It is possible to convert any type of loop (while, do, or for) into any other.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
9
Consider the following paint method to answer the questions below:
public void paint(Graphics page)
{
int x, y = 200;
page.setColor(Color.blue);
for (x = 100; x < 200; x += 20)
page.fillRect(x, y, 10, y-x);
}
This paint method will draw several bars (sort of like a bar graph). How many bars will be displayed?

A) 4
B) 5
C) 6
D) 10
E) 20
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
10
Given the following switch statement where x is an int, answer the questions below
switch (x)
{
case 3 : x += 1;
case 4 : x += 2;
case 5 : x += 3;
case 6 : x++;
case 7 : x += 2;
case 8 : x--;
case 9 : x++
}
The statement if (x < 0) y = x; else y = 0; can be rewritten using a conditional operator as

A) y = (x < 0) ? x : 0;
B) x = (x < 0) ? y : 0;
C) (x < 0) ? y = x : y = 0;
D) y = (x < 0);
E) y = if (x < 0) x : 0;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
11
Control in a switch statement jumps to the first matching case.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
12
Given the following switch statement where x is an int, answer the questions below
switch (x)
{
case 3 : x += 1;
case 4 : x += 2;
case 5 : x += 3;
case 6 : x++;
case 7 : x += 2;
case 8 : x--;
case 9 : x++
}
Given the following code, where x = 0, what is the resulting value of x after the for-loop terminates?
For (int i=0;i<5;i++)
X += i;

A) 0
B) 4
C) 5
D) 10
E) 15
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
13
A switch statement must have a default clause.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
14
You might choose to use a switch statement instead of nested if-else statements if

A) the variable being tested might equal one of several hundred int values
B) the variable being tested might equal one of only a few int values
C) there are two or more int variables being tested, each of which could be one of several hundred values
D) there are two or more int variables being tested, each of which could be one of only a few values
E) none of the above, you would never choose to use a switch statement in place of nested if-else statements under any circumstance
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
15
The following nested loop structure will execute the inner most statement (x++) how many times?
For (int j = 0; j < 100; j++)
For (int k = 100; k > 0; k--)
X++;

A) 100
B) 200
C) 10,000
D) 20,000
E) 1,000,000
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
16
How many times will the following loop iterate?
Int x = 10;
Do {
System.out.println(x);
X--;
} while (x > 0);

A) 0 times
B) 1 time
C) 9 times
D) 10 times
E) 11 times
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
17
A continue statement

A) may be used within a while or a do-while loop, but not a for loop
B) is identical to a break statement within Java loops
C) may be used within any Java loop statement
D) may be used within a for loop, but not within a while or a do-while loop
E) none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
18
If a switch statement is written that contains no break statements whatsoever,

A) this is a syntax error and an appropriate error message will be generated
B) each of the case clauses will be executed every time the switch statement is encountered
C) this is equivalent to having the switch statement always take the default clause, if one is present
D) this is not an error, but nothing within the switch statement ever will be executed
E) none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
19
Consider the following paint method to answer the questions below:
public void paint(Graphics page)
{
int x, y = 200;
page.setColor(Color.blue);
for (x = 100; x < 200; x += 20)
page.fillRect(x, y, 10, y-x);
}
What will the following code do? Assume s is a String, x is an int initialized to 10, page is a Graphics object, and this is part of a paint method for an applet.
Boolean isVowel = false;
String vowels = "aeiou";
For (int j = 0; j < s.length( ); j++)
{
For (int k = 0; k < 5; k++)
If (s.charAt(j) == vowels.charAt(k)) isVowel = True;
If (isVowel) page.drawString(""+s.charAt(j), 10, 15*x++);
Else page.drawString(""+s.charAt(j), 110, 15*x++);
IsVowel = false;
}

A) The String s is printed down the applet in two columns, alternating each letter
B) The String s is printed across the applet with vowels printed in one row and all other characters printed in a row above the vowels
C) The String s is printed across the applet with vowels printed in one row and all other characters printed in a row below the vowels
D) The String s is printed down the applet in two columns with vowels appearing in the left column and all other characters in the right column
E) The String s is printed down the applet in two columns with vowels appearing in the right column and all other characters in the left column
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
20
The following for-loop is an infinite loop.
for (int j = 0; j < 1000; ) i++;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
21
Write a "query-controlled" loop that will continue to input int values from the user, adding each to the int value sum, and then ask if the user has another value to input, until the user says that there are no more values. Assume that cs1.Keyboard has been imported.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
22
Write a set of code that outputs all of the int values between 1 and 100 with 5 values per line, and each of those 5 values spaced out equally. Use a single for-loop to solve this problem.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
23
Rewrite the following nested if-else statement as an equivalent switch statement.
if (letter == 'A' | | letter == 'a') System.out.println("Excellent");
else if (letter == 'B' | | letter == 'b') System.out.println("You can do better");
else if (letter == 'C' | | letter == 'c') System.out.println("Try harder");
else if (letter == 'D' | | letter == 'd') System.out.println("Try much harder");
else System.out.println("Try another major! ");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
24
In Java, it is possible to create an infinite loop out of while and do loops, but not for-loops.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
25
The following for-loop is odd in that the loop increment value changes during iterations of the loop. Determine the number of times the loop iterates and the final value of j after the loop terminates.
int k = 0;
for (j = 0; j < 20; j += k)
k++;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
26
A data verification loop is a loop that asks the user to input a value within a restricted range repeatedly until the user has input a value within the requested range. Write a data verification loop that that inputs an int value x within the range 0 and 100. Assume cs1.Keyboard has been imported.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
27
Write a paint method to draw out an American flag. The flag will comprise a blue square in the upper left corner and 13 red and white stripes, starting with red, and alternating. 6 of the 13 stripes appear to the right of the blue square and the last 7 stripes appear beneath the blue square extending as far right as the other stripes. Use a for-loop to draw the stripes. Do not try to draw any stars in the blue square.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
28
How many times will the System.out.println(*); statement execute inside of the following nested for-loops?
for (j=0; j<10; j++)
for (k=10;k>j;k--)
System.out.println("*");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
29
Write some code that inputs a set of int values and computes its average. Ask the user first how many int values will be input. Make sure that your code cannot produce a division by zero error. Assume that cs1.Keyboard has been imported.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
30
Describe a situation where you should use a do loop and a situation where you should use a while loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
31
The following code has a syntax error immediately before the word else. What is the error and why does it arise?
Fix the code so that this statement is a legal if-else statement.
if (x < 0) ; x++;
else x--;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
32
Given the following tax table information, write Java code to assign the double taxRate appropriately given the double pay. Select the selection statement (if, if-else, switch) that makes the most sense.
If pay is more than 100,000, tax rate is 40%
If pay is more than 60,000 and less than or equal to 100,000, tax rate is 30%
If pay is more than 30,000 and less than or equal to 60,000, tax rate is 20%
If pay is more than 15,000 and less than or equal to 30,000, tax rate is 10%
If pay is more than 5,000 and less than or equal to 15,000, tax rate is 5%
If pay is less than or equal to 5,000, tax rate is 0%
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
33
A dialog box is a device which accepts voice commands.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
34
The following loop is syntactically valid.
for (int j = 0; j < 1000; j++) j--;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
35
Show the output that would occur from the following code, including proper spacing.
for (j = 0; j < 5; j++)
{
for (k = 0; k < 5; k++)
if (j!=k)
System.out.print(' ');
else
System.out.print('*');
System.out.println( );
}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
36
Rewrite the following if-else statement using a conditional operator.
if (x > y) z = x; else z = y;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.