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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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