Question: 1. Implement the following scenario in C++ programming language. Create a class called Customer. It should have 2 private attributes: string name and int
1. Implement the following scenario in C++ programming language. Create a class called "Customer". It should have 2 private attributes: string name and int age. Provide default constructor, parameterized constructor and getter/setter's for the class. Lastly, implement a print method for your class. This method will print the attributes only. After these steps your class is ready. Now, implement 2 swap functions. Swap1 should take 2 Customer objects as parameters. Swap2 should take 2 Customer object addresses. Both has the same functionality: swap the Customer objects. In main function, declare two Customer objects with your choice of information. Then print them. After that, call swap1 and print the objects again. Did you achieve swap? Call swap2 and print the objects one last time. 2. Try to accomplish same swap behavior in Java programming language. Implement the Customer class from question 1 and implement a swap function. Then, test it. Did you achieve swap? If not, how can it be done?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
