Suppose that you are defining an ADT class and that you then use this class in a
a. The class definition
b. The declaration for a function that is to serve as an ADT operation, but that is neither a member nor a friend of the class
c. The declaration for an overloaded operator that is to serve as an ADT operation, but that is neither a member nor a friend of the class
d. The definition for a function that is to serve as an ADT operation, but that is neither a member nor a friend of the class
e. The definition for a friend function that is to serve as an ADT operation
f. The definition for a member function
g. The definition for an overloaded operator that is to serve as an ADT operation, but that is neither a member nor a friend of the class
h. The definition for an overloaded operator that is to serve as an ADT operation and that is a friend of the class
j. The main part of your program
Want to see the full answer?
Check out a sample textbook solutionChapter 12 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++: Early Objects (9th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Concepts of Programming Languages (11th Edition)
Starting Out with Python (4th Edition)
Computer Science: An Overview (12th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- Classes - Continued... Write a definition of a class and write a program that implements all the functionality of the class that has the following properties. The Main Program should invoke all functionality of this class, i.e., secretType. Input: from a file - the person's name and age and weight and height Output: The Original input and based on their BMI, their weight status. The name of the class is secretType. a. The class secretType has four member variables: name (a string), age and weight (int), height (double) b. The class secretType has the following member functions: (Make the accessor functions const) с. i. print – outputs the data in the member variables in a nicely formatted ii. setName - sets the name iii. setAge – sets the age iv. setWeight – sets the weight setHeight – sets the height V. vi. getName – value returning function returns the name vii. getAge – value returning function returns the age viii. getHeight – value returning function returns the height ix.…arrow_forwardWrite the definition of class StorageFile and a test main() function. Class StorageFile does not contain inline function definitions. I. Write the class declaration for StorageFile and declare (no definitions) the following members: 1. A private member named location of type string. 2. A public default constructor. 3. A public non-default constructor with one parameter of type string. 4. A destructor 5. An accessor (getter) for location. II. Define the following members ONLY. Note that these definitions are placed outside the class' declaration. 1. Default constructor to initialize location to "none" 2. Non-default constructor to initialize location using the constructor's parameter. 3. The accessor (getter) for location II. Define main() to perform the following steps: 1. Create an instance of type StorageFile using the default constructor 2. Create an instance of type StorageFile using the non-default constructor, use "new" for the parameter. 3. Extract and print the value of…arrow_forwardResearch assistants provide support to professionals who are conducting experiments or gathering andanalyzing information and data. Suppose you are working as RA (research assistant) with a Professor who isworking on a project and evaluating complex mathematical equations. Your duty is to assist him, so in thisregard he has assigned a task to you. Your task is to write a oop c++ program to create a class named equation which will have the data members a, b and c which are the coefficients of the quadratic equation. The class will have two more data members namely proot and nroot which stand for the positive root and negative root of the equation. Suppose that variables a, b and c are integers. Where proot and nroot are floats. Input Function to get values of a, b and c Then design a friend function which will determine the proot and nroot of the equation. Create another friend function which will display the values of proot and nroot.arrow_forward
- Hi, I am having trouble with this homework question for my C++ course 1. Implement a Student class. a. Create a class Student with the following private data members:1. name2. exam_1 grade3. exam_2 gradeb. Create all appropriate accessor and mutator functions.c. Assign appropriate access modifiers to insure encapsulation.d. Add a private calc GPA() function that calculates and returns the GPAbased upon the two exam grades.e. Add a public getGrade() function that: 1. Obtains the GPA from the private calc GPA() function.2. Returns a letter grade based upon the numerical GPA value.90 to 100 = A80 to 90 = B70 to 80 = C60 to 70 = D0 to 60 = F f. Test all functions use following main.int main(){Student a;a.setName("David");a.setExam1(90);a.setExam2(80);cout<<a.getName()<<endl;cout<<a.getExam1()<<endl;cout<<a.getExam2()<<endl;cout<<a.getGrade()<<endl;}arrow_forwardprogramming language :c++ make a program in c++ to store hiring date and date of birth for Managers and Employees. You need to create a Date class for this purpose. Create objects of Date class in Manager and Employee classes to store respective dates. You need to write print function in Manager and Employee classes as well to print all information of Managers and Employees. You need to perform composition to implement this task. Create objects of Manager and Employee classes in main function and call print function for both objects. Print Date class here. Print updated Manager class here. Print updated Employee class here. Print main function here.arrow_forwardSUBJECT: OOPPROGRAMMING LANGUAGE: C++ ALSO ADD SCREENSHOTS OF OUTPUT. Write a class Distance to measure distance in meters and kilometers. The class should have appropriate constructors for initializing members to 0 as well as user provided values. The class should have display function to display the data members on screen. Write another class Time to measure time in hours and minutes. The class should have appropriate constructors for initializing members to 0 as well as user provided values. The class should have display function to display the data members on screen. Write another class which has appropriate functions for taking objects of the Distance class and Time class to store time and distance in a file. Make the data members and functions in your program const where applicablearrow_forward
- Write a C++ program which creates a Class named as Person which represents a person by its Id (it must be unique), Name, Age, Address and Phone no. This class should have a parameterized constructor and destructor, the getter/setter functions and a showoutput () member function that prints the information of a Person object. PART A Create a Class named as Student that inherits publicly from class Person. A Student object is distinguished by the same attributes as a Person object plus his Course name, Room no (which is allocated to him) and GPA. This class should also have parameterized constructor and default destructor, setter/getter functions and a showoutput () member function. Your input should be similar to the following: *-*-*-**-*-*-*-*-*-*-*-*-* Enter Student's Information *-*-*-**-*-*-*-*-*-*-*-*-* Enter the Roll No: 1 Enter the Name of the Person:…arrow_forwardThis lab must be done in C++ Assignment: In cryptography, encryption is the process of encoding a message or information in such a way that only authorized parties can access it. In this lab you will write a program to decode a message that has been encrypted. Detailed specifications: Define three classes. Each one should be in a separate file. You can choose to define the class and its functions inline, all in a header file, or have a .h and .cpp file for each class. Abstract base class with the following: A variable to hold an encrypted message. This variable should be a string which is initialized in the constructor. A status variable that will tell whether the message was loaded successfully. A constructor that receives one parameter: a string variable with a file name and uploads its content to the string variable that is supposed to store it. A pure virtual function called decode. This function will be defined in derived classes. A function that prints the message on the…arrow_forwardCreate a C++ program of your choosing that uses at least three classes. The classes shall use appropriate accessors and mutators and at least one class shall have at least two overloaded constructors. Include documentation about your program's functionalityand how it was tested.arrow_forward
- Problem Write a C++ program that declares a class named Point to model a point. A point is represented by its coordinates x and y. Separate the class definition from declaration within the same file. Do the following tasks to accomplish the program. 1. Define several constructors for the class as follows. Use constructor initializer and default arguments whenever possible. a. A constructor that accepts two parameters to initialize the coordinates x and y respectively. b. A copy constructor that accepts another Point object. Use a constructor initializer to invoke constructor (a) c. A default constructor that sets the coordinates x and y to 0. Use a constructor initializer to invoke any of the above constructor s. 2. Define a constant method named print() that prints the coordinates x and y of the point. Explain what is a constant method and what is used for? Why is this method better to be declared as a constant method? Write your answers as comments in the program. 3. Define a method…arrow_forwardwrite a c++ program for this : Create a class for a SuperMarket to maintain their stock details. The class must havethe data members like product number, name, unit price, quantity available. Write down thecorresponding functions to read, display the details and to add the stock.arrow_forwardWrite a c++ program Class student contains roll number, name and course as data members and Input_student and display_student as member functions. Create a class exam and publicly inherit it from student class. The derived class contains an array of marks and no_of_subjects as data members, and input_marks and display_result as member functions. Overload “arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education