Exam 6: Structures and Classes

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

It seems that mutator and accessor functions defeat the purpose of making the member variables private.Why is this not so?

(Essay)
5.0/5
(44)

Carefully identify,define each term and give differences between the implementation and the interface of an abstract data type (ADT).This requires a bit more writing of English than other question on this test.

(Essay)
4.9/5
(36)

If,in a class,one uses the keyword public:,it affects only the member that immediately follows the keyword public,making this member accessible to any other function defined anywhere.

(True/False)
4.8/5
(38)

In the structure definition struct StudentRecord { int studentID; char grade; } give the structure tag,and each of the member names.

(Essay)
4.7/5
(33)

An abstract data type is a collection of a set of values together with a set of basic operations defined on the values.

(True/False)
4.8/5
(38)

No special syntax is necessary to define a function that uses a structure parameter.(This is unlike using an array parameter. )

(True/False)
4.8/5
(36)

Structure definitions are usually global (defined outside any functions).

(True/False)
4.9/5
(32)

A data type is a collection of a set of values together with a set of basic operations defined on the values.

(True/False)
4.9/5
(32)

There is no access to private members of a class by any function defined outside the class.

(True/False)
4.8/5
(32)

Given the ShoeType structure type definition.Write a function for the declaration (prototype). struct ShoeType { char style; double price; }; void readShoeRecord(ShoeType& Item); // Prompts for data and fills ShoeType argument members

(Essay)
4.8/5
(32)

The concept of class is central to Object Oriented Programming.

(True/False)
4.9/5
(39)

The scope resolution operator can be used with an object to qualify a member function.

(True/False)
4.9/5
(42)

Write a definition for a structure type for personnel records for hourly employees.The record contains an hourly wage rate,accrued vacation in an integer number of days,and employee status (use 'T' for temporary and 'P' for permanent).Part of the problem is appropriate choices of type and member names.

(Essay)
4.9/5
(35)

The following definition of the structure variables of type myStruct s and t could be made using several definitions using the structure tag. struct myStruct { int i; double d; } s,t;

(True/False)
4.8/5
(36)

Consider these hierarchical structures. struct Date { int year; //members }; struct Person { Date birthDay; //other members }; Person Bill; The year of Bill's birthday may be accessed as Bill.year;

(True/False)
4.9/5
(48)

Given the ShoeType structure type definition,write a function declaration (prototype)for a void function that uses a ShoeType structure variable as a value parameter. struct ShoeType { char style; double price; };

(Essay)
4.7/5
(31)

What is the output of the following program.? #include <iostream> using namespace std; struct ShoeType { char style; double price; }; int main() { ShoeType shoe1,shoe2; shoe1.style = 'P'; shoe1.price = 98.98; cout << shoe1.style << " $" << shoe1.price << endl; shoe2 = shoe1; //Put shoe2 on sale! shoe2.price = shoe1.price/2; cout << shoe2.style << " $" << shoe2.price << endl; }

(Short Answer)
4.9/5
(40)
Showing 21 - 37 of 37
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)