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

  Advantages and disadvantages of using software

Discuss the fundamental advantages and disadvantages of using software as a service (SaaS) within organizations

  Write the definition for a class named gas pump to be used

Write the definition for a class named Gas Pump to be used to model a pump at an automobile service station. A display of the amount dispensed.

  Draw what that would look like and explain how it works

If we put the P-type transistors in series,and the N-type in parrallel, it will will form a 2-input NOR gate.

  Create application that lets user select two primary colors

Create an application that lets the user select two primary colors from two different sets of Radio buttons. The form should also have a Mix button.

  What is data distribution strategy

The corporation hires and fires store managers and control all information about store managers; store managers hire and fire all store employees and control all information about employees in store.

  Comapre the advantages and disadvantages of using javascript

comapre the advantages and disadvantages of using JavaScript on the client-side. Where JavaScript is blocked or disabled, does that amount to a potentially significant business loss.

  What are the characteristics of the imperative paradigm

What are the characteristics of the imperative paradigm? What are the characteristics of the functional paradigm? What are characteristics of logic paradigm?

  Explain what spyware is

Provide an example of a specific piece of spyware. Explain the key attributes of it using the following template

  It user support activity

Provide an effective support role to users of computer systems - Demonstrate the skills and knowledge necessary to install/upgrade hardware and software for an end-user.

  Traffic light sequence

Give the minimum number of flip flops for such sequence. Be aware that the binary numbers where all the inputs are equal (e.g., 0 and 3) are not being used. You may treat impossible states as don't cares (Justify your answer):

  Project management process

Discuss what do you meant by the project management process in detail? Also state and describe the six project steps, its application to the technology projects.

  Determine whether version with or without sentinel is faster

Determine whether the version with or without a sentinel is faster. For what value of n is the extra time needed to insert a sentinel at the end of a list.

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