Quiz 2

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

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, Develop , Requirements, Test

Requirements, Design, Test, Develop

Requirements, Design, Develop, Test (*)

Design, Requirements, Develop, Test

Correct Correct

2. If the requirement step of the Spiral Model of development is


forgotten, which of the following could occur? Mark for Review
(1) Points

Code becomes messy.

Required software features are missing from the program. (*)

Solutions seem elusive.

The Program gives inaccurate results.

Correct Correct

3. Which of the following are adequate definitions for components of


the Spiral Model of Development? Mark for Review
(1) Points

(Choose all correct answers)

Requirements: Start the development

Test: Run the code and verify results (*)

Develop: Collect all specified instructions


Design: Plan the approach (*)

Correct Correct

4. The Spiral Model reflects an iterative development process. Mark


for Review
(1) Points

True (*)

False

Correct Correct

5. Which of the following language is called a procedural language?


Mark for Review
(1) Points

Java C

C++

Java

C (*)

Correct Correct
6. In object oriented programming, an object comprises of properties and
behaviors where properties represented as fields of the object and behavior is
represented as method. Mark for Review
(1) Points

True (*)

False

Correct Correct
7. In the code example below, identify any methods:

public class Employee {


public String name = " Duke";
public int empId = 12105;
public float salary;

public void displaySalary(){


System.out.println("Employee Salary: "+salary);
}
} Mark for Review
(1) Points

name

salary

empId

displaySalary() (*)

Correct Correct

8. An object may interact with another object by invoking methods.


Mark for Review
(1) Points

True (*)

False

Correct Correct

9. 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 by classes and instances?
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. (*)
Rose plant is the object and samples are not instances of the plant because
they have not grown yet.

Samples of the rose plant are called classes and not the actual rose plant.

Incorrect Incorrect. Refer to Section 2 Lesson 3.

10. Java mostly reads code line-by-line. Mark for Review


(1) Points

True (*)

False

Correct Correct
11. 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.

Provide an explanation about the code to the programmer. (*)

To provide better security to the program.

Correct Correct

12. Code within curly braces is called a �Block of code�. Mark for
Review
(1) Points

True (*)

False

Incorrect Incorrect. Refer to Section 2 Lesson 2.

13. You can set any number of breakpoints for your program. Mark
for Review
(1) Points

True (*)

False

Correct Correct

14. Which of the following are considered Whitespace? Mark for


Review
(1) Points

(Choose all correct answers)

Space between the [ ] braces.

Blank lines in the code. (*)

Space between words. (*)

Space in the print statements.

Indentation before the code. (*)

Incorrect Incorrect. Refer to Section 2 Lesson 2.

15. Which of the following 2 statements are true about whitespace?


Mark for Review
(1) Points

(Choose all correct answers)

Whitespace reduces the performance of the program.

Whitespace increases execution time of your program.

Whitespace eliminates typing mistakes while programming.

Whitespace helps to keep your code organized. (*)


Whitespace makes your code more readable. (*)

Correct Correct

You might also like