CIS 247C All Quizzes

$22.00

CIS 247C All Quizzes
(TCO 2) Object-oriented classes should be designed with the concept of a black box in mind…

SKU: CIS 247C All Quizzes Categories: , Tags: , , , ,

Description

CIS 247C All Quizzes

CIS 247C All Quizzes

Quiz Week 1 

https://www.hiqualitytutorials.com/product/cis247c-quiz-week-1/

(TCO 1) Which of the following would be a more appropriate choice for a method in a Fork class?

Color()

Bend()

Eat()

Material()

(TCO 1) By default, a class does not have the property of _____.

Encapsulating data

Information hiding

Containing both data members and member methods

Knowing how other classes are implemented

(TCO 1) Which of the following statements is/are true?

  1. A class is necessary to be defined before you can create an object.
  2. The specific values of the attributes of an object represent the state of the object.
  3. An interface of a class defines what messages an object can respond to.
  4. Objects communicate through message passing.

All are true

Only A, B, and D are true

None are true

(TCO 1) _____ is the process of identifying important attributes and behaviors of an object.

Class

Abstraction

Coding

All of the above

None of the above

(TCO 1) Which of the following would be a more appropriate choice for a data member in a TextBox class?

Resize

Show

Font Color

Write

(TCO 1) Examine the ClockType class definition. How many class members does it contain?
class ClockType
{
public:
void setTime(int, int, int);
int getTime();
void printTime();
void icrementSeconds();
private:
int hr;
int min;
int sec;
}

7

3

10

4

An average of 5 because (7+3)/2=5

(TCO 8) Most professional coding standards use _____ for class and method names.

Underscores along with all upper case words

Method Class case

No specific naming convention

Pascal case

(TCO 1) Inheritance is referred to as a(n) _____ relationship, while composition is referred to as a(n) _____ relationship.

Superclass-subclass; friend

Is-a; Has-a

Has-a; Is-a

None of the above

(TCO 1) Assume we have two classes and have instantiated two objects from each class. How many copies of each class’s attributes and methods exist in the instantiated objects?

Two copies, one copy of the first class and one of the second; objects always share attributes and methods

Zero, the objects do not have attributes and methods

Four copies, two copies of the first class and two of the second

Eight copies

(TCO 1) By default, all members of a class are _____.

Public

Private

Protected

Internal

Unfriendly

CIS 247C All Quizzes

Quiz Week 2

https://www.hiqualitytutorials.com/product/cis247c-quiz-week-2/

(TCO 2) Getters and setters are sometimes called _____ methods and _____ methods, respectively.

mutator; accessor

accessor; mutator

retrieval; putter

None of the above

(TCO 2) Only those class members that are presented to the users of the class are part of the ______ of the class.

Interface

Implementation

Constructors

Superclass

(TCO 2) A Waiter is responsible for taking the order from the Customer, informing the Chef of the order and delivering the requested food back to the Customer. A Chef is responsible for preparing the food and notifying the Waiter when the food is ready. The Customer is responsible for placing an order from the menu. In identifying the interface of the Chef object, which of the following would you consider as (an) appropriate message(s) the Chef should respond to?

“Take a pound of ground meat, add a chopped onion, salt, pepper, parsley and broil for 15 minutes until the burger becomes golden brown.”

“What do you do after work?”

“Prepare a steak, medium-rare.”

All of the above

Only A and C

(TCO 2) Which of the following statements is/are false?

If a method is public, it is considered part of the class interface.

One goal regarding the implementation of a class should be kept in mind: a change to the implementation should not require a change to the user’s code.

If you declare an attribute as public, you do not have to worry about tracking down every piece of code that might have changed the attribute when debugging.

All of the above

None of the above

(TCO 5) One of the purposes of a(n) _____ is to release resources back to the system when the object is not used anymore.

Class

Constructor

Destructor

Instance variable

(TCO 5) Consider the following class definition.
class Flower
{
private:
string color;
double cost;

public:
Flower()
{
color = “red”;
cost = 0.0;
}
Flower(string c)
{
color = c;
cost = 0.0;
}

void setColor(string c)
{
color = c;
}
void setCost(int amount)
{
cost = amount;
}
}

Which of the following is/are true?

(i) The attribute cost can be set to a new value, by a user
of this class
(ii) You can write cout<<”The flower is: “ << Flower.setColor();
(iii) A default constructor is provided.

I

Ii

Only I and iii

None are true

All are true

(TCO 5) Which of the following method pairs depict method overloading?

public void Roll() ; public int Roll(int x)

public int Reverse(int x, int y) ; public int Reverse(int y, int x)

public int Subtract(int x, int y) ; public int Subtract(int x, int y, int z)

All of the above

Only A and C

(TCO 5) Which error handling technique is the least appropriate when developing an application?

Check for potential problems and abort the application when a problem is encountered.

Check for potential problems and throw an exception.

Check for potential problems, catch the mistake, and try to fix it.

Ignore the problem; all applications crash at some point.

(TCO 2) Assume a class contains two non-static data members and one static data member. If two objects have been instantiated from the class, how many copies of the static data member exist?

3

6

2

1

(TCO 2) Can two methods each define a local variable with the same name?

Yes, as long as the variable is used in the same way.

No, this is not possible because the compiler would not know which variable to use.

Yes, but only if the methods have the same name.

None of the above

CIS 247C All Quizzes

Quiz Week 3 

https://www.hiqualitytutorials.com/product/cis247c-quiz-week-3/

(TCO 2) Java, C#, and C++ all allow for the use of comments. Which of the following statements are true regarding comments?

The compiler will ignore all comments if they are properly formatted.

The compiler will ignore all comments if they are properly formatted.

The output console will ignore all comments if they are properly formatted.

All of the above

None of the above

(TCO 2) Which of the following statements is true?

Object names are listed in the middle section of a UML diagram.

Attribute names are listed in the middle section of a UML diagram.

Method names are listed in the middle section of a UML diagram.

Method names are listed in the middle section of a UML diagram.

None of the above

(TCO 2) A(n) _____ has the same name as the class it is declared in, it is used to initialize attributes and accepts zero arguments.

Default destructor

Default constructor

Initializing method

Instantiation

None of the above

(TCO 2) _____ attributes are hidden from outside classes, which is also known as information hiding.

Static

Private

Public

All of the above

(TCO 2) Encapsulation _____ and provides _____ for program components.

Protects an object’s data from unwanted modifications; independence

Protects an object’s methods from unwanted modifications; independence

Provides universal access to an object’s attributes; a stable implementation

Provides universal access to an object’s methods; a stable implementation

None of the above

(TCO 2) Which of the following symbols indicate level of access for both attributes and methods in a class?

&&

/

II

All of the above

(TCO 2) Object-oriented classes should be designed with the concept of a black box in mind. This means that users of the class should only need to know what _____ and _____ are associated with the class. The actual implementation details need not be known.

interface; implementation

inputs; outputs

objects; accessors

relationships; interfaces

(TCO 2) Which of the following statements is false about encapsulation?

Encapsulation assists in creating reliable code.

Encapsulation assists in creating reliable code.

Encapsulation assists in creating reliable code.

None of the above

(TCO 2) Which of the following is a proper implementation for a getter?

public: int getAge() { return age;}

public: void getAge() {return age;}

public: void getAge() {return age;}

public: void getAge() {return age;}

(TCO 2) Identify the getter declaration(s) below that most likely adhere(s) to the concept of information/data hiding.

private: string getName(){return name;}

public: string getName(){return name;}

private: void getName(){return name;}

public: void getName(){return name;}

None of the above

CIS 247C All Quizzes

Quiz Week 4 

https://www.hiqualitytutorials.com/product/cis247c-quiz-week-4/

(TCO 3) A solid object-oriented design process includes which of the following?

Doing good analysis

Gathering user requirements

Identifying the classes

All of the above

(TCO3) When would a programmer write more than one constructor?

You never have more than one constructor

The constructor cannot be overloaded

The one object can be created by two different constructors

When the object can be initialized in more than one way

(TCO3) Which of the following might lead to potential class(es)?

Checking account

Customer

Deposit

A and B

None of the above

(TCO3) Why do classes need to collaborate with each other?

Most classes do not exist in isolation.

Classes need to interact with other classes to get something they want most of the time.

This is where messages between classes apply.

All of the above

(TCO 3) Assume you have an Employee class with a non-static attribute named salary. If you create ten objects of this class, how many copies of the salary variable will you have?

2

10

An unlimited number

None of the above

(TCO3) What happens right after gathering requirements in the object-oriented design process?

Developing SOW

Identifying classes

Identifying classes

Identifying classes

(TCO3) In the object-oriented design process, what is/are the reason(s) to identify requirements early and keep design changes to a minimum?

The cost of a design change in the implementation phase is significantly higher.

The cost of a design change after the deployment phase is astronomical when compared to the first item.

The cost of a requirement/design change in the design phase is relatively small.

All of the above

(TCO3) In object-oriented design, which of the following is true about the gathering requirements phase?

It represents what the user wants the system to do and is the most important part of the system.

The level of detail needs to be very technical.

The requirement document does not need to be very specific to represent the true nature.

The gathering requirement happens after the developing user interface prototype.

(TCO 3) Which of the following is true?
An abstract data type:
I. Captures a data representation;
II. Defines the operations that are allowed on its data;
III. Replaces structured programming

I, II, and III

I, II

I, III

II, III

(TCO 3) Classes do not have the property of _____.

Encapsulating data

Information hiding

Containing both data and functions

Containing both data and functions

CIS 247C All Quizzes

Quiz Week 5 

https://www.hiqualitytutorials.com/product/cis247c-quiz-week-5/

(TCO 3) Which of the following about composition is true?

Composition promotes code reuse.

Class composition means a class contains objects from another class.

Inheritance and composition can be used together.

All of the above

(TCO 4) Which of the following is true about inheritance?

Child classes are more generalized than their associated parent classes.

Inheritance demonstrates the generalization/specialization relationship.

Parent classes are more specialized than their associated child classes.

Parent classes are more specialized than their associated child classes.

(TCO 4) Select the parent class.

Circle

Shape

Cylinder

Rectangle

(TCO 4) Which of the following is not a good example of a hierarchy that could be modeled by
inheritance?

Person

Even numbers

Bank account

Reptile

(TCO 4) Which of the following examples represent the “is-a” relationship in the parent/child format?

Dog/cat

Rectangle/circle

Checking account/saving account

None of the above

(TCO 3) What is the result of over-using inheritance?

System dependencies are created.

Unnecessary relationships are created.

Code is harder to understand.

All of the above

(TCO 3) In object-oriented programming, inheritance is transitive; that means a child class _____.

Inherits only from its parent class

Inherits only selected methods and fields

Inherits all the methods and fields of all its ancestors

Does not inherit any methods or fields

(TCO 4) What inheritance mode is the most general one?

Private

Default

Public

Protected

(TCO 4) Inheritance is only possible in _____ languages.

Procedural

Object-oriented

GUI based

Non-structured

(TCO 6) _____ is the ability to combine data and operations on that data into a single unit.

Inheritance

Encapsulation

Polymorphism

Composition

CIS 247C All Quizzes

Quiz Week 6 

https://www.hiqualitytutorials.com/product/cis247c-quiz-week-6/

(TCO 7) An abstract class can contain _____.

Pure virtual functions

Ordinary functions

Both A and B

None of the above

(TCO 7) What is an abstract class?

Any class which can be instantiated

A class without any subclasses

A class without any subclasses

Any superclass with more than one subclass

(TCO 7) Which of the following statements is false?

A pure virtual function is a function without function implementation and can be found in an abstract class.

If a derived class extends an abstract base class, the derived class must implement the pure virtual functions declared in the abstract base class.

If a derived class extends an abstract base class, the derived class must implement the pure virtual functions declared in the abstract base class.

Pure virtual functions are inherited.

(TCO 7) Which of the following classes is most likely an abstract class?

EvoCellPhone

EvoCellPhone

Building

Rose

(TCO 7) In terms of object-oriented programming, a contract is a mechanism that forces a programmer to adhere to a predefined application programming interface or _____.

Method signature

Class declaration

Framework

Object instantiation method

None of the above

(TCO 7) Which is the prototype for a pure virtual function in class Person called DisplayDescription which has no inputs and no returned value?

Void virtual DisplayDescription ()

Virtual void DisplayDescription () = 0;

Virtual void TVGame:: DisplayDescription() {}

Virtual void TVGame:: DisplayDescription() {}

(TCO 7) Some object-oriented languages such as C++ allow for _____, while other object-oriented languages such as Java and .NET do not.

Abstract classes

Multiple inheritance

Class overloading

Method instantiation

(TCO 7) Which of the following classes represent an abstract class?

Class Plant {
virtual void grow()=0;
}

Class Plant {
virtual void grow ();
}

Class Plant {
virtual void grow (){}
}

Class Plant {
virtual void grow (){}
}

(TCO 7) Which of the following declares a pure virtual function in an abstract C++ class?

Public: virtual void method()=0;

Public: void method() {}

Public: void Method();

Public: void method()=0

(TCO 7) What is the coding requirement(s) that a programmer must follow when writing virtual functions?

The programmer must use a “virtual” keyword in the parent class.

The parent class must have specific implementation coded in the .cpp file.

The base class must use a different name for the function than the parent class.

There are no specific coding requirements for using the “virtual” keyword.

CIS 247C All Quizzes

DeVry