Question
a) Define a class named Customer that holds private fields for a customer ID number, last name, first name, and credit limit. Include four public
a) Define a class named Customer that holds private fields for a customer ID number, last name, first name, and credit limit. Include four public functions that each set one of the four fields. Do not allow any credit limit over $10,000. Include a public function that displays a Customers data. Write a main() function in which you declare a Customer, set the Customers fields, and display the results. Save the file as Customer.java.
b) Write a main() function that declares an array of five Customer objects. Prompt the user for values for each Customer, and display all five Customer objects. Save the file as Customer2.java.
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