Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 70

UGRD-ITE6104 Computer Programming

QUIZ

Prelim Quiz 1
Started on Friday, 30 September 2022, 11:57 AM
State Finished
Completed on Friday, 30 September 2022, 12:10 PM
Time taken 12 mins 47 secs
Marks 10.00/10.00
Grade 100.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Why do we need to set the path for JavaC in command line?

Select one:

a.
To resolve syntax error

b.
To make JavaC available or accessible in command line.

c.
To resolve runtime error

d.
It is part of the compilation process

Question 2
Correct
Mark 1.00 out of 1.00
Flag question

Question text
What is the correct statement to set JavaC path in command line?

Select one:

a.
All of the given choices are correct

b.
C:\Program Files\Java\jdk1.6.0_23\bin

c.
set path

d.
< JavaC directory >

e.
path C:\Program Files\Java\jdk1.6.0_23\bin

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
The feature of Java which makes it possible to execute several tasks simultaneously.

Select one:

a.
Multithreaded

b.
Code Security

c.
Robust
d.
Platform independent

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What was the initial name for the Java programming language?

Select one:

a.
Java

b.
NetBeans

c.
Oak

d.
C

Question 5
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the correct statement to compile Java program in command line?

Select one:

a.
javac HelloWorld.java

b.
java HelloWorld

c.
javac HelloWorld

d.
java HelloWorld.java

Question 6
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following we are not allowed to write java source code?

Select one:

a.
Notepad

b.
BlueJ

c.
NetBeans

d.
None of these

e.
eclipse

Question 7
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What will happen if we compile the statement below? ~System.out.println(“Hello World!”)

Select one:

a.
There will be a syntax error after compilation.
b.
There will be a logical error after compilation.

c.
There will be a runtime error after compilation.

d.
There will be no error after compilation.

Question 8
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the extension name of a Java Source code?

Select one:

a.
javac

b.
j

c.
java

d.
class

Question 9
Correct
Mark 1.00 out of 1.00

Flag question

Question text
The Java feature, "write once, run anywhere", is termed as

Select one:
a.
Object Oriented

b.
Robust

c.
Platform independent

d.
High Performance

Question 10
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the correct statement to run Java program in command line?

Select one:

a.
javac HelloWorld

b.
javac HelloWorld.java

c.
java HelloWorld

d.
java HelloWorld.java

1. UGRD-ITE6104-2213T
2. Prelim Quiz 2

QUIZ

Prelim Quiz 2
Started on Friday, 14 October 2022, 2:38 PM
State Finished
Completed on Friday, 14 October 2022, 2:46 PM
Time taken 8 mins 1 sec
Marks 10.00/10.00
Grade 100.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is floating-point literal?

Select one:

a.
It could be double or float value.

b.
Can be express in scientific notation.

c.
By default it is double type.

d.
An integer literal with decimal point.

e.
All of these

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following a valid Java identifier?

Select one:
a.
id

b.
_id

c.
All of these

d.
$id

e.
id_1

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is not a Java comment?

Select one:

a.
Multi-Line Comments

b.
Declaration Comments

c.
Documentation Comments

d.
None of these

e.
Single Line Comments

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is a valid identifier?

Select one:

a.
static

b.
public

c.
true

d.
name

e.
None of these

Question 5
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is not a primitive data type?

Select one:

a.
byte

b.
long

c.
String

d.
None of these

e.
short

Question 6
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is not a valid variable declaration in Java?

Select one:

a.
short x;

b.
float x = 2.0D;

c.
int x = 1;

d.
int x;

e.
None of these

Question 7
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is not a valid Float value?

Select one:
a.
3.4028235E+38F

b.
1.2345E+3

c.
None of these

d.
12345678910F

e.
1.23

Question 8
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is not an escape sequence?

Select one:

a.
\f

b.
\b

c.
\t

d.
None of these

Question 9
Correct
Mark 1.00 out of 1.00
Flag question

Question text
Which of the following is not a java keyword?

Select one:

a.
None of these

b.
name

c.
goto

d.
else

e.
if

Question 10
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is not Java Literal?

Select one:

a.
Character value

b.
None of the above

c.
Float value
d.
Integer value

e.
Boolean value

1. UGRD-ITE6104-2213T
2. Midterm Quiz 1

QUIZ

Midterm Quiz 1
Started on Friday, 28 October 2022, 11:43 AM
State Finished
Completed on Friday, 28 October 2022, 11:47 AM
Time taken 4 mins 25 secs
Marks 10.00/10.00
Grade 100.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What will happen if you use JOptionPane.showMessageDialog statement in your program?

