Question
java Create a Customer class that encapsulates the concept of a customer, assuming that a customer has the following attributes: a name and a credit
java
Create a Customer class that encapsulates the concept of a customer, assuming that a customer has the following attributes: a name and a credit score. Include a constructor and setter/getter methods for name and credit score. Create a CustomerCreator class to test all the methods in your class.
Student Class
Include a name and creditScore class fields (instance variables). Initialize the name variable to null and the credit score variable to 300. (2 points)
Include a constructor to set the name and creditScore of the customer when the object is created. The constructor should take in two parameters and should call setter methods for name and creditScore.
Create a setName method that sets the value of the customers name.
Create a getName method that returns the name of the customer.
Create a setCreditScore method.
Add validation to the setCreditScore method. Credit score must be at least 300, otherwise it should be set to 300.
Create a getCreditScore method that returns the credit score of the customer.
Create a getCreditRating method that returns the rating of the credit score this will be based on the credit score field.
Bad (Score 200-629)
Fair (Score 630-689)
Good (Score 690-719)
Excellent (Score 720-850)
CustomerCreator Class
Create a customer object including a name and a credit score.
Call the getName, getCreditScore, and getCreditRating for this student and print the results.
Example Output: Name: Bob Smith Credit Score: 640 Credit Rating: Fair
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