Concept explainers
Problem (Online Address Book):
Using classes, design an online address book to keep track of the names, addresses, phone numbers, and dates of birth of family members, close friends, and certain business associates.
- Define a class addressType that can store a street address, city, state, and ZIP code. Use the appropriate functions to print and store the address. Also, use constructors to automatically initialize the member variables.
- Define a class extPersonType using the class personType with following members and methods: firstname, lastname, and accessors and mutators, print to display, and constructors.
Define a class dateType for month, day and year as members with its accessors, mutators, and constructors)
Design a class addressType. Add a member variable to this class to classify the person as a family member, friend, or business associate. Also, add a member variable to store the phone number. Add (or override) the functions to print and store the appropriate information. Use constructors to automatically initialize the member variables.
- Define the class addressBookType using the previously defined classes. An object of the type addressBookType should be able to process any number of entries.
The program should perform the following operations:
- Load the data into the address book from data file.
- Sort the address book by last name.
- Search for a person by last name.
- Print the address, phone number, and date of birth (if it exists) of a given person.
- Print the names of the people whose birthdays are in a given month.
- Print the names of all the people between the two last names.
- Depending on the user’s request, print the names of all family members, friends, or business associates.
- Allow the user to save the data in the address book.
c++
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
- Classes: Write a Person class that has these attributes: person_ID, first and last names, and age Default and overloaded constructors Accessors and mutators equals method toString method (make this virtual if C++, don't forget to prep the class for polymorphism) Inheritance: Create a child class to Person called Student: Attributes: GPA and status (freshman, sophomore, junior, senior, graduate, graduated). Make sure you have appropriate accessor/mutator methods Create another child class to represent Faculty. This class will have faculty rank and length of service as attributes along with an office location. Again, add methods as needed. Application Create an application that displays a menu that allows users to add students or faculty, or print either one or exit. Deliverable: Submit your source code and classes on Github (you will be supplied an account) You will also submit a Word document and your code on Canvas. In the document you iwll write a summary of your design…arrow_forwardIn order to do a range of tasks, both code and forms employ the ACTION and METHOD attributes.arrow_forwardIt is possible to express the relationship that exists between classes and objects.arrow_forward
- Design a Ship class that has the following members:• A field for the name of the ship (a string).• A field for the year that the ship was built (a string).• A constructor and appropriate accessors and mutators.• A toString method that displays the ship's name and the year it was built.Disign a CruiseShip class that extends the Ship class. The CruiseShip class should have thefollowing members:• A field for the maximum number of passengers (an int).• A constructor and appropriate accessors and mutators.• A toString method that overrides the toString method in the base class. The CruiseShipclass's toString method should display only the ship's name and the maximum number ofpassengers.Design a CargoShip class that extends the Ship class. The CargoShip class should have thefollowing members:• A field for the cargo capacity in tonnage (an int).• A constructor and appropriate accessors and mutators.• A toString method that overrides the toString method in the base class. The CargoShipclass's…arrow_forwardCreate an Account class that a bank might use to represent customers’ bank accounts. Include a data member to represent the account balance. Provide a constructor that receives an initial balance and uses it to initialize the data member. The constructor should validate the initial balance to ensure that it is greater than or equal to 0. If not, set the balance to 0. Provide three member functions:- credit($amount) should add amount to the current balance- debit($amount) should ensure that amount does not exceed the current balance and then reduce the current balance by amount. The balance should not change if amount exceeds the balance.- getBalance() should return the current balanceNote: Create a set of test data and then write a program to test the class.arrow_forwardDesign/code/test a Java program containing an abstract the class absWelcome. This class should contain: 1. A public abstract void method (you name it) that is empty 2. A public regular method (you name it) that prints "Welcome to " Next, create a subclass clsHello that extends absWelcome. This class should contain: • A public regular method (you name it) that prints "Java Programming" Finally, inside the Main class create an object (you name it) from the clsHello class. Use this new object reference to: 1. Output "Welcome to " from the abstract class 2. Output "Java Programming" from the subclass Your output should resemble that shown below >sh -c javac -classpath -type f-name '*.java') java -classpath :targe Welcome to Java Programmingarrow_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