Posts

15. Create a class called Date that includes three pieces of information as data members a month, a day and a year. Provide a set and a get function for each data member. Provide a member function display Date that displays the month, day and year separated by forward slashes (/).

14. Create a class called Employee that includes three pieces of information as data members a first name, a last name and a monthly salary. Provide a set and a get function for each data member. Create two Employee objects and display each object’s yearly salary. Then give each Employee a 10 percent raise and display each Employee’s yearly salary again.

13. Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four data members a part number, a part description, a quantity of the item being purchased and a price per item.

12. Create an Account class that a bank might use to represent customers bank accounts. Include a data member to represent the account balance. Provide three member functions. Member function credit should add an amount to the current balance. Member function debit should withdraw money from the Account. Member function get Balance should return the current balance.

11. Modify class GradeBook, Include a string data member for course instructor’s name, Provide a set function and a get function to change and retrieve it, Modify display Message to output the welcome message and course name.

12. Create a four-function calculator for fractions. The user should type the first fraction, an operator, and a second fraction. The program should then display the result and ask whether the user wants to continue.