STARTING OUT WITH C++ REVEL >IA<
9th Edition
ISBN: 9780135853115
Author: GADDIS
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 15, Problem 19RQE
A derived class inherits the ________ of its base class.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A derived class uses a constructor from the base class to initialize all the data inherited from the base class.
False
True
A derived class inherits the __________ of its base class.
Write a base class Computer that contains data members of wordsize (in bits), memory size in megabytes, and storage size in megabytes and speed in megahertz. Drive a Laptop class that is kind of computer but also specifies the object’s length width, height and weight. Member functions for both classes should include a default constructor, a constructor to initializes all components and a function to display data members.
Chapter 15 Solutions
STARTING OUT WITH C++ REVEL >IA<
Ch. 15.1 - Here is the first line of a class declaration....Ch. 15.1 - What is the name of the derived class in the...Ch. 15.1 - Suppose a program has the following class...Ch. 15.2 - What is the difference between private members and...Ch. 15.2 - What is the difference between member access...Ch. 15.2 - Suppose a program has the following class...Ch. 15.3 - What will the following program display? #include...Ch. 15.3 - What will the following program display? #include...Ch. 15.7 - Explain the difference between overloading a...Ch. 15.7 - Prob. 15.10CP
Ch. 15.7 - Prob. 15.11CPCh. 15.7 - What will the following program display? #include...Ch. 15.7 - What will the following program display? #include...Ch. 15.7 - What will the following program display? #include...Ch. 15.7 - What will the following program display? #include...Ch. 15.8 - Does the following diagram depict multiple...Ch. 15.8 - Does the following diagram depict multiple...Ch. 15.8 - Examine the following classes. The table lists the...Ch. 15.8 - Examine the following class declarations: class...Ch. 15 - What is an is a relationship?Ch. 15 - A program uses two classes: Dog and Poodle. Which...Ch. 15 - How does base class access specification differ...Ch. 15 - What is the difference between a protected class...Ch. 15 - Can a derived class ever directly access the...Ch. 15 - Which constructor is called first, that of the...Ch. 15 - What is the difference between redefining a base...Ch. 15 - Prob. 8RQECh. 15 - What is an abstract base class?Ch. 15 - A program has a class Potato, which is derived...Ch. 15 - What base class is named in the line below?class...Ch. 15 - What derived class is named in the line below?...Ch. 15 - What is the class access specification of the base...Ch. 15 - What is the class access specification of the base...Ch. 15 - Protected members of a base class are like...Ch. 15 - Complete the table on the next page by filling in...Ch. 15 - Complete the table below by filling in private,...Ch. 15 - Complete the table below by filling in private,...Ch. 15 - A derived class inherits the ________ of its base...Ch. 15 - When both a base class and a derived class have...Ch. 15 - An overridden base class function may be called by...Ch. 15 - When a derived class redefines a function in a...Ch. 15 - A(n) __________ member function in a base class...Ch. 15 - ________ binding is when the compiler binds member...Ch. 15 - __________ binding is when a function call is...Ch. 15 - _________ is when member functions in a class...Ch. 15 - When a pointer to a base class is made to point to...Ch. 15 - A(n) __________ class cannot be instantiated.Ch. 15 - A(n) _______ function has no body, or definition,...Ch. 15 - A(n) _________ of inheritance is where one class...Ch. 15 - _______ is where a derived class has two or more...Ch. 15 - In multiple inheritance, the derived class should...Ch. 15 - Write the first line of the declaration for a...Ch. 15 - Write the first line of the declaration for a...Ch. 15 - Suppose a class named Tiger is derived from both...Ch. 15 - Write the declaration for class B. The classs...Ch. 15 - T F The base classs access specification affects...Ch. 15 - T F The base classs access specification affects...Ch. 15 - T F Private members of a private base class become...Ch. 15 - T F Public members of a private base class become...Ch. 15 - T F Protected members of a private base class...Ch. 15 - T F Public members of a protected base class...Ch. 15 - T F Private members of a protected base class...Ch. 15 - T F Protected members of a public base class...Ch. 15 - T F The base class constructor is called after the...Ch. 15 - T F The base class destructor is called after the...Ch. 15 - T F It isnt possible for a base class to have more...Ch. 15 - T F Arguments are passed to the base class...Ch. 15 - T F A member function of a derived class may not...Ch. 15 - Prob. 51RQECh. 15 - T F A base class may not be derived from another...Ch. 15 - class Car, public Vehicle { public: Car(); Car();...Ch. 15 - class Truck, public : Vehicle, protected {...Ch. 15 - class SnowMobile : Vehicle { protected: int...Ch. 15 - class Table : public Furniture { protected: int...Ch. 15 - class Tank : public Cylinder { private: int...Ch. 15 - class Three : public Two : public One { protected:...Ch. 15 - Employee and ProductionWorker Classes Design a...Ch. 15 - ShiftSupervisor Class In a particular factory, a...Ch. 15 - TeamLeader Class In a particular factory, a team...Ch. 15 - Prob. 4PCCh. 15 - Time Clock Design a class named TimeClock. The...Ch. 15 - Essay Class Design an Essay class that is derived...Ch. 15 - PersonData and CustoraerData Classes Design a...Ch. 15 - PreferredCustomer Class A retail store has a...Ch. 15 - File Filter A file filter reads an input file,...Ch. 15 - File Double-Spacer Create a derived class of the...Ch. 15 - Course Grades In a course, a teacher gives the...Ch. 15 - Ship. CruiseShip, and CargoShip Classes Design a...Ch. 15 - Pure Abstract Base Class Project Define a pure...Ch. 15 - Prob. 14PC
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Explain how entities are transformed into tables.
Database Concepts (7th Edition)
Define each of the following terms: supertype subtype specialization entity cluster completeness constraint enh...
Modern Database Management (12th Edition)
Indentify and correct the errors in each of the following. [Note: There may be more than one error in each piec...
C How to Program (8th Edition)
What is a constructor?
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
What is the output of the following program? #include iostream using namespace std; void test(int = 2, int = 4,...
Starting Out with C++: Early Objects
For each of the following activities, give a PEAS description of the task environment and characterize it in te...
Artificial Intelligence: A Modern Approach
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- C++ Exercise 2 (inheritance):Consider a circle class that has a single attribute R (radius).1. Write a program that allows you to create this class that contains:o A single attribute.o A default constructor that initializes R to 1.o A parameterized constructor.2. Create another cylinder class that inherits the circle class publicly. Theclass cylinder contains:o A single H (Height) attribute.o A parameterized constructor.o A member function to calculate and display the volume of the cylinder.arrow_forwardTrue or FalseA base class reference variable can reference an object of any class that is derived from the base class.arrow_forwardM02 C++ 1. Design a class called Circle. The circle is defined by its center (x,y) and radius r. Here is the UML for the class: Circle-int x //x coord of the center-int y // y coord of the center-int radius+ Circle() //default constructor that sets origin to (0,0) and radius to 1+Circle(int x, int y, int radius) // regular constructor+getX(): int+getY(): int+getRadius(): int+setX(int newX: void+setY(int newY): void+setRadius(int newRadius):void+getArea(): double // returns the area using formula pi*r^2+getCircumference // returns the circumference using the formula 2*pi*r+toString(): String // return the circle as a string in the form (x,y) : radius2. make a specification file called CircleHeader.h which contains the class specification with member variable (attribute) declarations and function (aka instance method) headers3. make a file called Circle.cpp which implements the Circle class as given in the UML diagram above. This file will implement instance methods…arrow_forward
- A base class reference variable may be used to refer to an object of a derived class by using the operator.arrow_forwardT F Classes are good for creating scalable and maintainable codearrow_forwardis the term used to describe the process of transforming a member of one class into a member of another.arrow_forward
- A class is made abstract by declaring that class virtual. T/Farrow_forward1.1 Class definition Define a class bankAccount to implement the basic properties of a bank account. An object of this class should store the following data: Account holder’s name (string) Account number (int) Account type (string, check/savings/business) Balance (double) Interest rate (double) – store interest rate as a decimal number. Add appropriate member functions to manipulate an object. Use a static member in the class to automatically assign account numbers. 1.2 Implement all appropriate member functions of a class. 1.3 write a program that illustrate how to use your class. Your program should have the following: Declare an array of 20 components of type bankAccount to process up to 20 customers. void menu() – helps the user to select if the customer is new or if they already exist. Furthermore, it prints the customer’s data or exits the program. Use a switch statement which uses the value from menu() as an expression to call the following user-defined functions: void…arrow_forwardIn order to extend a class, the new class should have access to all the data and inner workings of the parent class. True Falsearrow_forward
- C# please create an abstract class named "Payment" and abstract method named "Authorized" . Create another class named "Credit" that inherits the class Payment and implements its membersarrow_forwardWrite base class with the name Shape . The Shape class have Private Variable: area, a double used to hold the shape's area. Public Member Functions: getArea the Accessor. This function should return the value in the member variable area. Parameterized constructor—Initializes area member. Defualt constructor— Empty body calcArea. This function should be a incomplete function.Next, define a class named Triangle . It should be child of Shape class. It should have the following members:Protected Member Variables: base, a integer used to hold the base of triangle.Height, a integer used to hold the height of the triangle. Public Member Functions: constructor—Initializes values for base, height. The overridden calcArea function in Circle described below.calcArea—calculates the area of the Triangle (1/2* base * height) and stores the result in the inherited member area.After you have created these classes, create a driver program that defines a Triangle object. Demonstrate that each object…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY