Get a static method called balancecheckbook

Assignment Help Basic Computer Science
Reference no: EM131899005

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.

Reference no: EM131899005

Questions Cloud

Calculate the required stock purchase : Calculate the loan principal. Calculate the required stock purchase.
Examine why the site is relevant : You will be required to find and analyze an internet resource site that is relevant to parent-child relationships.
Is a nat server a firewall : Is a NAT server a firewall? What are some similarities and differences?
Growth rate and the required return are unaffected : What is the stock’s price if the required return is 8 percent? What happens to the stock’s price if the growth rate and the required return are unaffected?
Get a static method called balancecheckbook : 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
Review the various ethical guidelines in learning resources : Forensic psychology professionals have at least two codes that guide their research and practice: the American Psychological Association's Ethical Principles.
Accomplishing corporate objectives : Having staff with the proper skill sets is immensely important to accomplishing corporate objectives.
How should companies manage or act in regard to this issue : Draft an outline and create a reference list . Create an outline of your paper with main topics and sub topics clearly organized.
Calculate conversion value-market conversion premium ratio : Calculate the following Conversion value, Market conversion price, Market conversion premium ratio

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What is its bandwidth at 60 db down

A receiver's IF filter has a shape factor of 2.5 and a bandwidth, at the 6 dB down points, of 6 kHz. What is its bandwidth at 60 dB down?

  Discuss how much system memory do you have ram

Discuss how much system memory do you have RAM? Do you have a 32-bit or 64-bit machine? A CPU can process 32 bits of information or 64 bits of information.

  What are your observations

Using the MATLAB instruction cond, find the condition numbers of Hilbert matrices for n = 4,5,...,12. Plot these condition numbers as a function of n using semilogy. What are your observations?

  What is the advantage of parallel form over the cascade form

It is argued that for a rational system function, its cascade form structure is not unique. Do you agree or disagree? Explain.

  How to protect yourself from computer crimes

Evaluate how vulnerable or susceptible society is today, with respect to this computer crime.

  Calculate the cost and schedule variances

For each activity, which of the following could be the root cause reason for the variances? Select as many as you think may apply.

  Three strategic considerations

If you were a media planner for a large Fortune 500 company (your choice), what would be your top three strategic considerations.

  What is the minimum required running time

What is the minimum required running time, using big-omega to represent, of adding a value to the end of the arraylist

  Discuss the choice of programming language

CSS 422 . Discuss the choice of programming language and its relation to architecture, and the design decision in one of these six categories: If you were the software architect of an online election system for your county, how would you define the t..

  What a pre-processor does in a network-based ids tool

Describe what a pre-processor does in a network-based IDS tool such as Snort. Demonstrate your understanding of this functionality by citing two examples of pre-processors and explaining what function they serve in the process of network traffic a..

  How does this affect the behavior of the model

Agents use the patch color under other agents to determine whether to cooperate with them or not. How does this affect the behavior of the model?

  Dealing with bribery and corruption

Most recommendations for dealing with bribery and corruption are economic in nature; for example raising salaries, increasing punishment, and stepping up surveillance. Are there other ways to deal with corruption and bribery from a broad, social p..

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