Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

More Books

Students also viewed these Databases questions

Question

How organized or ready for action on this issue is this public?

Answered: 1 week ago