Jamu medtrem
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
Design, Requirements, Develop, Test Design, Develop , Requirements, Test Requirements, Design, Test, Develop Requirements, Design, Develop, Test (*) Incorrect. Refer to Section 2 Lesson 1. feature may allow the user user to perform a specific task. task. 2. A software feature
Mark for Review (1) Points
rue (*) False Correct see a movie with a few friends. You friends. You write an email email to confirm plans. 3. You’d like to see Hi Friends, here’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.
Mark for Review (1) Points
Would any of you be interested in going? Which of the following are requirements for this plan? Reach the cinema by 4:00 PM. ravel via subway. Double check the location by verifying you’re on South Street and Walnut Ave. Watch “Attack of the Duke!” on Friday at Oracle Cinema at 4:30 PM. (*) Incorrect. Refer to Section 2 Lesson 1. 4. he Spiral Model reflects an iterative development process.
Mark for Review (1) Points
rue (*) False Correct
5. here are several fields and methods in a Shirt class. Which of the following could be a method in the Shirt class?
Mark for Review (1) Points
price size getShirtSize() (*) color Incorrect. Refer to Section 2 Lesson 3. 6. An object may interact with another object by invoking methods.
Mark for Review (1) Points
rue (*) False Incorrect. Refer to Section 2 Lesson 3. and methods. Which of the 7. You design a Circle class with various fields and following could be fields in this class? Distinguish which of these are between the properties and behavior.
Mark for Review (1) Points
(Choose all correct answers) calculateDiameter() calculateArea() color (*) radius (*) calculateCircumference() Incorrect. Refer to Section 2 Lesson 3. 8. Which of the following language is called a procedural language?
Mark for Review (1) Points
Java Java C C (*) C++ Incorrect. Refer to Section 2 Lesson 3. On Sunday, you start budding your 9. You have a beautiful garden at home. On 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 instances?
Mark for Review (1) Points
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
o provide better security to the program. Provide good look and feel of the code. Provide an explanation about the code to the programmer. (*) It increases the execution time of the code. Incorrect. Refer to Section 2 Lesson 2. 11. Which of the following three statements are true about breakpoint?
Mark for Review (1) Points
(Choose all correct answers) hey abruptly ends the code execution. hey can be used to check the current state of the program (*) hey help with debugging. (*) hey insert break statements. hey pause code execution. (*) Incorrect. Refer to Section 2 Lesson 2. 12. Which of the following 2 statements are true about whitespace?
Mark for Review (1) Points
(Choose all correct answers) Whitespace eliminates typing mistakes while programming. Whitespace makes your code more readable. (*) Whitespace increases execution time of your program. Whitespace reduces the performance of the program. Whitespace helps to keep your code organized. (*) Incorrect. Refer to Section 2 Lesson 2.
any number of breakpoints for your program. 13. You can set any
Mark for Review (1) Points
rue (*) False Correct 14. Which of the following two features are supported by the Net Beans IDE.
Mark for Review (1) Points
(Choose all correct answers) NetBeans highlights matching braces. (*) NetBeans provides a shortcut to format whitespace. (*) NetBeans automatically runs the program once all the braces in the code are matched. Once NetBeans spots a problem, it won’t allow you to continue coding until the progrblem is fixed. Incorrect. Refer to Section 2 Lesson 2. 15. Java mostly reads code line-by-line.
Mark for Review (1) Points
rue (*) False Correct Section 2 Quiz (Answer all questions in this section) 1. Java mostly reads code line-by-line.
Mark for Review (1) Points
rue (*) False Correct 2. A Java program can be written in the single line.
Mark for Review (1) Points
rue (*) False Incorrect. Refer to Section 2 Lesson 2.
3. Code within curly braces is called a “Block of code”.
Mark for Review (1) Points
rue (*) False Correct 4. Which of the following two features are supported by the N etBeans IDE.
Mark for Review (1) Points
(Choose all correct answers) 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. (*) NetBeans automatically runs the program once all the braces in the code are matched. Incorrect. Refer to Section 2 Lesson 2. 5. Which of the following are considered Whitespace?
Mark for Review (1) Points
(Choose all correct answers) Space between the [ ] braces. Space in the print statements. Blank lines in the code. (*) Indentation before the code. (*) Space between words. (*) Incorrect. Refer to Section 2 Lesson 2. 6. What is the purpose of adding comments in the code?
Mark for Review (1) Points
Provide good look and feel of the code. It increases the execution time of the code. o provide better security to t he program. Provide an explanation about the code to the programmer. (*) Incorrect. Refer to Section 2 Lesson 2.
beautiful garden at home. On Sunday, you start start budding your 7. You have a beautiful 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 instances?
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 ro se plant are instances of that class. (*) Samples are the class and the rose plant is the instances of samples. Incorrect. Refer to Section 2 Lesson 3. Which of the 8. You design a Circle class with various fields and methods. Which following could be fields in this class? Distinguish which of these are between the properties and behavior.
Mark for Review (1) Points
(Choose all correct answers) calculateDiameter() calculateCircumference() color (*) calculateArea() radius (*) Incorrect. Refer to Section 2 Lesson 3. 9. Which of the following language is called a procedural language?
Mark for Review (1) Points
C++ Java C (*) Java C Incorrect. Refer to Section 2 Lesson 3. object by invoking methods. methods. 10. An object may interact with another object
Mark for Review (1) Points
rue (*) False Correct 11. here are several fields and methods
Mark for Review (1) Points
in a Shirt class. Which of the following could be a method in the Shirt class? size color getShirtSize() (*) price Incorrect. Refer to Section 2 Lesson 3. feature may allow the user user to perform a specific task. task. 12. A software feature
Mark for Review (1) Points
rue (*) False Correct 13. Which of the following are adequate definitions for components of the Spiral Model of Development?
Mark for Review (1) Points
(Choose all correct answers) est: Run the code and verify results (*) Requirements: Start the development Design: Plan the approach (*) Develop: Collect all specified instructions Incorrect. Refer to Section 2 Lesson 1. 14. What is the correct order of steps in the Spiral Model of Development?
Mark for Review (1) Points
Requirements, Design, Develop, Test (*) Design, Requirements, Develop, Test Requirements, Design, Test, Develop Design, Develop , Requirements, Test Correct
see a movie with a few friends. You You write an email to confirm 15. You’d like to see plans.
Mark for Review (1) Points
Hi Friends, here’s a new movie “Attack of o f 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 be the best way to to get there. Would any of you be interested in going? Which of the following are requirements for this plan? ravel via subway. Reach the cinema by 4:00 PM. Double check the location by verifying you’re on South Street and Walnut Ave. Watch “Attack of the Duke!” on Friday at Oracle Cinema at 4:30 PM. (*) Incorrect. Refer to Section 2 Lesson 1. 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
Requirements, Design, Test, Develop Design, Develop , Requirements, Test Design, Requirements, Develop, Test Requirements, Design, Develop, Test (*) Incorrect. Refer to Section 2 Lesson 1.
2.
he Spiral Model reflects an iterative development process.
Mark for Review (1) Points
rue (*) False Correct 3. During the Testing phase of software development, which of the following are the tasks undertaken by the programmer?
Mark for Review (1) Points
(Choose all correct answers) Finding the bugs. (*) Fixing the bugs. (*) Listing required features. Planning the order to implement features.
Incorrect. Refer to Section 2 Lesson 1. see a movie with a few friends. You write an email to confirm plans. plans. 4. You’d like to see Hi Friends, here’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.
Mark for Review (1) Points
Would any of you be interested in going? Which of the following are requirements for this plan? ravel via subway. Watch “Attack Watch “Attack of the Duke!” on Friday at Oracle Cinema at 4:30 PM. (*) Double check the location by verifying you’re on South Street and Walnut Ave. Reach the cinema by 4:00 PM. Incorrect. Refer to Section 2 Lesson 1. 5. Java mostly reads code line-by-line.
Mark for Review (1) Points
rue (*) False Correct 6. You can set any number of breakpoints for your program.
Mark for Review (1) Points
rue (*) False Incorrect. Refer to Section 2 Lesson 2. 7. Which two are the correct syntax for adding comments?
Mark for Review (1) Points
(Choose all correct answers) 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 IDE. Clicking again removes the breakpoint.
Mark for Review (1) Points
rue (*) False Correct 9. Which of the following two features are supported by the Net Beans IDE.
Mark for Review (1) Points
(Choose all correct answers) 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. (*) Incorrect. Refer to Section 2 Lesson 2. 10. What is the purpose of adding comments in the code?
Mark for Review (1) Points
It increases the execution time of the code. Provide good look and feel of the code. o provide better security to the program. Provide an explanation about the code to the programmer. (*) Incorrect. Refer to Section 2 Lesson 2. 11. You have a beautiful garden at home. On Sunday, you start budding your rose plant to make few more samples of rose plants to plant in the garden. Can you categorize how this scenario could be represented
Mark for Review (1) Points
by classes and instances? 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. Incorrect. Refer to Section 2 Lesson 3. 12. Which of the following language is called a procedural language?
Mark for Review (1) Points
C++ Java C (*) Java C Incorrect. Refer to Section 2 Lesson 3. 13. In object oriented programming, an object comprises of properties and behaviors where properties represented as fields of the o bject and behavior is represented as method.
Mark for Review (1) Points
rue (*) False Incorrect. Refer to Section 2 Lesson 3. interact with another object object by invoking methods. methods. 14. An object may interact
Mark for Review (1) Points
rue (*) False Correct with various fields and methods. Which of the 15. You design a Circle class with following could be fields in this class? Distinguish which of these are between the properties and behavior. (Choose all correct answers) radius (*) calculateArea() calculateDiameter() color (*)
Mark for Review (1) Points
calculateCircumference() Incorrect. Refer to Section 2 Lesson 3. Section 3 Quiz 1 - L1-L2 (Answer all questions in this section) 1. Which of the following two statements are true about variables?
Mark for Review (1) Points
(Choose all correct answers) Variables will will be ignored by compiler. he value assigned to a variable may never change. he allow code to be edited more efficiently. (*) hey make code becomes flexible. (*) Incorrect. Refer to Section 3 Lesson 1. 2. Which two statements will not compile?
Mark for Review (1) Points
(Choose all correct answers) int abc = 10; double double=10; (*) int break=10; (*) double salary = 20000.34; int age=20; Incorrect. Refer to Section 3 Lesson 1. a ppropriate for their variable? 3. Which two data types are appropriate
Mark for Review (1) Points
(Choose all correct answers) boolean age = 20; int averageDollarAmount = 19.95; double checkingAmount = 1500; (*) String firstName = “Alex”; (*) Incorrect. Refer to Section 3 Lesson 1. value to the variable is called “initialization”. “initialization”. 4. Assigning a value
Mark for Review (1) Points
rue (*)
False Correct 5. What is the output?
Mark for Review
public class Welcome { public static void main(String args[]) { System.out.println("This is my first program"); int a = 2; System.out.println("a is" + a); } }
(1) Points
his is my first program his is my first program a is 2 (*) a=2 his is my first program a is + a Correct 6. Which two are valid?
Mark for Review (1) Points
(Choose all correct answers) double doubleVar1; doubleVar2 = 3.1. double doubleVar1, double doubleVar2 = 3.1; double doubleVar1, doubleVar2 = 3.1; (*) double doubleVar1 = 3.1; double doubleVar2 = 3.1; (*) Incorrect. Refer to Section 3 Lesson 1. 7. Which is valid syntax to declare and initialize a String variable?
Mark for Review (1) Points
String “x” = “Java”; String x = Java; String x= “Java”; (*) String “x” = Java; Incorrect. Refer to Section 3 Lesson 1. 8. What is the output?
public class Person { public static void main(String args[]) { int age = 20; System.out.println("Value System.out.println("Va lue of age: " +age); age = 5 + 3; System.out.println("Value System.out.println("Va lue of age: " +age);
Mark for Review (1) Points
age = age + 1; age++; System.out.println("Value System.out.println("Va lue of age: " +age); } } Value Value Value Value Value Value Value Value Value Value Value Value
of of of of of of of of of of of of
age: 20 age: 8 age: 10 (*) age: 20 age: 28 age: 38 age: 20 age: 208 age: 20810 age: 20 age: 8 age: 9 Correct
9. What value is assigned to x?
Mark for Review (1) Points
int x = 25 - 5 * 4 / 2 - 10 + 4; 8 9 (*) 34 7 Incorrect. Refer to Section 3 Lesson 2. 10. What is the output? public static void main(String args[]) { int x = 100; int y = x; y++; System.out.println("Value System.out.println("Va lue of x is " + x); System.out.println("Value System.out.println("Va lue of y is " + y); }
Value Value Value Value Value Value Value Value
of of of of of of of of
x y x y x y x y
Mark for Review (1) Points
is 0 is 1 is 100 is 1 is 100 is 1 is 100 is 101 (*) Incorrect. Refer to Section 3 Lesson 2.
11. What is the range of the byte data type?
Mark for Review (1) Points
–2 – 27 to 27 – –1 1 (*) –2 – 215 to 215 – –1 1 –2 – 231 to 231 – –1 1 –2 – 263 to 263 – –1 1 Correct 12. Which two are recommended practices for naming final variables?
Mark for Review (1) Points
(Choose all correct answers) Capitalize every letter (*) Separate words with an underscore (*) Capitalize first letter Separate words with an space Incorrect. Refer to Section 3 Lesson 2. 13. his declaration represents a long data type. long a = 123L;
Mark for Review (1) Points
rue (*) False Incorrect. Refer to Section 3 Lesson 2. 14. How many bits are in a byte?
Mark for Review (1) Points
2 4 6 7 8 (*) Correct 15. Assuming x is an int, which of the following are ways to increment the value of x by 1?
Mark for Review (1) Points
(Choose all correct answers) x = x +1; (*) x = +1; x+; x++; (*)
x += 1; (*) Incorrect. Refer to Section 3 Lesson 2. Section 3 Quiz 1 - L1-L2 (Answer all questions in this section) 1. What value is assigned to x?
int x = 25 - 5 * 4 / 2 - 10 + 4;
Mark for Review (1) Points
8 9 (*) 34 7 Incorrect. Refer to Section 3 Lesson 2. 2. What is the output?
public class Person { public static void main(String args[]) { int age = 20; System.out.println("Value System.out.println("Va lue of age: " +age); age = 5 + 3; System.out.println("Value System.out.println("Va lue of age: " +age); age = age + 1; age++; System.out.println("Value System.out.println("Va lue of age: " +age); } } Value Value Value Value Value Value Value Value Value Value Value Value
of of of of of of of of of of of of
age: age: age: age: age: age: age: age: age: age: age: age:
Mark for Review (1) Points
20 2 0 8 10 (*) 10 20 28 28 38 38 20 20 208 208 20810 20810 20 20 8 9
Correct 3. What is the output? public static void main(String args[]) { int x = 100; int y = x; y++; System.out.println("Value System.out.println("Va lue of x is " + x); System.out.println("Value System.out.println("Va lue of y is " + y); }
Value Value Value Value
of of of of
x y x y
is 0 is 1 is 100 is 1
Mark for Review (1) Points
Value Value Value Value
of of of of
x y x y
is 100 is 1 is 100 is 101 (*)
Incorrect. Refer to Section 3 Lesson 2. 4. Which of the following data types is the largest?
Mark for Review (1) Points
byte short int long (*) Incorrect. Refer to Section 3 Lesson 2. 5. Which two are recommended practices for naming final variables?
Mark for Review (1) Points
(Choose all correct answers) Capitalize every letter (*) Separate words with an underscore (*) Capitalize first letter Separate words with an space Incorrect. Refer to Section 3 Lesson 2. 6. Which keyword makes a variable’s value unchangeable?
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
–2 – 27 to 27 – –1 1 (*) –2 – 215 to 215 – –1 1 –2 – 231 to 231 – –1 1 –2 – 263 to 263 – –1 1 Incorrect. Refer to Section 3 Lesson 2.
8. Which two are mathematical operators?
Mark for Review (1) Points
(Choose all correct answers) + (*) – (*) – (*) # @ Incorrect. Refer to Section 3 Lesson 2. 9. What is the output?
Mark for Review
public class Welcome { public static void main(String args[]) { System.out.println("This is my first program"); int a = 2; System.out.println("a is" + a); } }
(1) Points
a=2 his is my first program a is 2 (*) his is my first program a is + a his is my first program Correct 10. Which of the following two statements are true about variables?
Mark for Review (1) Points
(Choose all correct answers) he value assigned to a variable may never change. he allow code to be edited more efficiently. (*) hey make code becomes flexible. (*) Variables will be ignored by compiler. compiler. Incorrect. Refer to Section 3 Lesson 1. 11. Assigning a value to the variable is called initialization”.
Mark for Review (1) Points
rue (*) False Correct
12. Which two statements will not compile?
Mark for Review (1) Points
(Choose all correct answers) int break=10; (*) double salary = 20000.34 20000.34;; int age=20; int abc = 10; double double=10; (*) Incorrect. Refer to Section 3 Lesson 1. 13. Which is valid syntax to declare and initialize a String variable?
Mark for Review (1) Points
String “x” = Java; String x = Java; String x= “Java”; (*) String “x” = “Java”; Incorrect. Refer to Section 3 Lesson 1. 14. Identify the names of two variables used in the given code.
public class Variables { public static void main(String args[]) { String strVal = "Hello"; int intVal = 0; System.out.println("Integer: System.out.println("Integ er: " +intVal) } }
Mark for Review (1) Points
(Choose all correct answers) String intVal (*) Hello int strVal (*) Incorrect. Refer to Section 3 Lesson 1. 15. Java is a strongly typed language; therefore you must declare a data type for all variables.
Mark for Review (1) Points
rue (*) False
Correct Section 3 Quiz 1 - L1-L2 (Answer all questions in this section) 1. What value is assigned to x?
int x = 25 - 5 * 4 / 2 - 10 + 4;
Mark for Review (1) Points
8 9 (*) 34 7 Incorrect. Refer to Section 3 Lesson 2. 2. Which two are recommended practices for naming final variables?
Mark for Review (1) Points
(Choose all correct answers) Capitalize every letter (*) Separate words with an underscore (*) Capitalize first letter Separate words with an space Correct 3. Which of the following data types is the largest?
Mark for Review (1) Points
byte short int long (*) Correct the following are ways to increment the value of x 4. Assuming x is an int, which of the by 1?
Mark for Review (1) Points
(Choose all correct answers) x = x +1; (*) x = +1; x+; x++; (*) x += 1; (*)
Incorrect. Refer to Section 3 Lesson 2. 5. How many bits are in a byte?
Mark for Review (1) Points
2 4 6 7 8 (*) Incorrect. Refer to Section 3 Lesson 2. 6. Which two are mathematical operators?
Mark for Review (1) Points
(Choose all correct answers) + (*) – (*) – (*) # @ Correct 7. his declaration represents a long data type. long a = 123L;
Mark for Review (1) Points
rue (*) False Correct 8. What is the output?
public class Person { public static void main(String args[]) { int age = 20; System.out.println("Value System.out.println("Val ue of age: " +age); age = 5 + 3; System.out.println("Value System.out.println("Val ue of age: " +age); age = age + 1; age++; System.out.println("Value System.out.println("Val ue of age: " +age); } } Value of age: 20 20 Value of age: 8 Value of age: 1 10 0 (*)
Mark for Review (1) Points
Value Value Value Value Value Value Value Value Value
of of of of of of of of of
age: age: age: age: age: age: age: age: age:
20 2 0 28 28 38 38 20 20 208 208 20810 20810 20 20 8 9 Correct
9. Which is valid syntax to declare and initialize a String variable?
Mark for Review (1) Points
String “x” = “Java”; String x= “Java”; (*) String “x” = Java; String x = Java; Incorrect. Refer to Section 3 Lesson 1. 10. Identify the variable declared in the given code.
public class Welcome { public static void main(String args[]) { int a = 2; System.out.println("a is" + a); } } int a (*) 2 Welcome Incorrect. Refer to Section 3 Lesson 1. 11. Java is a strongly typed language; therefore you must declare a data type for all variables.
Mark for Review (1) Points
rue (*) False Correct
Mark for Review (1) Points
12. Identify the names of two variables used in the given code.
public class Variables { public static void main(String args[]) { String strVal = "Hello"; int intVal = 0; System.out.println("Integer: System.out.println("Intege r: " +intVal) } }
Mark for Review (1) Points
(Choose all correct answers) intVal (*) Hello String int strVal (*) Incorrect. Refer to Section 3 Lesson 1. 13. What is the output?
Mark for Review
public class Welcome { public static void main(String args[]) { System.out.println("This is my first program"); int a = 2; System.out.println("a is" + a); } }
(1) Points
a=2 his is my first program a is + a his is my first program his is my first program a is 2 (*) Incorrect. Refer to Section 3 Lesson 1. 14. Which two statements will not compile?
Mark for Review (1) Points
(Choose all correct answers) int break=10; (*) int abc = 10; int age=20; double double=10; (*) double salary = 20000.34 20000.34;; Incorrect. Refer to Section 3 Lesson 1. 15. Which two are valid?
Mark for Review (1) Points
(Choose all correct answers) double doubleVar1; doubleVar2 = 3.1. double doubleVar1 = 3.1; double doubleVar2 = 3.1; (*) double doubleVar1, double doubleVar2 = 3.1; double doubleVar1, doubleVar2 = 3.1; (*) Incorrect. Refer to Section 3 Lesson 1.