Select one:

a.
None of these

b.
The program will display message dialog box.

c.
The program will display message dialog box returns String value.

d.
The program will display an input dialog box that allows the user to input text and returns
String value.

e.
The program will display an input dialog box that allows the user to input text and returns
the correct type value.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is a valid statement to accept int input? Let us assume that we have
declared scan as Scanner.

Select one:

a.
int num = scan.nextLong();

b.
short num = scan.nextShort();

c.
short num = scan.nextInt();

d.
None of these

e.
int num = scan.getInt();

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What will be the output if you execute this code?
do{System.out.println("Hello World!");}while(false);

Select one:

a.
The code will not run because of syntax error

b.
print "Hello World" infinitely

c.
None of these

d.
print "Hello World"

e.
Do nothing

Feedback
Your answer is correct.

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
what will be the output if you execute this code?
int x=1;
switch(x){
case 1:
                System.out.print(“1”);
case 2:
                System.out.print(“1”);
case 3:
                System.out.print(“1”);
default:
                System.out.print(“1”);
}
 

Select one:

a.
display nothing
 

b.
None of these

c.
display 1234
 

d.
display 1
 

e.
display 1111
 
Feedback
Your answer is correct.

Question 5
Correct
Mark 1.00 out of 1.00

Flag question
Question text
Which of the following method reads input from the user and return String value?

Select one:

a.
nextValue()

b.
nextLine()

c.
All of these

d.
nextText()

e.
nextString()

Question 6
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is a valid nextByte() return value?

Select one:

a.
int value

b.
None of these

c.
3

d.
short value
e.
128

Question 7
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What will be the output if you execute this code?
do{System.out.println("Hello World!");}while(true);
 

Select one:

a.
None of these

b.
The code will not run because of syntax error
 

c.
Do nothing
 

d.
print "Hello World" infinitely
 

e.
print "Hello World"
 
Feedback
Your answer is correct.
Question 8
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which is not a repetition control structure?

Select one:

a.
None of these

b.
do while

c.
for

d.
switch

e.
while

Question 9
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is a valid nexDouble() return value?

Select one:

a.
3.1416

b.
12.0
c.
All of these

d.
double value

e.
floating-point literal

Question 10
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What will happen if you use JOptionPane. showInputDialog statement in your program?

Select one:

a.
The program will display message dialog box returns String value.

b.
The program will display message dialog box.

c.
The program will display an input dialog box that allows the user to input text and returns
the correct type value.

d.
The program will display an input dialog box that allows the user to input text and returns
String value.

e.
None of these

1. UGRD-ITE6104-2213T
2. Midterm Quiz 1

QUIZ
Midterm Quiz 1
Started on Friday, 28 October 2022, 11:38 AM
State Finished
Completed on Friday, 28 October 2022, 11:42 AM
Time taken 4 mins 32 secs
Marks 9.00/10.00
Grade 90.00 out of 100.00
Question 1
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text
Which of the following has the correct form for an if statement?

Select one:

a.
if (boolean_expression)

b.
boolean_expression

c.
if boolean_expression

d.
None of these

e.
if boolean_expression

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What will be the value of x after you execute this statement
int z=0; for(int x=0; x<10; x++) for(int y=0; y<x; y++) z*=(x*y);

Select one:

a.
1
 

b.
512
 

c.
236

d.
None of these

e.
128
 
Feedback
Your answer is correct.

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is a valid nextInt() return value?

Select one:

a.
None of these

b.
long value

c.
floating-point literal

d.
3.1416

e.
1010

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is a valid statement to accept String input?

Select one:

a.
String str = JOptionPane.showInputDialog("");

b.
string str = scan.nextShort();

c.
None of these

d.
String num = scan.nextText();

e.
String str = scan.nextString();

Question 5
Correct
Mark 1.00 out of 1.00

Flag question
Question text
Which of the following does not return numeric value?

Select one:

a.
nextShort()

b.
nextLong()

c.
nextDouble()

d.
None of these

e.
nextInt()

Question 6
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which statement will check if x is less than y?
 

Select one:

a.
if (x<y);
 

b.
if (x<>y)
 
c.
None of these

d.
if (x>y)
 

e.
if (x>y)?:
 
Feedback
Your answer is correct.

Question 7
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which statement will check if x is equal to y?
 

Select one:

a.
None of these

b.
if (x!<y)
 

c.
if (x>y)
 

d.
if (x<>y)
 

e.
if (y>y)
 
Feedback
Your answer is correct.

Question 8
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What will be the value of x after executing this code
for(int x=0; x<=10; x++) {} is run?
 

Select one:

a.
11
 

b.
1
 

c.
10
 

d.
None of these

e.
0
 
Feedback
Your answer is correct.

Question 9
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What type of value does the nextLine() returns?

Select one:

a.
String

b.
None of these

c.
Line

d.
double

e.
long

Question 10
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which is not a decision control structure?

Select one:

a.
if else-if else
b.
if

c.
if else

d.
None of these

e.
switch

1. UGRD-ITE6104-2213T
2. Midterm Quiz 2

QUIZ

Midterm Quiz 2
Started on Thursday, 24 November 2022, 3:31 PM
State Finished
Completed on Thursday, 24 November 2022, 3:35 PM
Time taken 3 mins 5 secs
Marks 10.00/10.00
Grade 100.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the length of the array: int[] intArray = { 1, 2, 3, 5, 6, 7 };

Select one:

a.
4
b.
None of the choices

c.
5

d.
7

e.
6
Feedback
Your answer is correct.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following correctly accesses the sixth element stored in an array of 10
elements?

Select one:

a.
stringArray[5];

b.
intArray[10];

c.
None of these

d.
intArray[7];

e.
intArray[6];
Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is a valid multidimensional array?

Select one:

a.
int intArray[][][];

b.
int[][][] intArray;

c.
int[][][][] intArray;

d.
int[][] intArray;

e.
All of these

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the output of the code snippet below:
            int[] intArray = { 1, 2, 3, 5, 6, 7 };
            for(int x = intArray.length-1; x>=0; x--){System.out.print(intArray[x]);}

Select one:

a.
The given code is not valid
b.
12356

c.
None of these

d.
765321

e.
123567
Feedback
Your answer is correct.

Question 5
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the index number of the last element of an array with 30 elements?

Select one:

a.
29

b.
30

c.
31

d.
0

e.
None of these

Question 6
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following declares an array of int named intArray?

Select one:

a.
int[][] intArray;

b.
All of these

c.
int intArray[][];

d.
int[] intArray;

e.
int intArray[];

Question 7
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the maximum index of the array: int[] intArray = { 1, 2, 3, 5, 6, 7 };

Select one:

a.
4

b.
None of the choices

c.
6

d.
5

e.
7
Feedback
Your answer is correct.

Question 8
Correct
Mark 1.00 out of 1.00

Flag question

Question text
From the array int[] intArray = { 1, 2, 3, 5, 6, 7 };, what is the value of intArray[3]? 

Select one:

a.
7

b.
5

c.
4

d.
6

e.
None of the choices
Feedback
Your answer is correct.

Question 9
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following correctly accesses the sixth element stored in an array of 10
elements?

Select one:

a.
stringArray[5];

b.
None of these

c.
intArray[10];

d.
intArray[6];

e.
intArray[7];

Question 10
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the output of the code snippet below:
            int[] intArray = new int[10];
for(int x = 0; x<intArray.length; x++){System.out.print(intArray[x]);}

Select one:

a.
The given code is not valid
b.
0000000000

c.
012356789

d.
1235678910

e.
None of the choices
Feedback
Your answer is correct.

1. UGRD-ITE6104-2213T
2. Final Quiz 1

QUIZ

Final Quiz 1
Started on Friday, 2 December 2022, 11:37 AM
State Finished
Completed on Friday, 2 December 2022, 11:38 AM
Time taken 1 min 50 secs
Marks 10.00/10.00
Grade 100.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following will do implicit cast? 

Select one:

a.
short x=1; int y = x; 

b.
String x = “0”; int y = x;

c.
Object obj = new Object();

d.
All of these
Feedback
Your answer is correct.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What will be the value of x if we execute this: String s = "25"; int x = Integer.parseInt(s); ?

Select one:

a.
String 25

b.
None of these

c.
The code is not valid.

d.
0

e.
int 25
Feedback
Your answer is correct.

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the result if we execute this: “a” instanceof String; ?

Select one:

a.
false

b.
“a”

c.
None of these

d.
true

e.
The code is not valid

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What do you call a blueprint of an object?

Select one:

a.
Class

b.
None of these

c.
Constructor

d.
Object

e.
Method

Question 5
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the result if we execute this: “a”.equals(“a”);?

Select one:

a.
“a”

b.
false

c.
The code is not valid

d.
true

e.
None of these

Question 6
Correct
Mark 1.00 out of 1.00

Flag question
Question text
It is the method of hiding certain elements of the implementation of a certain class?

Select one:

a.
None of these

b.
Object

c.
Object Oriented

d.
Class

e.
Encapsulation

Question 7
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following show casting object?

Select one:

a.
(className)     object;

b.
SuperClass sc = new SuperClass(); SubClass sbc = new SubClass(); sbc = (SubClass) sc;

c.
Employee emp = new Employee(); VicePresident veep = new VicePresident(); veep =
(VicePresident)emp;
d.
All of the choices
Feedback
Your answer is correct.

Question 8
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What do you call a variable that belong to the whole class?

Select one:

a.
Object Variable

b.
Class Method

c.
None of these

d.
Static Variable

e.
Class Variable

Question 9
Correct
Mark 1.00 out of 1.00

Flag question

Question text
It is a template for creating an object?

Select one:

a.
Encapsulation

b.
Class

c.
Object Oriented

d.
Method

e.
None of these

Question 10
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following creates an instance of a class?

Select one:

a.
String str = new String();

b.
Test t = new Test();

c.
All of the choices

d.
Object obj = new Object();

e.
String str = new String();
Feedback
Your answer is correct.

1. UGRD-ITE6104-2213T
2. Final Quiz 2

QUIZ

Final Quiz 2
Started on Friday, 2 December 2022, 11:37 AM
State Finished
Completed on Friday, 2 December 2022, 11:42 AM
Time taken 4 mins 48 secs
Marks 10.00/10.00
Grade 100.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What keyword is used to perform class inheritance?

Select one:

a.
inherits

b.
derives

c.
implements

d.
None of these

e.
extends
Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is true about Interface?

Select one:

a.
It defines the signatures of a set of methods without the body

b.
It defines a standard and public way of specifying the behavior of classes

c.
All of these

d.
It is a special kind of block containing method signatures only

e.
It is use to model multiple inheritance which allows a class to have more than one
superclass.

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is the correct way to call the constructor of the parent class?

Select one:

a.
this.call()

b.
super()
c.
super.call()

d.
this()

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following method is allowed to be overriden?

Select one:

a.
public no_override void setName(){}

b.
None of these

c.
public final void setName(){}

d.
public void setName(){}

e.
public static void setName(){}
Feedback
Your answer is correct.

Question 5
Correct
Mark 1.00 out of 1.00

Flag question
Question text
Which of the following class declaration is not allowed to be instantiated?

Select one:

a.
None of these

b.
class Person{}

c.
public abstract class Person {}

d.
public class Person {}

e.
public final class Person {}
Feedback
Your answer is correct.

Question 6
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is the correct way to define an interface?

Select one:

a.
interface: [InterfaceName]

b.
public [InterfaceName] {}
c.
public interface [InterfaceName] {}

d.
public class interface [InterfaceName] {}
Feedback
Your answer is correct.

Question 7
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following class declaration is not allowed to be inherited?

Select one:

a.
public class Person {}

b.
public final class Person {}

c.
public abstract class Person {}

d.
None of these

e.
class Person{}
Feedback
Your answer is correct.

Question 8
Correct
Mark 1.00 out of 1.00
Flag question

Question text
It is the ability of an object to have many forms?

Select one:

a.
Abstraction

b.
Inheritance

c.
Polymorphism

d.
Interface

e.
None of these

Question 9
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which of the following is the correct way to use an interface?

Select one:

a.
public class Person use [InterfaceName] {}

b.
public class Person apply [InterfaceName] {}

c.
public class Person extends [InterfaceName] {}
d.
None of these

e.
public class Person implements [InterfaceName] {}
Feedback
Your answer is correct.

Question 10
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What do you call a class that inherits a class?

Select one:

a.
Subclass

b.
None of these

c.
Class

d.
Parent class

e.
Superclass

1. UGRD-ITE6104-2213T
2. Prelim Lab Quiz 1

QUIZ
Prelim Lab Quiz 1
Started on Friday, 30 September 2022, 12:14 PM
State Finished
Completed on Friday, 30 September 2022, 12:17 PM
Time taken 2 mins 30 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback This will test your program skills. Good Luck.
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Who is the founder of Java?

a.
James Gosling

b.
Bjarne Stroustrup
Feedback
Your answer is correct.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Which one of this is not Java software platform?

a.
Eclipse

b.
Spyder Anaconda

c.
Netbeans
Feedback
Your answer is correct.

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
In this problem, which one of this is missing?

public _______ Hello {
         public static void main (String args []){
             System.out.println("Hello!");
     }
}

a.
class

b.
()

c.
[]
Feedback
Your answer is correct.

Question 4
Correct
Mark 1.00 out of 1.00

Flag question
Question text
In this program, which of the following syntax need output this word, "I'm a
programmer" ?

public class programmer{


     public static void main(String args []){
          ____________________________________("I'm a programmer");
     }

a.
cout<<

b.
print()

c.
System.out.println();
Feedback
Your answer is correct.

Question 5
Correct
Mark 1.00 out of 1.00

Flag question

Question text
In this program, what will be the output for this:

public class Experiment1{


     public static void main(String args []){
         Int meter = 50, centimeter;
         centimeter = meter * 100;
         System.out.println(centimeter);
     }

a.
5000

b.
5

c.
0.05

d.
0.5
Feedback
Your answer is correct.
Note: Test this in your software in order to determine the correct answer.

1. UGRD-ITE6104-2213T
2. Prelim Lab Quiz 2

QUIZ

Prelim Lab Quiz 2


Started on Sunday, 16 October 2022, 1:12 PM
State Finished
Completed on Sunday, 16 October 2022, 1:14 PM
Time taken 1 min 55 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback This will test your programming skills. Good Luck.
Question 1
Correct
Mark 1.00 out of 1.00
Flag question

Question text
What is an example of Comment?

a.
/-

b.
/**
*
*
*/

c.
\\
Feedback
Your answer is correct.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Create a program to compute from this initial input and here's the ff:

a = 10
b = 20
c =50
d = ? 

Note: 

1. Use the int for this code.


2. d=a+b+c
3. package name "Addition"
4. pubilc class name "Add"
5. Test this on your device
6. Answer must be 80 if you add the three.

a.
package literal;

public class Add{

public static void main(String[] args) {


double a=10,b=20,c=50,d;
d=a+b-c;
System.out.println(d);
}
}

b.
package Addition;

public class Add{

public static void main(String[] args) {


int a=10,b=20,c=50,d;
d=a+b+c;
System.out.println(d);
}

c.
package literal;

public class Literal {

public static void main(String[] args) {


double a=10,b=20,c=50,d;
d=a-b+c;
System.out.println(d);
}
}

Feedback
Your answer is correct.

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the correct code for displaying "Hello World!" if you use class name "Hello"?

a.
public class Hello_world_ex {
    public static void main(String[] args) {
        System.out.println("Hi! \n");
    }   
}

b.
public class ex {
    public static void main(String[] args) {
        System.out.println("Hi! \n");
    }   
}

c.
public class Hello{
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }   
}

Feedback
Your answer is correct.

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is an example of correct Identifier?

a.
P1__anda

b.
for

c.
1__sgt
Feedback
Your answer is correct.

Question 5
Correct
Mark 1.00 out of 1.00

Flag question

Question text
If you test this program, what will the output of this:

package Binary;
public class BinaryTest{
    public static void main(String[] args) {
         System.out.println(0b111111);
  }
}
Note: Test this.
a.
40

b.
63

c.
10
Feedback
Your answer is correct.

1. UGRD-ITE6104-2213T
2. Midterm Lab Quiz 1

QUIZ

Midterm Lab Quiz 1


Started on Friday, 28 October 2022, 11:49 AM
State Finished
Completed on Friday, 28 October 2022, 11:50 AM
Time taken 28 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Is Do - While Loop is a Repetition Control Structure?

Select one:
True 
False

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
While Loop is not a Repetition Control Structure.

Select one:
True
False 

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Match the ff:

If  -
else Answer 1
stateme if (boolean_expression) statement; else statement;
nt
Nested
If - else Answer 2
stateme if (boolean_expression) statement1; statement2; else if (boolean_expression) statement; else statement
nt
If  -
stateme Answer 3
if (boolean_expression) statement;
nt
Feedback
Your answer is correct.

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is this looping syntax:

for(x=0;x>=5;x++)
a.
While

b.
Do - While

c.
For - Loop
Feedback
Your answer is correct.

Question 5
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Is Nested If - Else Statement a Looping Statement?

Select one:
True
False 

1. UGRD-ITE6104-2213T
2. Midterm Lab Quiz 2

QUIZ

Midterm Lab Quiz 2


Started on Thursday, 24 November 2022, 3:45 PM
State Finished
Completed on Thursday, 24 November 2022, 3:45 PM
Time taken 33 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Match the following:
if (condition) {
// block of code to be executed if the condition is true
Answer 1
}
If

switch(expression) {
case x:
// code block
break;
case y:
// code block Answer 2
break; Sw itch
default:
// code block
}

if (condition) {
// block of code to be executed if the condition is true
} else {
Answer 3
// block of code to be executed if the condition is false
If-else
}

if (condition1) {
// block of code to be executed if condition1 is true
} else if (condition2) {
// block of code to be executed if the condition1 is false
and condition2 is true
Answer 4
} else {
Nested If-else
// block of code to be executed if the condition1 is false
and condition2 is false
}

Feedback
Your answer is correct.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question
Question text
Fill the missing syntax:
int number = 10;
switch (day) {
case 2:
System.out.println("Two");
_____
case 4:
System.out.println("Four");
_____
case 6:
System.out.println("Six");
_____
case 8:
System.out.println("Eight");
_____
case 10:
System.out.println("Ten");
_____
default:
System.out.println("Looking forward to the Weekend");
}

a.
break;

b.
break

c.
else
Feedback
Your answer is correct.

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Do you think this is true?

While Syntax
for (statement 1; statement 2; statement 3) {
// code block to be executed
}

Do - while Syntax
do {
// code block to be executed
}
while (condition);

For-Loop Syntax
while (condition) {
// code block to be executed
}

Select one:
True
False 

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the correct out for this program:

public class Main {


