Java Section 2 Quiz
Which of the following are adequate definitions for components of the Spiral Model of Development?
Design: Plan the approach Test: Run the code and verify results
During the Design phase of software development, the programmer implements features gathered during the Requirement phase.
False
In object oriented programming, there is an emphasis on which of the following two:
Modeling objects. Object interaction without a prescribed order.
What is the purpose of adding comments in the code?
Provide an explanation about the code to the programmer.
If the requirement step of the Spiral Model of development is forgotten, which of the following could occur?
Required software features are missing from the program.
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?
Rose plant is the class and the samples generated from the rose plant are instances of that class. (*)
Which of the following three statements are true about breakpoint?
They help with debugging. They pause code execution. They can be used to check the current state of the program
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); } }
displaySalary()
Which of the following are considered Whitespace?
1. Indentation before the code 2. Space between words. 3. Blank lines in the code.
When the program runs normally (when not in debug mode), which statement is true about breakpoints?
Breakpoints will not have any effect on program execution.
Which of the following language is called a procedural language?
C
A Java program can be written in the single line.
True
A software feature may allow the user to perform a specific task.
True
An object may interact with another object by invoking methods.
True
Code within curly braces is called a "Block of code".
True
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.
True
Java mostly reads code line-by-line.
True
The Spiral Model reflects an iterative development process.
True
You'd like to see a movie with a few friends. You write an email to confirm plans.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.Would any of you be interested in going?Which of the following are requirements for this plan?
Watch "Attack of the Duke!" on Friday at Oracle Cinema at 4:30 PM.
You design a Circle class with various fields and methods. Which of the following could be fields in this class? Distinguish which of these are between the properties and behavior.
color radius
There are several fields and methods in a Shirt class. Which of the following could be a method in the Shirt class?
getShirtSize()