C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 11, Problem 14SA

Consider the following class definitions: (2, 8)

class smart                                           classsuperSmart:publicsmart {                                                             { public:                                                    public: void print () const ;                                 void print () const ; void set  ( int, int )  ;                                   void set ( int, int, int ) ; int sum () ;                                                int manipulate () ; smart();                                                      superSmart () ; smart ( int, int )  ;                                        superSmart (int, int, int) ; private:                                                      private: int x ;                                                          int       z ; int y ;                                                              } ; int secret () ; } ;

  1. Which private members, if any, of smart are public members of superSmart?

  2. Which members, functions, and/or data, of the class smart are directly accessible in class superSmart?

Blurred answer
Students have asked these similar questions
(Java) Make the 2 following classes: Employee.java EmployeeTest.java Copy and paste the below starter code into Employee.java: /** * Employee.java extends Person.java * @author * CIS 36B, Activity 11.1 */public class Employee extends Person {    private static int numEmployees = 0;       private double salary;    private String title;       /**     * Default constructor for the     * Employee class. Calls the     * default constructor of the     * superclass and also initializes     * salary and title to default     * values     */    public Employee() {          }       /**     * Multi-argument constructor for the     * Employee class. Calls the     * multi-argument constructor of the     * superclass and also initializes     * salary and title to the     * specified values     */    public Employee(String name, int age, String gender, Address a, double salary, String title) {           }       /**     * Returns the annual salary     * @return the salary     */    public double…
class first { public: void setX(); void print() const; protected: int y; void setY(int a); private: int x; };   Suppose that class second is derived from class first using the statement: class second: private first    which members of class first are private, protected, and public in class second?
Programming Language = Python 1. Employee and ProductionWorker Classes Write an Employee class that keeps data attributes for the following pieces of information: • Employee name • Employee number Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: • Shift number (an integer, such as 1, 2, or 3) • Hourly pay rate The workday is divided into two shifts: day and night. The shift attribute will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Write the appropriate accessor and mutator methods for each class. Once you have written the classes, write a program that creates an object of the ProductionWorker class and prompts the user to enter data for each of the object’s data attributes. Store the data in the object and then use the object’s accessor methods to retrieve it and display it on the…
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
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