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

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter4: Constraints
Section: Chapter Questions
Problem 3MC: Which of the following SQL statements is invalid and returns an error message? ALTER TABLE books ADD...
icon
Related questions
Question

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

 

For 6 customers enter the name and in the next line the balance
Sam
69.8
Mary
225
Mark
189.5
Ana
34.5
Johnny
446.7
Jessy
88.6
Search for all customers who have less than $150
Sam
Ana
Jessy
The average balance is: 175.6833333333333
The customer with the highest balance is: Johnny
The customer with the lowest balance is: Ana
Show all accounts after a 15% balance increase
Sam has
Mary has
Mark has
Ana has
Johnny has
Jessy has
$80.27
$258.75
$217.925
$39.675
$513.7049999999999
$101.88999999999999
Transcribed Image Text:For 6 customers enter the name and in the next line the balance Sam 69.8 Mary 225 Mark 189.5 Ana 34.5 Johnny 446.7 Jessy 88.6 Search for all customers who have less than $150 Sam Ana Jessy The average balance is: 175.6833333333333 The customer with the highest balance is: Johnny The customer with the lowest balance is: Ana Show all accounts after a 15% balance increase Sam has Mary has Mark has Ana has Johnny has Jessy has $80.27 $258.75 $217.925 $39.675 $513.7049999999999 $101.88999999999999
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning