97.0k views
4 votes
What type of programming encapsulates data and functions together in an object?

A.
Object-oriented.

B.
Interactive.

C.
Procedural.

D.
Menu-driven.

E.
None of the above.

2.5 points

QUESTION 2

What software entity contains both data and procedures?

A.
Objects.

B.
Instances.

C.
Events.

D.
Memory location(s).

E.
None of the above.

2.5 points

QUESTION 3

The variables, arrays, or other data structures that are stored in the object are known as the object’s __________.

A.
Records.

B.
Methods.

C.
Addresses.

D.
Fields.

E.
None of the above.

2.5 points

QUESTION 4

The procedures that the object performs are known as ____________.

A.
Records.

B.
Methods.

C.
Addresses.

D.
fields.

E.
None of the above.

2.5 points

QUESTION 5

The programmer determines the fields and methods of an object and creates the ______ code.

A.
Print.

B.
Class.

C.
Module.

D.
Procedure.

E.
None of the above.

2.5 points

QUESTION 6

The class _________ starts with the word Class followed by the name of the class.

A.
body.

B.
definition.

C.
return.

D.
members.

E.
None of the above.

2.5 points

QUESTION 7

What is the term used for the fields and methods that belong to a class?

A.
body.

B.
definition.

C.
return.

D.
members.

E.
None of the above.

2.5 points

QUESTION 8

The word Private that appears before a field declaration, in a class definition, is known as a(n) ____________.

A.
access specifier.

B.
specifier.

C.
Class specifier.

D.
Inside specifier.

E.
None of the above.

2.5 points

QUESTION 9

The mutator methods are sometimes called _________________.

A.
getters.

B.
accessors.

C.
setters.

D.
private.

E.
None of the above.

2.5 points

QUESTION 10

What allows you to create methods with the same name in different classes and gives you the ability to call the correct method depending on the type of object that is used to call it?

A.
Constructor.

B.
Inheritance.

C.
Accessor.

D.
Polymorphism.

E.
None of the above.

2.5 points

QUESTION 11

________________________ is a standard way of drawing diagrams that describe object-oriented systems.

A.
Data flow diagram.

B.
UML.

C.
flowchart.

D.
Hierarchy chart.

E.
None of the above.

2.5 points

QUESTION 12

_______________ is another name for accessor methods.

A.
getters.

B.
accessors.

C.
setters.

D.
private.

E.
None of the above.

2.5 points

QUESTION 13

Which method is called automatically when an object is created?

A.
design.

B.
public.

C.
private.

D.
constructor.

E.
None of the above.

2.5 points

QUESTION 14

____________________ allows a new class to extend an existing class.

A.
successor.

B.
accessor.

C.
inheritance.

D.
public.

E.
None of the above.

2.5 points

QUESTION 15

Which of the following tasks are performed by a procedure?

A.
Reading a file.

B.
Gathering input.

C.
Displaying output.

D.
All of the above.

E.
None of the above.

2.5 points

QUESTION 16

Which of the following are contained in a UML diagram for a class?

A.
Class name.

B.
Class fields.

C.
Class methods.

D.
All of the above.

E.
None of the above.

2.5 points

QUESTION 17

In a UML diagram what character do you place in front of a field of method name to indicate it is public?

A.
+.

B.
=.

C.
P.

D.
-.

E.
None of the above.

2.5 points

QUESTION 18

The act of declaring a class variable does not actually create an object in memory.

True

False

2.5 points

QUESTION 19

If a constructor is not written when the class is compiled, then a constructor is automatically provided and it is known as the default constructor.

True

False

2.5 points

QUESTION 20

When a superclass method has the same name as a subclass method, it is often said that the superclass method overrides the subclass method.

True

False

2.5 points

QUESTION 21

External entities do not have direct access to the object’s private methods.

True

False

2.5 points

QUESTION 22

When the program is running, it can use the class to create, in memory, one object of a specific type as needed.

True

False

2.5 points

QUESTION 23

The private object fields can be directly manipulated by outside entities.

True

False

2.5 points

QUESTION 24

When a class variable is assigned the address of an object, it is said that the variable references the object.

True

False

2.5 points

QUESTION 25

In an inheritance relationship, the superclass inherits members from the subclass, not the other way around.

True

False

2.5 points

QUESTION 26

When an object’s internal data is hidden from outside code and access to the data is restricted to the object’s methods, the data is protected from accidental corruption.

True

False

2.5 points

QUESTION 27

There are primarily three methods of programming in use today: procedural, recursive, and object-oriented.

True

False

2.5 points

QUESTION 28

The separation of data and the code that operates on the data can lead to problems as a program becomes larger and more complex.

True

False

User Ben Duffin
by
5.7k points

1 Answer

4 votes

Following are given answers to each question, one by one:

Answer 1:

Option A: Object-Oriented

In object oriented programming, data and functions are encapsulated together in an object. The functions or methods take data as arguments and operate on them.

Answer 2:

Option A: Objects

An Object is a basic unit of Object Oriented Programming. It is basically an entity or component of a program that has information for interacting with other elements. It tells us that how specific actions will be performed. It contains both data and procedures.

Answer 3:

Option D: Fields

The variables, arrays, or other data structures that are stored in the object are known as the object’s Fields. Fields can be private or public depending on the fact that where they are declared.

Answer 4:

Option B: Methods

The procedures that the object performs are known as Methods. It can be defined as a process that is associated or linked with a class. They are the actions or behavior of an object defined or a class.

Answer 5:

Option B: Class

The programmer determines the fields and methods of an object and creates the Class code. While in Object oriented programming, a class can be named as a blueprint that provides initial values such as variables and attributes and member and unctions in order to create objects.

Answer 6:

Option B: definition

The class definition starts with the word Class followed by the name of the class. So, "class" is actually a keyword used for creating a class.

Answer 7:

Option D: members

The term used or the fields and methods that belong to a class is members.

Answer 8:

Option A: access specifier

The word Private that appears before a field declaration, in a class definition, is known as a(n) access specifier. It tell the scope of the field. This mean that where can it be used and where can not be used.

Answer 9:

Option B: is the correct answer.

The mutator methods are sometimes called accessors.

Answer 10:

Option D: Polymorphism

Polymorphism is a process that allows you to create methods with the same name in different classes and gives you the ability to call the correct method depending on the type of object that is used to call it.

Answer 11:

Option B: UML

UML is a standard way of drawing diagrams that describe object-oriented systems. UML stands or Unified Modeling Language. It presents a visual representation of objects, fields, states by integrated diagrams.

Answer 12:

Option A: getter

Getters is another name for accessor methods. Accessor methods are defined above.

Answer 13:

Option D: Constructor

Constructor method is called automatically when an object is created.

Answer 14:

Option C: Inheritance

Inheritance allows a new class to extend an existing class. It is a process in which a class or object is implemented on another class or object.

Answer 15:

Option D: All of above.

A procedure can:

  • Read a file.
  • Gathers input.
  • Displays output.

Answer 16:

Option D: All of above.

A UML diagram of a class contains:

  • Class name.
  • Class fields.
  • Class methods.

Answer 17:

Option A: +

In a UML diagram a plus "+" character is placed in front of a field of method name to indicate it is public.

Answer 18:

True

Answer 19:

True

When a constructor is not declared, it will be created by default by the compiler.

Answer 20:

True

It is the definition of over riding.

Answer 21:

True

Private methods have less scope than public ones so they cant be accessed by external entities.

Answer 22:

True

Answer 23:

False

Manipulation of private methods cannot be done directly.

Answer 24:

True

Answer 25:

False

Sub class is always inherited by the main class. This phenomenon can't be reversed

Answer 26:

True

Security is provided by hiding data.

Answer 27:

False

Basically two programming methods are used today, that are:

  • procedural
  • object oriented.

Answer 28:

True

Due to isolation of programs data and the code that is performed on the data, the procedural program gets larger and complex.

I hope it will help you!

User Buzz Lightyear
by
5.6k points