Is the following
void showEmployeeData(const Employee object); int main( ) { HourlyEmployee joe("Mighty Joe", "123-45-6789", 20.50, 40); SalariedEmployee boss("Mr. Big Shot", "987-65-4321", 10500.50); showEmployeeData(joe); showEmployeeData(boss); return 0; } void showEmployeeData(const Employee object) { cout << "Name: " << object.getName( ) << endl; cout << "Social Security Number: " << object.getSSN( ) << endl; } |
Want to see the full answer?
Check out a sample textbook solutionChapter 15 Solutions
Problem Solving with C++ (9th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: Early Objects (6th Edition)
C++ How to Program (10th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Software Engineering (10th Edition)
Absolute Java (6th Edition)
Starting out with Visual C# (4th Edition)
- C++ Programing NOTE: The important method has been ATTRIBUTES given to you. userld:int //generates unique id from 10001 upwards INSTRUCTION 1 username:string firstname:string lastname:string dob:string The program should generate unique userld whenever new object is created. Notice that idGenerator is static variable, so assign the current value of idGenerator to userld, so that each user will have unique user id (Starting from 10001). age: int idGenerator: static int; totalUsers : static int МЕТHODS User() User(string, string, string, int) User(const User&) "User() Then increment idGenerator by 1. INSTRUCTION 2 The totalusers is also a static variable. This should keep track of the total users in the class. With the Above UML for CLASS USER, answer the following questions Complete or Create the default constructor method. a. The default constructor should accept just the firstname, lastname, dob (date of birth) and age from the keyboard. wwww w b. Write a setter method that sets the…arrow_forwardpublic static void main(String [] args) { // Step 2: Construct a Day object representing today // and assign it to a variable called aDay // Step 3: Construct a Day object representing the day for our Exam1 on March 1, 2022, and assign it to a variable called examOne // // // Step 4: Declare three integer variables called year, month and day with initial values of 2022, 4, 12. // // 4 // Step 5: Construct a Day object using the three variables and assign it to a variable called examTwo 6. :7 28 29 // // Step 6: Display the three days on separate lines without any messages 30 31 // 32 33 // Step 7: Display the number of days as a positive integer between the two exams with a message 34 35 // 36 // "Number of days between the two exams: " 37 38 39 // Step 8: Update aDay to the day two days later 40 41 // Step 9: Print the year, month and day of aDay, one value per line without any messages 42 43 // 44 45 } 46 47arrow_forwardUse C++arrow_forward
- PROGRAMMING LANGUAGE :C++ QUESTION; You need 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. ______________________________________________________________ note : print the specific part of code in following ... Print Date class here: Print updated Manager class here: Print updated Employee class here: Print main function here:arrow_forwardUsing C++: Write a program that creates a Bus class that includes a bus ID number, number of seats, driver name, and current speed. Create a default constructor without any parameters that initializes the value of ID number, number of seats, and driver name. Create another constructor with three parameters of bus id number, number of seats, and driver name. Car speed should always be initialized as 0. The program will also include the member functions to perform the various operations: modify, set, and display bus information (Bus id, number of seats, driver name, and current speed). For example:- Set the bus id number- Set the number of seats- Set of driver number----------------------------------------------------- Return the bus id number by using get method- Return the number of seats- Return of driver number- Return the current speed-----------------------Member function to display the bus information- busInformation() Also write two member functions, Accelerate() and Brake().…arrow_forwardDesign a new class that contains a print and read function by creating a new object and calling the print and reading functions inside the casearrow_forward
- 2. Create one user object that invokes the default constructor.arrow_forwardWhat's the output of the following code? What's the output of the following code? class Anything { } class Program { public static void main(String[] args) { member += 2; System.out.println (member); } 07 5 int member = 5; The code does not compile. A member variable requires an object to be accessed. } What's the output of the following code? What is the output of the following code? O True int a = 3; int b = 5; int c = 8; if (a> 0 && b 8) { System.out.println("true"); } else { System.out.println("false"); } O Falsearrow_forwardQuestion 12 Consider the following program written in C pseudocode: void foo(int x, int y){ y = y + 9; x = x + y; void main(){ int a = 6; int b = 5; foo(a, b); For each of the following parameter-passing methods, what will be the values of a and b after running the program? 1) Passed by value 2) Passed by reference 3) Passed by value-result 1.а - b = 2. a = b = 3. a = b =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