Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

I need to find a way to get a static method called balanceCheckbook that takes a console Scanner as a parameter and that prompts a user for information about transactions for a bank account, reporting the new balance after each transaction and the minimum balance at the end and returning whether or not the account was ever overdrawn (true if it was, false if it was not). The user needs to be prompted for an initial balance, the number of transactions to process, and the individual transaction amounts. Deposits to the account are entered as positive numbers and checks and ATM withdrawals are entered as negative numbers. A new balance is reported

after each transaction. For example, the method would be called as follows:

Scanner console = new Scanner(System.in);

balanceCheckbook(console);

Below are two sample logs of execution that might be produced:

initial balance? 48.50                          initial balance? 39.75

how many transactions? 4                  how many transactions? 5

1/4 amount? -20.00                            1/5 amount? -18.50

new balance = $28.5                          new balance = $21.25

2/4 amount? -5.75                              2/5 amount? -7.20

new balance = $22.75                        new balance = $14.05

3/4 amount? 138.20                            3/5 amount? -23.10

new balance = $160.95                       new balance = $-9.05

4/4 amount? -20.00                             4/5 amount? 50.00

new balance = $140.95                       new balance = $40.95

minimum balance = $22.75                5/5 amount? -8.45

new balance = $32.5                            minimum balance = $-9.05

In the log to the left, the user enters 4 different transactions and the minimum balance is not negative, so the method would return false to indicate that the account was never overdrawn. In the log to the right, the user enters 5 transactions and the minimum balance is negative, so the method would return true to indicate that the account was overdrawn. You are to exactly reproduce the format of these logs. You may assume that the number of transactions entered by the user is at least 1.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92727351
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Query to reterieve data from a customers table in mysql for

Query to reterieve data from a customers table in MySQL for instance who have not placed any orders yet, How to sort results by customers number,How to Modify the query to list customers who have placed fewer than five o ...

Research 3 risk estimation methodswrite a short explanation

Research 3 risk estimation methods. Write a short explanation of each method to someone with little knowledge of information security or risk. Compare the advantages and disadvantages the three methods above?

A swimmer is an athlete any athlete who participated in the

A swimmer is an athlete. Any athlete, who participated in the 2016 Summer Olympics and won a gold medal, was joyful. Any athlete, who is the world top athlete or a selected well-trained athlete, participated in the 2016 ...

How do you calculate the annual interest rate of 12

How do you calculate the annual interest rate of 12% compounded monthly. I know how to do for annually but not monthly. You are offered the opportunity to put some money away for retirement. You will receive 10 annual pa ...

Question suppose the array begins with 0 followed by the

Question : Suppose the array begins with 0, followed by the remaining even integers in descending order, followed by the odd numbers in descending order. (For n = 8, the array would be [0,8,6,4,2,7,5,3,1].) How many comp ...

A a simple encryption of a character a can be performed by

a) A simple encryption of a character A can be performed by exclusive-ORing A with some key K to produce the encrypted value E. The original value A can be recovered by exclusive-ORing again with the same key. Write a c/ ...

Select one of the methods that makes the most sense to you

Select one of the methods that makes the most sense to you, and list the steps in detail. Imagine that you're tutoring another student in how to calculate subnets, and be sure to include enough detail that the steps woul ...

Question interface design guidelines please respond to the

Question: "Interface Design Guidelines" Please respond to the following: • Imagine you are leading a team of designers for a new software product. During the kickoff meeting, the team starts to discuss design guidelines. ...

Discuss how today the internet has brought millions of

Discuss how today, the internet has brought millions of unsecured computer networks into communication with each other.

Question research the internet to obtain information on

Question: Research the Internet to obtain information on Windows Group Policies and the Group Policy Editor. • Review the critical considerations to prepare a procedure guide. • Organize all the steps necessary for imple ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As