Compute the sum of balances of all the customer accounts

Assignment Help Computer Engineering
Reference no: EM132210007

Question :

Write a program CustomerAccountArray that manages an array of CustomerAccount objects by performing these steps:

Asks the user how many different CustomerAccounts to create

Make a new array to hold the specified number of CustomerAccount objects

In a loop for the specified number of accounts, ask the user for the customer name, customer account number, and initial customer balance, construct a new CustomerAccount object with the data, and put the new CustomerAccount object in the array

After the user has entered all the customer account data, use a for loop (or a for each loop) to compute the sum of balances of all the customer accounts in the array.

Print the computed sum of the balances.

Use the provided CustomerAccount.java class for your CustomerAccount objects. Implement the main() method in the CustomerAccountArray.java class to do the five steps outlined above.

Do not assume there will always be 3 customer accounts.

If you do not use the exact class names (with the capital letters specified), the automatic testing program will not be able to run your program and points will be lost.

Be sure to read the input values in exact order as shown so the automatic testing program can provide the input correctly to your program.

Be sure to enter your name in the @author in the comment at the top of the CustomerAccountArray.

Sample run (user input in bold font):

Enter the number of customer accounts: 3

Enter customer name: Applied Ag

Enter customer account number: 1524

Enter customer initial balance: 1536.45

Enter customer name: Deer John

Enter customer account number: 1530

Enter customer initial balance: 607.11

Enter customer name: Avero

Enter customer account number: 1545

Enter customer initial balance: 1670.45

Total customer account balance is 3814.01


Please submit both the CustomerAccountArray.java file that you modify and the CustomerAccounts.java file so we can test your program.

You can use this as your outline for the main(String[] args) method in the CustomerAccountArray class:

Scanner in = new Scanner(System.in);

// Ask the user for the number of customer accounts.

// Create a CustomerAccount array to hold the specified

// number of customer account objects.

// Discard the remaining "newline" in Scanner's buffer.

in.nextLine();

// Loop to create the customer accounts:

for (...)

{

// Ask the user to enter the customer name,

// customer account number, and initial account balance.

// Construct a CustomerAccount object using the information

// provided by the user.

// Store each new CustomerAccount object into the array

// created above.

 

// Then, discard remaining "newline" in Scanner's buffer.

in.nextLine();

}

// Loop: Compute the sum of the account balances.

// Print the sum of the account balances.

Reference no: EM132210007

Questions Cloud

What is the purpose of the auditors opinion and report : ACT450: AUDITING ASSIGNMENT, Colorado State University, USA. What is the purpose of the auditors' opinion and report
How many years 10 employees have to work before retiring : Prompt the user to enter the current age and desired retirement age for 10 employees . Current ages can be between 19 and 70.
Write a program that defines and initializes an object : Write a program that defines and initializes an object with four members, and a pointer to the object.
Write description of the business-related challenges : Create a short paper that includes the following critical elements in this assignment: A description of the business-related challenges faced by organization.
Compute the sum of balances of all the customer accounts : The user has entered all the customer account data, use a for loop to compute the sum of balances of all the customer accounts in the array.
Write a program that will emulate a cash register : Write a program that will emulate a cash register. Prompt the user to input the price of three items.
What is difference between express warranties and puffing : What is the difference between express warranties and puffing?
Create a polyline shape dynamically using mouse clicks : Write a program that creates a polyline shape dynamically using mouse clicks.
Write a program that determines the best possible meeting : Write a program that determines the best possible meeting time for four people.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd