Question

In: Computer Science

1. In Object Oriented Programming The private object fields can be directly manipulated by outside entities....

1. In Object Oriented Programming The private object fields can be directly manipulated by outside entities.
Group of answer choices

A. True

B. False

2. __________ programming is centered on the procedures or actions that take place in a program.
Group of answer choices

A. Class

B. Object-oriented

C. Menu-driven

D. Procedural/ Structural

3. __________ programming encapsulates data and functions in an object.
Group of answer choices

A. Object-oriented

B. Class

C. Menu-driven

D. Procedural

4. The data in an array can be sorted in either ascending or descending order.
Group of answer choices

A. True

B. False

5. Which of the following statements is true after the following statements are executed?


Set t = x
Set x = y
Set y = t

Group of answer choices:

A. y contains the value in x and x stayed the same

B. x contains the value in y and y stayed the same.

C. x and y contain their original values.

D. x and y have swapped their values.

6. Given the following statement, what is the subscript for the data value 92?
Declare Integer numbers[5] = 83,92,78,94,61
Group of answer choices

A. 2

B. 0

C. 92

D. 1

7. What is the term used for the number inside the brackets of an array that specifies how many values the array can hold?
Group of answer choices

A. size declarator

B. size initialization

C. number declarator

D. subscript declarator

8.When a function finishes executing, it returns a value back to the part of the program that called it.

Group of answer choices:

A. True

B. False

9. The following pseudocode is for a loop that will perform three iterations.

For start = 5 To 10 Step 2
Do something
End For
Group of answer choices

A. True

B. False

10.   If an expression is False, the __________ operator will return True.
Group of answer choices

A. All are unary operators

B. ! (NOT)

C. OR

D. AND

11. How many times would the following loop iterate?
Set k = 1
While k > 5
Display k
End While
Group of answer choices

A. infinite

B. 4

C. 0

D. 5

12. A structure that has a loop inside another loop is called a(n) __________ loop.   

13. What does the following expression evaluate to, given that a = 3 and b = 6?
(a != b) AND (b > a)
Group of answer choices

A. True

B. False

C. NOT

D. cannot tell

14. Given the following pseudocode, what would display if this pseudocode was coded and executed, given that examGrade = 93 and homeworkGrade = 87?
If examGrade >= 90 AND homeworkGrade >= 90 Then
Display "You are doing very well!"
Else If examGrade < 90 AND homeworkGrade >= 90 Then
Display "Study harder for the next exam."
Else If examGrade >= 90 AND homeworkGrade < 90 Then
Display "See me for help with homework."
Else
Display "Let's talk about your grades."
End If
Group of answer choices

A. See me for help with homework.

B. You are doing very well!

C. Let's talk about your grades.

D. Study harder for the next exam

15. When a variable is passed by reference to a module, changes to the value of the argument in the module will also affect the variable in the part of the program that sent that argument.

Group of answer choices

A. True

C. False

16. Given the following pseudocode, what is the value of myGrade after the call to the curveScore module?
Module main()
Declare Integer myGrade
Set myGrade = 82
Call curveScore(myGrade)
End Module
Module curveScore(Integer score)
Declare Integer newScore
Set newScore = score + 5
Display newScore
End Module
Group of answer choices :

A. 87

B. can not tell

C. 82

D. 5

17. A(n) __________ constant is a named constant that is available to every module in the program.

18. The following two expressions will always yield identical results:
(a + b) / c
a + b / c
Group of answer choices

A.True

B. False

19. Which of the following error types produces incorrect results but does not prevent the program from running?
Group of answer choices

A. logic

B. syntax

C. grammar

D. human

20. What is the error in the following pseudocode?
Display "What is your name?"
Input userName
Declare String userName
Group of answer choices :

A. There is no error.

B. userName is an invalid variable name

C. The Input statement should be the first statement.

D. userName has been used before it is declared

Solutions

Expert Solution

Solution:

1)

False

Explanation:

The object fields which are given the access specifier as private will only be accessible from within the class.

2)

D. Procedural/ Structural

Explanation:

Procedural/ Structural programming mainly focuses on procedures and structures which are defined in it.

3)

Object-oriented
Explanation:

Object-oriented programming focusses on bundling the attributes and behavior of an object so that it can be defined completely.

4)

True

Explanation:

Any of the sorting algorithms can be used to sort the elements in the array.

5)

x and y have swapped their values.

Explanation:

The logic is to swap the values of x and y.

6)

D. 1

Explanation:

83,92,78,94,61

will be stored in the array as

0 1 2 3 4
83 92 78 94 61

we can see that 92 at index 1.

7)

B. size initialization

8)

True

Explanation:

The objective to call a method is to get the value which is being calculated through it.

9)

false

Explanation:

The loop is performing 5 iterations.

10)

B. ! (NOT)

11)

C. 0

Explanation:

The loop will terminate as the first condition will be false.

12)

Nested

13)

(a != b) AND (b > a)

will be evaluated as

(3 != 6) AND (6 > 3)

True AND True= True

The answer is true.

14)

See me for help with homework.

15)

True

16)

A. 87

17)

global

18)

False

19)

A. logic

20)

B. userName is an invalid variable name

Explanation:

This error is for the second declaration of userName.

Hit the thumbs up if you liked the answer. :)


Related Solutions

-What is object-oriented programming? -What is a class? -What is an object? -A contractor uses a...
-What is object-oriented programming? -What is a class? -What is an object? -A contractor uses a blueprint to build a set of identical houses. Are classes analogous to the blueprint or the houses? Explain. -What is a class diagram? How is it used in object-oriented programming? -What is an attribute in OOP? What is a data member? -What is a method in OOP? What is a member function? -What is the difference between private members and public members of a...
Briefly explain the terms used in object-oriented programming with examples.
Briefly explain the terms used in object-oriented programming with examples.
*OBJECT ORIENTED PROGRAMMING* JAVA PROGRAMMING GOAL: will be able to throw and catch exceptions and create...
*OBJECT ORIENTED PROGRAMMING* JAVA PROGRAMMING GOAL: will be able to throw and catch exceptions and create multi-threaded programs. Part I Create a class called Animal that implements the Runnable interface. In the main method create 2 instances of the Animal class, one called rabbit and one called turtle. Make them "user" threads, as opposed to daemon threads. Some detail about the Animal class. It has instance variables, name, position, speed, and restMax. It has a static boolean winner. It starts...
Why is it more feasible to use Objects and object oriented programming as compared to using...
Why is it more feasible to use Objects and object oriented programming as compared to using method based programs? What are the disadvantages of using only methods in your programs.
Explain what classes and objects are in object - oriented programming. Give an example of each...
Explain what classes and objects are in object - oriented programming. Give an example of each and explain how they work together in a computer program.
In Object Oriented programming C++ : Write the appropriate functions for Student to neatly display a...
In Object Oriented programming C++ : Write the appropriate functions for Student to neatly display a Student, and then finally GPA. Have items neatly line up in columns. I need help creating a derived class called student that finds GPA (between 0.0 and 4.0) and credits completed (between 0 and 199).
This week, you will create and implement an object-oriented programming design for your project. You will...
This week, you will create and implement an object-oriented programming design for your project. You will learn to identify and describe the classes, their attributes and operations, as well as the relations between the classes. Create class diagrams using Visual Studio. Review the How to: Add class diagrams to projects (Links to an external site.) page from Microsoft’s website; it will tell you how to install it. Submit a screen shot from Visual Studio with your explanation into a Word...
In this assignment, you will practice solving a problem using object-oriented programming and specifically, you will...
In this assignment, you will practice solving a problem using object-oriented programming and specifically, you will use the concept of object aggregation (i.e., has-a relationship between objects). You will implement a Java application, called MovieApplication that could be used in the movie industry. You are asked to implement three classes: Movie, Distributor, and MovieDriver. Each of these classes is described below. The Movie class represents a movie and has the following attributes: name (of type String), directorsName (of type String),...
Research and explain in your words what is known as Object Oriented Programming. Then, identify two...
Research and explain in your words what is known as Object Oriented Programming. Then, identify two advantages of OOP for application development. In peer replies, choose from one of the following and define the concept as part of your response. Abstraction. Encapsulation. Inheritance. Polymorphism.
Using the various Object Oriented Programming concepts and skills learnt in this course, design and develop...
Using the various Object Oriented Programming concepts and skills learnt in this course, design and develop a Java Application to compute an individual student’s GPA and store the records in a database. The application should have two components i.e. The student and the course components. The following should be the minimal operations on the course component: – Set course information – Print course information – Show credit hours – Show course number The following should be the minimal operations on...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT