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)
- Hello. I'm trying to make a C++ program practices with classes and OOP with dates, using three files: main.cpp, Date.cpp, and Date.h. I'm getting errors in main.pp for undefined references and in Date.cpp. there is alse an error for undefined reference Requirements Date.h will contain the class declaration. The following is required in the class declaration: The private attributes are the month, day, and year. The public member functions are PrintDate, SetDate, and NextDate The default constructor should initialize all data to the value 0. NextDate should still return a new Date object with the next day's information. This function needs to be completed (For this, just assume Feb has 29 days all the time even though it is not true.) Date.cpp will contain the implementation of all member functions and the constructor main.cpp* will need to be updated to use the member functions. Example: SetDate(today,2,13,2016); // today.month = 2; // today.day = 13; //…arrow_forwardWrite a Java program that will input a file name to be opened for reading. The java file must only read the first sentence of the file and print on the output.Ensure all the necessary packages and classes needed for the program development are made available, with a class to define the data members and functions that the object of this scenario should have.b)This class should also host the following methodso A function to write a new filename from the keyboard. Note the file name should be inputted from the user.o A function to write to a stored text file on your system, write text to be inputted by the user. c) Exception handling mechanisms should be included in your program wherever they are needed to ensure the smooth running of your program.o The exception handler should be suitable for the possible exceptions that may occur.d)A class hosting the main method and creation of object to test the functionalities.o Ensure that all variables are used and functions are tested.arrow_forwardSuppose that you have the Object class Employee which is an object that contains Name, Surname and Payment with the respective set and get functions. You will create following functions on 'EmpRW' class, and create a main java class to call them. a. Write a java function that writes on a file named 'emp.txt' by using Formatter Class, this Employee Object. b. Write another java function that reads from the file 'emp.txt' and stores the data as an array of Instances of Employee object. C. Write a function that prints out the name, surname and maximum salary from the Employee list taken from the file. Now write the main java class that takes data by using Input Dialogs, and that uses all of above functions of 'EmpR W' class. e. Write the same functions in a and b by assuming the Employee Object class is serializable, on 'EmpSerR W' class. The name of the file to read and write should be 'emp.binarrow_forward
- Practice overriding. In a main, build an object of that class, and print out the object using System.out.println(). Notice that this simply reports the memory address of the object in question, and we’d like to do something more useful. To replace (or override) the toString (or equals) function. We build another toString function to override the other one that also prints out the make, model, and odometer reading for a vehicle object. Reuse your Car class in the last exercise. public class Car { //instance variables private int odometer; private String make; private String model; //overloading //constructors public Car(int odometer,String make, String model) { this.odometer = odometer; this.make = make; this.model = model; } public Car(String make, String model) { this.make = make; this.model = model; } public Car(String make) { this.make = make; } /* *getter & setter methods */…arrow_forwardBoth child class and its parent class have same function signature. Which version of function will be called by the object pointer of parent class that is pointing to the child class’s object? Explain the reason. When do we need to use virtual function? Explain with example programarrow_forwardIn this task, we’re going to be simulating an email message. Some of the logic hasbeen filled out for you in the email.py file.● Open the file called email.py.● Create a class definition for an Email which has four variables:has_been_read, email_contents, is_spam and from_address.● The constructor should initialise the sender’s email address.● The constructor should also initialise has_been_read and is_spam to false.● Create a function in this class called mark_as_read which should changehas_been_read to true.● Create a function in this class called mark_as_spam which should changeis_spam to true.● Create a list called inbox to store all emails (note that you can have a list ofobjects).● Then create the following methods:○ add_email - which takes in the contents and email address from thereceived email to make a new Email object.○ get_count - returns the number of messages in the store.○ get_email - returns the contents of an email in the list. For this, allowthe user to input an index…arrow_forward
- Write a class Employee with data members Name, Id, and Salary. Derive two classes, Faculty with data members Department, and role(permanent or visiting) and derived class Management with data members Department and rank (manager, deputymanager, etc.). Create getters,settersfor all thedata members, create constructors,destructors and show functions for all the classes.Create a write function to write employees on a file . In main function create two objects of each derived class using parameterized constructors, call the show function to show all four objects, write all four objects to a file. Your submission should include the output file.arrow_forwardHow we can access protected data members of a class without the use of public or private functions? Explain with codearrow_forwardI have the basis of a program that works as an inventory, it reads the contents of a file and displays them and their quantity in three places, listed below are the things that I need to add to the program below. I've included a photo of how the program currently runs. 1) Convert your structure into a class. For this exercise, you can leave the data as public (otherwise you would have to change the input and output functions). 2) Write a member function show_all that prints all the information for one record - name, cost, markup, and the three inventory numbers. 3) Add a user option S that lets the user see all the information for all the items in the inventory, using the show_all member function. Print a header so the user knows what each column means, and format the output to appear in columns. Hint: do a setwidth() before *each* cout. Pick widths that make sense for name, cost, markup, and the three inventory numbers. Contents of the file: Contents of Inventory.txt Red delicious…arrow_forward
- WAP to read the class object of student info such as name, age and rollno from the keyboard and to store them on a specified file using read() and write() functions Again the same file is opened for reading and displaying the contents of the file on the screen. File Handling In C++arrow_forwardPart 1: In C#, Create a Class Called FileRoot As we know, when we run a program, the program runs from the bin folder. If I had a file stored at the root of the project and if the program is running, it wouldn't know where it is unless it came out of the bin folder. Before implementing the classes below, create a class that will help you get from the bin folder to the project's root. Hint: Directory class and its static methods would help here.arrow_forwardWrite a C++ class to represent an Employee. Each employee is given a name, an age, a NIC number, anaddress, and a salary. Furthermore: The Employee class should keep track of how many employees (objects) have been created inthe system. Your Employee class should initialize all of its fields via a constructor. Create function prototypes to set and get an employee's zip code. Declare a print_employee() function that prints all of an employee object's details.(Whenever possible, use constant functions.)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