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...
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.
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.
*OBJECT ORIENTED PROGRAMMING* GOAL: will be able to throw and catch exceptions and create multi-threaded programs....
*OBJECT ORIENTED 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 a false....
Throughout this course, you will be learning about object-oriented programming and demonstrating what you learn by...
Throughout this course, you will be learning about object-oriented programming and demonstrating what you learn by writing some programs in Java. The first step will be to install and integrated development environment (IDE) that will be where you will write and compile your programs. You will also write your first program using Java to show that you have correctly installed the IDE. The project instructions and deliverables are as follows: Download and install Java JDK and NetBeans IDE using the...
Kindly Do the program in C++ language Object Oriented Programming. Objectives  Implement a simple class...
Kindly Do the program in C++ language Object Oriented Programming. Objectives  Implement a simple class with public and private members and multiple constructors.  Gain a better understanding of the building and using of classes and objects.  Practice problem solving using OOP. Overview You will implement a date and day of week calculator for the SELECTED calendar year. The calculator repeatedly reads in three numbers from the standard input that are interpreted as month, day of month, days...
What is different between procedural and object-oriented programming? Match each of the following OOP concepts with...
What is different between procedural and object-oriented programming? Match each of the following OOP concepts with its example/description. Question 2 options: 12345678 Providing a way for an entity to behave in several ways OR providing multiple entities to be treated in a similar way 12345678 A key way of saving having to retype a lot of code for similar but different objects 12345678 The removal of non-essential information 12345678 Allowing which function to be called by an object to be...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT