Шукаєте відповіді та рішення тестів для IT6008 - Computer Programming 1? Перегляньте нашу велику колекцію перевірених відповідей для IT6008 - Computer Programming 1 в moodle.polytechnic.bh.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
Trace the following code, what is the output?
boolean flag = false;
int a[] = new int[10];
int i = 1;
while(!flag) {
a[i] += i;
if (i >= a.length){
flag = true;
}
System.out.println(a[i]);
i++;
}
Trace the following code, what is the output?
int a[] = new int[10];
for(int i = 0; i < a.length; i++) {
a[i] = i * i;
System.out.println(a[i]);
}
Trace the following code, what is the output?
int a[] = new int[10]; for(int i = a.length-1; i >= 0; i-=2) { a[i] += i ; System.out.println(a[i]); }
How many iterations will be performed in total when executing the following java-code:
for(int i=0;i<5;i++) for ( int j = 5; j<=10; j++) System.out.println(i + " , " + j);
What will happen when you attempt to compile and run the following code in a method?
for(int i=0;i<5;){ i++; System.out.println(i); }
Match the repetitions and numbers of their iterations:
Variables declared inside the repetition block are accessible from the rest of the program.
What will be printed on the output after the execution of Java-code below:
Choose a description from the ones listed below that best describes the following flowchart:
Choose a description from the ones listed below that best describes the following flowchart: