Object-Oriented Programming Concepts, Exams of Data Acquisition

A comprehensive review of the key concepts in object-oriented programming (oop), including classes, objects, methods, attributes, inheritance, encapsulation, and polymorphism. It covers true/false and multiple-choice questions that assess the understanding of these fundamental oop principles. Likely intended as a study guide or exam preparation material for a university-level course on management information systems or computer science, focusing on the object-oriented programming paradigm. The review covers topics such as the characteristics of objects, the structure and purpose of classes, the relationships between classes, the access modifiers for class members, and the differences between static and instance methods. By studying this document, students can deepen their understanding of the core oop concepts and be better prepared to apply them in programming assignments, projects, and exams.

Typology: Exams

2024/2025

Available from 10/10/2024

Prof_Goodluck
Prof_Goodluck 🇺🇸

4

(9)

2.6K documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MIS 505 Final Exam Review
Chapter 10: Object-Oriented Programming
TRUE/FALSE
1. Methods in object-oriented programs use sequence, selection, and looping structures and make use of
arrays.
ANS: T PTS: 1 REF: 408
2. In addition to their attributes, class objects have methods associated with them; every object that is an
instance of a class possesses different methods.
ANS: F PTS: 1 REF: 411
3. Within any object-oriented program, you continuously make requests to objects’ methods, often
including arguments as part of those requests.
ANS: T PTS: 1 REF: 411
4. Declaring a class does not create actual objects.
ANS: T PTS: 1 REF: 415
5. Class diagrams are a type of Unified Modeling Language (UML) diagram.
ANS: T PTS: 1 REF: 417
6. The accessor method is another name for the set method.
ANS: F PTS: 1 REF: 421
7. Object-oriented programmers usually specify that their data fields will have private access.
ANS: T PTS: 1 REF: 424
8. All methods require a this reference.
ANS: F PTS: 1 REF: 432
9. No object is necessary with a static method.
ANS: T PTS: 1 REF: 435
10. Methods in a class are static instance methods by default.
ANS: F PTS: 1 REF: 435
pf3
pf4
pf5
pf8

Partial preview of the text

Download Object-Oriented Programming Concepts and more Exams Data Acquisition in PDF only on Docsity!

MIS 505 Final Exam Review

Chapter 10: Object-Oriented Programming

TRUE/FALSE

  1. Methods in object-oriented programs use sequence, selection, and looping structures and make use of arrays.

ANS: T PTS: 1 REF: 408

  1. In addition to their attributes, class objects have methods associated with them; every object that is an instance of a class possesses different methods.

ANS: F PTS: 1 REF: 411

  1. Within any object-oriented program, you continuously make requests to objects’ methods, often including arguments as part of those requests.

ANS: T PTS: 1 REF: 411

  1. Declaring a class does not create actual objects.

ANS: T PTS: 1 REF: 415

  1. Class diagrams are a type of Unified Modeling Language (UML) diagram.

ANS: T PTS: 1 REF: 417

  1. The accessor method is another name for the set method.

ANS: F PTS: 1 REF: 421

  1. Object-oriented programmers usually specify that their data fields will have private access.

ANS: T PTS: 1 REF: 424

  1. All methods require a this reference.

ANS: F PTS: 1 REF: 432

  1. No object is necessary with a static method.

ANS: T PTS: 1 REF: 435

  1. Methods in a class are static instance methods by default.

ANS: F PTS: 1 REF: 435

MULTIPLE CHOICE

  1. ____ is a style of programming that focuses on an application’s data and the methods you need to manipulate that data. a. Classical programming c. Procedural programming b. Functional programming d. Object-oriented programming

ANS: D PTS: 1 REF: 408

  1. Object-oriented programmers sometimes say an object is one ____ of a class. a. enumeration c. member b. instantiation d. reference

ANS: B PTS: 1 REF: 408

  1. Objects both in the real world and in object-oriented programming contain ____ and methods. a. behaviors c. help b. attributes d. primitive data types

ANS: B PTS: 1 REF: 409

  1. ____ are the characteristics that define an object as part of a class. a. Instances c. Behaviors b. Attributes d. Methods

ANS: B PTS: 1 REF: 409

  1. When you think in an object-oriented manner, every object is a member of a ____. a. class c. method b. struct d. collection

ANS: A PTS: 1 REF: 410

  1. Object-oriented programmers also use the term ____ when describing inheritance. a. has-a c. is-a b. from-a d. contains

ANS: C PTS: 1 REF: 410

  1. The concept of a class is useful because of its ____. a. reusability c. abstract nature b. mapping to reality d. portability

ANS: A PTS: 1 REF: 410

  1. Object attributes are often called ____ to help distinguish them from other variables you might use. a. rows c. columns b. records d. fields

ANS: D PTS: 1 REF: 411

  1. The data components of a class that belong to every instantiated object are the class’s ____. a. numeric variables c. instance variables b. string variables d. data variables

ANS: C PTS: 1 REF: 411

a. get method c. pull method b. set method d. access method

ANS: A PTS: 1 REF: 421

  1. A ____ method is also known as a help method. a. work c. public b. private d. set

ANS: A PTS: 1 REF: 422

  1. A(n) ____ is the adjective defining the type of access (public or private) that outside classes will have to the attribute or method. a. control specifier c. access specifier b. control modifier d. access controller

ANS: C PTS: 1 REF: 424

  1. In a class method, the ____ reference can be used only with identifiers that are field names. a. my^ c. that b. this^ d. me

ANS: B PTS: 1 REF: 433

  1. ____ methods are those for which no object needs to exist. a. Dynamic c. Static b. Public d. Private

ANS: C PTS: 1 REF: 435

  1. ____ methods are methods that exist to be used with an object created from a class. a. Nonstatic c. Hidden b. Static d. Controlled

ANS: A PTS: 1 REF: 435

  1. In most programming languages, you use the word ____ when you want to declare a static class member. a. private c. public b. friend^ d. static

ANS: D PTS: 1 REF: 435

COMPLETION

  1. A(n) ____________________ is one instance of a class.

ANS: object

PTS: 1 REF: 408

  1. When you think in an object-oriented manner, everything is a(n) ____________________.

ANS: object

PTS: 1 REF: 410

  1. When you program in object-oriented languages, you frequently create ____________________ from which objects will be instantiated.

ANS: classes

PTS: 1 REF: 411

  1. With object-oriented programming, you focus on the ____________________ that will be manipulated by the program.

ANS: objects object

PTS: 1 REF: 408

  1. Any time a local variable in a method has the same identifier as a class field, the class field is ____________________.

ANS: hidden

PTS: 1 REF: 434

MATCHING

Match each term with a statement below. a. instance variables f. state b. class client g. polymorphism c. inheritance h. attributes d. class i. encapsulation e. information hiding j. object

  1. Describes a group or collection of objects with common attributes
  2. An instance of a class
  3. The characteristics that define an object as part of a class
  4. The data components of a class that belong to every instantiated object
  5. The set of all the values or contents of a class object’s instance variables
  6. A program or class that instantiates objects of another prewritten class
  7. Multiple methods with the same name, which will act differently and appropriately when used with different types
  8. The process of acquiring the traits of one’s predecessors
  9. The process of combining all of an object’s attributes and methods into a single package
  10. The concept that other classes should not alter an object’s attributes—only the methods of an object’s own class should have that privilege
  11. ANS: D PTS: 1 REF: 408
  12. ANS: J PTS: 1 REF: 408
  13. ANS: H PTS: 1 REF: 409
  14. ANS: A PTS: 1 REF: 411
  15. ANS: F PTS: 1 REF: 411

Outside classes should only be allowed to make a request that an attribute be altered; then it is up to the class’s methods to determine whether the request is appropriate. When using a door, you usually are unconcerned with the latch or hinge construction features, and you don’t have access to the interior workings of the knob or know what color of paint might have been used on the inside of the door panel. You care only about the functionality and the interface, the user-friendly boundary between the user and internal mechanisms of the device. Similarly, the detailed workings of objects you create within object-oriented programs can be hidden from outside programs and modules if you want them to be. When the details are hidden, programmers can focus on the functionality and the interface, as people do with real-life objects.

PTS: 1 REF: 414 TOP: Critical Thinking

  1. List the three parts of a class definition.

ANS: A class definition can contain three parts:

  • Every class has a name.
  • Most classes contain data, although this is not required.
  • Most classes contain methods, although this is not required.

PTS: 1 REF: 415 TOP: Critical Thinking

  1. Describe what class diagrams list by convention.

ANS: By convention, a class diagram lists the names of the data items first. Each name is followed by a colon and the data type. Similarly, method names are followed by their data types. Listing the names first emphasizes the purposes of the fields and methods more than their types.

PTS: 1 REF: 417 TOP: Critical Thinking

  1. Explain what private access means in object-oriented programming.

ANS: Object-oriented programmers usually specify that their data fields will have private access—that is, the data cannot be accessed by any method that is not part of the class.

PTS: 1 REF: 424 TOP: Critical Thinking

  1. List the two identifiers within a method that always mean exactly the same thing when you write an instance method in a class.

ANS: When you write an instance method in a class, the following two identifiers within the method always mean exactly the same thing:

  • any field name defined in the class
  • this, followed by a dot, followed by the same field name

PTS: 1 REF: 432 TOP: Critical Thinking

  1. Describe what happens any time a local variable in a method has the same identifier as a class field.

ANS:

Any time a local variable in a method has the same identifier as a class field, the class field is hidden. This applies whether the local variable is a passed parameter or simply one that is declared within the method. In these cases, you must use a this reference to refer to the class field.

PTS: 1 REF: 434 TOP: Critical Thinking

  1. Discuss nonstatic methods.

ANS: Nonstatic methods are methods that exist to be used with an object. These instance methods receive a this reference to a specific object. In most programming languages, you use the word static when you want to declare a static class member, but you do not use a special word when you want a class member to be nonstatic. In other words, methods in a class are nonstatic instance methods by default.

PTS: 1 REF: 435 TOP: Critical Thinking