Write a code for a banking program. a) In this question, first, you need to create a Customer class, this class should have: • 2 private attributes: name (String) and balance (double) • Parametrized constructor to initialize the attributes • Methods: i. public String toString() that gives back the name and balance ii. public void addPercentage; this method will take a percentage value and add it to the balance b) Second, you will create a driver class and ask the user to enter 6 customers’ information and then you will create an array of Customer objects. c) Then you use this array used for various operations as shown in the output. • Using the array of customer objects, you need to search for all customers who have less than $150 • Using the array of customer objects, you need to get the average balance of the balances in this array • Using the array of customer objects, you need to get the customer with the highest balance and lowest balance • Using the array of customer objects, you need to show all accounts after a 15% balance increase You need to use loop/conditionals class variables must be private
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Write a code for a banking program.
a) In this question, first, you need to create a Customer class, this class should have:
• 2 private attributes: name (String) and balance (double)
• Parametrized constructor to initialize the attributes
• Methods:
i. public String toString() that gives back the name and balance
ii. public void addPercentage; this method will take a percentage value and
add it to the balance
b) Second, you will create a driver class and ask the user to enter 6 customers’ information
and then you will create an array of Customer objects.
c) Then you use this array used for various operations as shown in the output.
• Using the array of customer objects, you need to search for all customers who
have less than $150
• Using the array of customer objects, you need to get the average balance of the
balances in this array
• Using the array of customer objects, you need to get the customer with the
highest balance and lowest balance
• Using the array of customer objects, you need to show all accounts after a 15%
balance increase
You need to use loop/conditionals
class variables must be private
Step by step
Solved in 3 steps with 3 images