Documente Academic
Documente Profesional
Documente Cultură
Section 2 Quiz
(Answer all questions in this section)
1. What is the correct order of steps in the Spiral Model of Development? Mark for Review
(1) Points
2. A software feature may allow the user to perform a specific task. Mark for Review
(1) Points
True (*)
False
Correct
3. You’d like to see a movie with a few friends. You write an email to confirm plans. Mark for Review
Hi Friends, (1) Points
There’s a new movie “Attack of the Duke!” premiering this Friday at Oracle Cinema
at 4:30 PM. The cinema is at the corner of South Street and Walnut Ave. Subway
would be the best way to get there.
4. The Spiral Model reflects an iterative development process. Mark for Review
(1) Points
True (*)
False
Correct
5. There are several fields and methods in a Shirt class. Which of the following could Mark for Review
be a method in the Shirt class?
(1) Points
price
size
getShirtSize() (*)
color
True (*)
False
7. You design a Circle class with various fields and methods. Which of the Mark for Review
following could be fields in this class? Distinguish which of these are between
the properties and behavior. (1) Points
calculateDiameter()
calculateArea()
color (*)
radius (*)
calculateCircumference()
8. Which of the following language is called a procedural language? Mark for Review
(1) Points
Java
Java C
C (*)
C++
9. You have a beautiful garden at home. On Sunday, you start budding your Mark for Review
rose plant to make few more samples of rose plants to plant in the garden.
Can you categorize how this scenario could be represented by classes and (1) Points
instances?
Rose plant is the class and the samples generated from the rose plant
are instances of that class. (*)
Rose plant is the object and samples are not instances of the plant
because they have not grown yet.
Samples are the class and the rose plant is the instances of samples.
Samples of the rose plant are called classes and not the actual rose
plant.
Correct
10. What is the purpose of adding comments in the code? Mark for Review
(1) Points
12. Which of the following 2 statements are true about whitespace? Mark for Review
(1) Points
True (*)
False
Correct
14. Which of the following two features are supported by the NetBeans IDE. Mark for Review
(1) Points
True (*)
False
Correct
Section 2 Quiz
(Answer all questions in this section)
True (*)
False
Correct
2. A Java program can be written in the single line. Mark for Review
(1) Points
True (*)
False
True (*)
False
Correct
4. Which of the following two features are supported by the NetBeans IDE. Mark for Review
(1) Points
Samples of the rose plant are called classes and not the actual rose
plant.
Rose plant is the object and samples are not instances of the plant
because they have not grown yet.
Rose plant is the class and the samples generated from the rose plant
are instances of that class. (*)
Samples are the class and the rose plant is the instances of samples.
8. You design a Circle class with various fields and methods. Which of the Mark for Review
following could be fields in this class? Distinguish which of these are
between the properties and behavior. (1) Points
calculateDiameter()
calculateCircumference()
color (*)
calculateArea()
radius (*)
9. Which of the following language is called a procedural language? Mark for Review
(1) Points
C++
Java
C (*)
Java C
10. An object may interact with another object by invoking methods. Mark for Review
(1) Points
True (*)
False
Correct
11. There Mark for Review
are
several (1) Points
fields
and
methods
in a Shirt
class.
Which of
the
following
could be
a
method
in the
Shirt
class?
size
color
getShirtSize() (*)
price
12. A software feature may allow the user to perform a specific task. Mark for Review
(1) Points
True (*)
False
Correct
13. Which of the following are adequate definitions for components of the Spiral Mark for Review
Model of Development?
(1) Points
14. What is the correct order of steps in the Spiral Model of Development? Mark for Review
(1) Points
Correct
15. You’d like to see a movie with a few friends. You write an email to confirm Mark for Review
plans.
(1) Points
Hi Friends,
There’s a new movie “Attack of the Duke!” premiering this Friday at Oracle
Cinema at 4:30 PM. The cinema is at the corner of South Street and Walnut
Ave. Subway would be the best way to get there.
Section 2 Quiz
(Answer all questions in this section)
1. What is the correct order of steps in the Spiral Model of Development? Mark for Review
(1) Points
2. The Spiral Model reflects an iterative development process. Mark for Review
(1) Points
True (*)
False
Correct
3. During the Testing phase of software development, which of the following are the Mark for Review
tasks undertaken by the programmer?
(1) Points
4. You’d like to see a movie with a few friends. You write an email to confirm plans. Mark for Review
Hi Friends, (1) Points
There’s a new movie “Attack of the Duke!” premiering this Friday at Oracle
Cinema at 4:30 PM. The cinema is at the corner of South Street and Walnut Ave.
Subway would be the best way to get there.
True (*)
False
Correct
6. You can set Mark for Review
any number
of (1) Points
breakpoints
for your
program.
True (*)
False
7. Which two are the correct syntax for adding comments? Mark for Review
(1) Points
Start with two slashes (//). End when the line ends. (*)
Start with a slash- star (/*). End with slash-star (/*).
Start with two slashes (//). End with two slashes (//).
Start with two slashes and a star (//*). End with a star-slash (*/).
Start with a slash-star (/*). End with a star-slash (*/). (*)
Incorrect. Refer to Section 2 Lesson 2.
8. A breakpoint can be set by clicking a number in the left margin of the Mark for Review
IDE. Clicking again removes the breakpoint.
(1) Points
True (*)
False
Correct
9. Which of the following two features are supported by the NetBeans IDE. Mark for Review
(1) Points
NetBeans automatically runs the program once all the braces in the
code are matched.
NetBeans provides a shortcut to format whitespace. (*)
Once NetBeans spots a problem, it won’t allow you to continue
coding until the progrblem is fixed.
NetBeans highlights matching braces. (*)
10. What is the purpose of adding comments in the code? Mark for Review
(1) Points
Samples are the class and the rose plant is the instances of
samples.
Rose plant is the class and the samples generated from the rose
plant are instances of that class. (*)
Samples of the rose plant are called classes and not the actual
rose plant.
Rose plant is the object and samples are not instances of the
plant because they have not grown yet.
12. Which of the following language is called a procedural language? Mark for Review
(1) Points
C++
Java
C (*)
Java C
13. In object oriented programming, an object comprises of properties and Mark for Review
behaviors where properties represented as fields of the object and
behavior is represented as method. (1) Points
True (*)
False
14. An object may interact with another object by invoking methods. Mark for Review
(1) Points
True (*)
False
Correct
15. You design a Circle class with various fields and methods. Which of the Mark for Review
following could be fields in this class? Distinguish which of these are
between the properties and behavior. (1) Points
radius (*)
calculateArea()
calculateDiameter()
color (*)
calculateCircumference()
1. Which of the following two statements are true about variables? Mark for Review
(1) Points
3. Which two data types are appropriate for their variable? Mark for Review
(1) Points
True (*)
False
Correct
Correct
7. Which is valid syntax to declare and initialize a String variable? Mark for Review
(1) Points
Value of age: 20
Value of age: 8
Value of age: 10 (*)
Value of age: 20
Value of age: 28
Value of age: 38
Value of age: 20
Value of age: 208
Value of age: 20810
Value of age: 20
Value of age: 8
Value of age: 9
Correct
8
9 (*)
34
7
10. What is the output? public static void main(String args[]) { Mark for Review
int x = 100;
int y = x; (1) Points
y++;
System.out.println("Value of x is " + x);
System.out.println("Value of y is " + y);
}
Value of x is 0
Value of y is 1
Value of x is 100
Value of y is 1
Value of x is 100
Value of y is 1
Value of x is 100
Value of y is 101 (*)
Correct
12. Which two are recommended practices for naming final variables? Mark for Review
(1) Points
13. This declaration represents a long data type. Mark for Review
long a = 123L;
(1) Points
True (*)
False
2
4
6
7
8 (*)
Correct
15. Assuming x is an int, which of the following are ways to increment the value Mark for Review
of x by 1?
(1) Points
x = x +1; (*)
x = +1;
x+;
x++; (*)
x += 1; (*)
8
9 (*)
34
7
Value of age: 20
Value of age: 8
Value of age: 10 (*)
Value of age: 20
Value of age: 28
Value of age: 38
Value of age: 20
Value of age: 208
Value of age: 20810
Value of age: 20
Value of age: 8
Value of age: 9
Correct
3. What is the output? public static void main(String args[]) { Mark for Review
int x = 100;
int y = x; (1) Points
y++;
System.out.println("Value of x is " + x);
System.out.println("Value of y is " + y);
}
Value of x is 0
Value of y is 1
Value of x is 100
Value of y is 1
Value of x is 100
Value of y is 1
Value of x is 100
Value of y is 101 (*)
4. Which of the following data types is the largest? Mark for Review
(1) Points
byte
short
int
long (*)
5. Which two are recommended practices for naming final variables? Mark for Review
(1) Points
const
final (*)
static
break
Correct
7. What is the range of the byte data type? Mark for Review
(1) Points
+ (*)
– (*)
#
@
a=2
This is my first program a is 2 (*)
This is my first program a is + a
This is my first program
Correct
10. Which of the following two statements are true about variables? Mark for Review
(1) Points
True (*)
False
Correct
12. Which two statements will not compile? Mark for Review
(1) Points
13. Which is valid syntax to declare and initialize a String variable? Mark for Review
(1) Points
14. Identify the names of two variables used in the given code. Mark for Review
public class Variables { (1) Points
public static void main(String args[]) {
String strVal = "Hello";
int intVal = 0;
System.out.println("Integer: " +intVal)
}
}
String
intVal (*)
Hello
int
strVal (*)
15. Java is a strongly typed language; therefore you must declare a data Mark for Review
type for all variables.
(1) Points
True (*)
False
Correct
Section 3 Quiz 1 - L1-L2
(Answer all questions in this section)
8
9 (*)
34
7
2. Which two are recommended practices for naming final variables? Mark for Review
(1) Points
Correct
3. Which of the following data types is the largest? Mark for Review
(1) Points
byte
short
int
long (*)
Correct
4. Assuming x is an int, which of the following are ways to increment the value of x Mark for Review
by 1?
(1) Points
x = x +1; (*)
x = +1;
x+;
x++; (*)
x += 1; (*)
Incorrect. Refer to Section 3 Lesson 2.
2
4
6
7
8 (*)
+ (*)
– (*)
#
@
Correct
True (*)
False
Correct
Value of age: 20
Value of age: 8
Value of age: 10 (*)
Value of age: 20
Value of age: 28
Value of age: 38
Value of age: 20
Value of age: 208
Value of age: 20810
Value of age: 20
Value of age: 8
Value of age: 9
Correct
9. Which is valid syntax to declare and initialize a String variable? Mark for Review
(1) Points
10. Identify the variable declared in the given code. Mark for Review
public class Welcome { (1) Points
public static void main(String args[]) {
int a = 2;
System.out.println("a is" + a);
}
}
int
a (*)
2
Welcome
True (*)
False
Correct
12. Identify the names of two variables used in the given code. Mark for Review
public class Variables { (1) Points
public static void main(String args[]) {
String strVal = "Hello";
int intVal = 0;
System.out.println("Integer: " +intVal)
}
}
intVal (*)
Hello
String
int
strVal (*)
a=2
This is my first program a is + a
This is my first program
This is my first program a is 2 (*)
14. Which two statements will not compile? Mark for Review
(1) Points