CS1410 Flashcards

1
Q

Object-Oriented Programming (OOP) - Chptr 1

A

Offers a new and powerful way to cope wiht complexity. Instead of viewing a program as a series of steps to be carried out, it views it as a group of objects that have certain properties and can take certain actions. Resulting in programs that are clearer, more relieable, and more easily maintained.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Unified Modeling Language (UML) - Chptr 1

A

A graphical language consisting of many kinds of diagrams. It helps program analysts figure out what a program should do, and helps programmers design and understand how a program works. The UML is a powerful tool that can make programming easier and more effective.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

ANSI - Chptr 1

A

American National Standards Institute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

ISO - Chptr 1

A

International Standards Institute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Member Functions (Methodes in other Languages) - Chptr 1

A

An Object’s functions and typically are the only way to access its data. If you want to modify the data in an object, you know exactly what functions interact with it: the member function in the object. No other functions can access the data. This simplifies writing, debugging, and maintaining the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Data Encapsulation and Data Hidding - Chptr 1

A

If you want to read a date item in an object, you call a member function in the object. It will access the date and return the value to you. You can’t access the data directly. The Data is hidden, so its safe from accidental alteration. Data and its functions are said to be encapsulated into a single entity. Date encapsulation and data hiding are key terms in the description of object-oriented languages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Terms in OOP - Chptr 1

A

Data items are referred to as attributes or instance vairables. Calling an object’s member function is referred to as sending a message to the object. These terms are not official C++ terminology, but they are used with frequency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

An Analogy of OOP - Chptr 1

A

You might want to think of objects as departments such as sales, accounting, personnel, and so on in a company. Departments provide an important approach to corporate organization. In most companies, people don’t work on personnel problems on day, the payroll the next, and then go out in the field as a salesperson the week after. Each department has its own personnel, with clearly assigned duties. It also has it’s own data: the accounting department has payroll figures, the sales department has sales figures, the personnel department keeps records of each employee and so on.

The people in each department control and operate on that department’s data. Dividing the company into departments makes it easier to comprehend and control the company’s activities, and helps maintain integrity of the information used by the company. The accounting department, for instance, is repsonsible for the payroll data. If you’re a sales manager, and you need to know the total of all the salaries paid in the southern region in July, you don’t just walk into the accounting department and start rummaging through file cabinets. You send a memo to the appropriate person in the department, then wait for that person to access the data and send you a reply with information you want. This ensures that the data is accessed accurately and that it is not corrupted by inept outsiders. In the same way, objects provide an approach to program organization while helping to maintain the integrity of the program’s data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Classes - Chptr 1

A

In OOP we say that objects are members or classes. What doe this mean? Lets look at an analogy. Almost all computer languages have built-in data types. For instances, a data type int, meaning interger, is predifined in C++. You can declare as many variables of type int as you need in your program.

int day;
int count;
int divisor;
int answer;

In a similary way, you can defined many objects of the same class. A class serves as a plan, or blueprint. It specifies what data and what functions will be incluced in objects of that class. Defining the class doesn’t create any objects, just as teh mere existence of data type int doesn’t create any variables.

A class is thus a description of a number of similar objects. This fits our non-technical understanding of the word class. Prince, Sting, and Madonna are members of the rock musician class. There is no one person called “rock musician,” but specific people with specific names are members of this class if they possess certain characteristics. An object is often called an “instance” of a class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Inheritance - Chptr 1

A

The idea of classes leads to the idea of inheritance. In our daily lives, we use the concept of classes divided into subclasses. We know that the animal class is divided into mammals, amphibians, insects, birds and so on. The vehicle class is divided into cars, trucks, buses, motorcycles and so on. The principle in this sort of division is that each subclass shares common characteristics with the calls from which it’s derived. Cars, trucks, buses, and motorcycles all have wheels and a motor; these are defining characteristics of vehicles. In addition to the characteristics shared with other members of the class, each subclass also has it’s own particutlar characteristics: Buses, for instance, have seats for many people, while trucks have space for hauling heavy loads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Base Class and Derived Class - Chptr 1

A

An OOP class can become a parent of several subclasses. In C++ the original class is called the base class; other classes can be defined that share its characteristics, but add their own as well. These are called derived classes.

Don’t confuse the relation of objects to classes, on the one hand, with the relation of a base class to derived classes, on the other. Objects, which exist in a computer’s memory, each embody the exact characteristics of their class, which serves as a template. Derived classes inherit some characteristics form their base class, but add new ones of their own.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Chapter 1 Summary

A

OOP is a way of organizing programs. The emphasis is on the way programs are designed, not on coding details. In particular, OOP programs are organized around objects, which contain both data and functions that act on that data. A class is a template for a number of objects.

Inheritance allows a class to be derived from an existing class without modifying it. The derived class has all the data and functions of the parent class, but adds new ones of its own. Inheritances makes possible reusability, or using a class over and over in different programs.

The Unified Markup Language (UML) is a standardized way to visualize a program’s structure and operation using diagrams.

The general concepts discussed in this chapter will become more concrete as you learn more about the details of C++. You may want to refer back to this chapter as your progress further into this book.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly