Problem1: (5 Marks) Create a class called Employee that includes three pieces of information as data members—a first name (type string), the last name (type string), and a monthly salary (type int). Your class should have a constructor that initializes the three data members. Provide a set and a get function for each data member. If the monthly salary is not positive, set it to 0. Write a test program that demonstrates class Employee’s capabilities. 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. Problem2: (10 Marks) Create a program to shuffle and deal with a deck of cards. The program should consist of a class Card, class DeckOfCards, and a driver program. Class Card should provide: a) Data members face and suit of type int. b) A constructor that receives two ints representing the face and suit and uses them to initialize the data members. c) Two static arrays of strings representing the faces and suits. d) A toString function that returns the Card as a string in the form “face of suit.” You can use the operator to concatenate strings. Class DeckOfCards should contain: a) A vector of Cards named deck to store the Cards. b) An integer currentCard representing the next card to deal. c) A default constructor that initializes the Cards in the deck. The constructor should use vector function push_back to add each Card to the end of the vector after the Card is created and initialized. This should be done for each of the 52 Cards in the deck. d) A shuffle function that shuffles the Cards in the deck. The shuffle algorithm should iterate through the vector of Cards. For each Card, randomly select another Card in the deck and swap the two Cards. e) A dealCard function that returns the next Card object from the deck. f) A moreCards function that returns a bool value indicating whether there are more Cards to deal. The driver program should create a DeckOfCards object, shuffle the cards, then deal the 52 cards. Problem3: (5 Marks) Develop class Polynomial. The internal representation of a Polynomial is an array of terms. Each term contains a coefficient and an exponent, e.g., the term 2×4 has the coefficient 2 and the exponent 4. Develop a complete class containing proper constructor and destructor functions as well as set and get functions. The class should also provide the following overloaded operator capabilities: a) Overload the addition operator ( ) to add two Polynomials. b) Overload the subtraction operator (-) to subtract two Polynomials. c) Overload the assignment operator to assign one Polynomial to another. d) Overload the multiplication operator (*) to multiply two Polynomials. e) Overload the addition assignment operator ( =), subtraction assignment operator (-=), and multiplication assignment operator (*=).
https://affordabletermpapers.com/wp-content/uploads/2021/05/affordable-termpapers.png 0 0 https://affordabletermpapers.com/wp-content/uploads/2021/05/affordable-termpapers.png 2022-03-29 12:55:182022-03-29 12:55:18C I need the code and the screenshort for the result