Objective:
You will implement a simple class for managing customer information. You will create a
Customer class with various member functions, and practice returning objects by value from a
function. The goal is to return a new Customer object with updated information based on input
values.
Instructions:
1. Create a Customer class:
o The Customer class should have the following private member variables:
▪ name (string)
▪ id (integer)
▪ balance (double)
2. Constructor:
o Write a constructor to initialize the name, id, and balance when a Customer
object is created.
3. Display Function:
o Implement a member function display() that prints the name, id, and balance of
the customer to the console.
4. Create a Function to Update Customer Information:
o Implement a member function createCustomerWithUpdatedBalance(string
newName, int newId, double newBalance) that:
▪ Takes parameters newName, newId, and newBalance.
▪ Creates and returns a new Customer object with these updated values.
▪ This function should return the new Customer object by value.
5. In the main() function:
o Create an initial Customer object, e.g., "Alice", 1001, 1000.0.
o Call the createCustomerWithUpdatedBalance function to create a new Customer
object with a different name, ID, and balance.
o Print the details of the new Customer object by calling its display() method.