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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education