Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a Folder in your Java Code Folder called assignment1- . Open VSCode and open that folder. Create an enumerated type called BirthdayMonth that has
- Create a Folder in your Java Code Folder called assignment1-
. Open VSCode and open that folder. - Create an enumerated type called BirthdayMonth that has the following possible values:
- JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, NOV, DEC
- Create a class called Customer:
- The customer needs a first name, a last name, a customer ID, a BirthdayMonth, and an email address.
- Build a constructor that takes firstName, lastName, birthdayMonth, and emailAddress. Notice that you are not asking for customerID. You will generate your ownCustomerID that is unique for every Customer object
- Add a class (static) variable called nextAvailableID to your Customer Class.
- In the constructor, you will assign the value of the class variable, nextAvailableID, to the instance variable customerID and then you will increment the nextAvailableID by one.
- That way, each time you instantiate a new Customer Object, the customerID will be unique and 1 greater than the last customerID assignened. This works because nextAvailableID is static and exists outside of any objects.
- Write a class called Start
- that will instantiate a customer using realistic data
- Print out the customerID for this customer. It should be 0.
- Instantiate a second customer. Its customerID should automatically be 1.
- Create a ragged array of Customers with 3 Customers in the first row and 2 Customers in the second row. Again, use realistic data when creating these Customers
- Use loops to print out the names of all Customers in the following format:
Customer1, Customer2, Customer3
Customer4, Customer5
- Write a Customer Relationship Management class called CRM that :
- Contains an instance variable called customers that is an Array that can hold 20 references to Customer objects.
- Contains an instance variable called numCustomers that always has the number of customers that have been added to the CRM system.
- A method called addCustomer that accepts a Customer, correctly adds that Customer to the customers array, and increments the numCustomers variable.
- A method called getAllCustomerEmails which returns a String containing all Customers email addresses, separated by semi-colons:
Email1; email2; email3; email4; email5;
- A method called printBirthdayCards that will print out birthday cards for every Customer whos birthMonth is equal to the BirthdayMonth that was passed to it.
- For example, if Customer 3 and 5 have birthdays in May, and you called the method printBirthdayCards(BirthdayMonth.MAY) , you would print the following:
Dear
Happy Birthday! In honour of your birthday this month, we are happy to give you this coupon for $2 off on any order over $100,000!
Best Regards,
Dear
Happy Birthday! In honour of your birthday this month, we are happy to give you this coupon for $2 off on any order over $100,000!
Best Regards,
- Return to your main method and write enough code to prove that all your CRM systems works as advertised.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started