  public static void main(String[] args) {
    int i = 1;
    while (i <= 10) {
      System.out.println(i);
      i++;
    }  
 }
}

Note: Test this program to get the answer.

a.
1
2
3
4
5
6
7
8
9
10

b.
0
1
2
3
4
5
6
7
8
9
10

c.
12345678910
Feedback
Your answer is correct.

Question 5
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What is the output for this:

public class Main {


  public static void main(String[] args) {
    for (int i = 10; i >= 5; i--) {
      System.out.println(i);
    }  
 }
}

Note: Test this program to get the output.

a.
10
9
8
7
6
5

b.
1098765

c.
5
6
7
8
9
10
Feedback
Your answer is correct.

1. UGRD-ITE6104-2213T
2. Final Lab Quiz 1
QUIZ

Final Lab Quiz 1


Started on Friday, 2 December 2022, 11:59 AM
State Finished
Completed on Friday, 2 December 2022, 12:08 PM
Time taken 9 mins 45 secs
Marks 4.00/5.00
Grade 80.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Match the following:

Software component whose structure. Object


Answer 1
Object-Oriented Programming OOP
Answer 2
Fundamental structure in OOP. Class
Answer 3
Feedback
Your answer is correct.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
OOP stands for Object-Oriented Program?

Select one:
True
False 

Question 3
Correct
Mark 1.00 out of 1.00
Flag question

Question text
What is the definition of Abstract Method?

a.
Software component in OOP.

b.
Method of hiding certain elements of the implementation of a certain class.

c.
Methods in the abstract classes that do not have implementation.
Feedback
Your answer is correct.

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Match the following:

'New' keyword is followed by a call to a constructor. Initialization


Answer 1
Instantiation
'New' keyword  is used to create the object. Answer 2
A variable declaration with a variable name with an object type. Declaration
Answer 3
Feedback
Your answer is correct.

Question 5
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text
What do you called the special kind of block containing method signatures (and possibly
constants) only?
interface
Answer: 

1. UGRD-ITE6104-2213T
2. Final Lab Quiz 2

QUIZ

Final Lab Quiz 2


Started on Friday, 2 December 2022, 12:09 PM
State Finished
Completed on Friday, 2 December 2022, 12:19 PM
Time taken 9 mins 35 secs
Marks 4.00/5.00
Grade 80.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text
The another name for Typecasting is Casting.

Select one:
True 
False

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Fill up the correct syntax:

public class Puppy {


name
    public Puppy(String Answer ){
        System.out.println("Named:" + name);
  }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Puppy myPuppy = new Puppy("Tom");
  }
}

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text
What do you called a problem that arises during the execution of a program?

a.
Exception

b.
Handling

c.
OOP
Feedback
Your answer is correct.

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text
Match the following:

Answer 1
Inheritance Class Hierarchy

Answer 2
Polymorphism Class Hierarchy

Answer 3
Abstract Class Hierarchy

Feedback
Your answer is correct.

Question 5
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text
What do you called adding the final keyword in the method declaration?

variable
Answer: 

You might also like