You must write a public abstract class named BankAccount with fields and methods as defined below....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You must write a public abstract class named BankAccount with fields and methods as defined below. BankAccount <<abstract>> # accountID: String # interestRate: double # currentBalance : int + credit(pennies: int): boolean + debit(pennies: int): boolean<<abstract>> + getBalance() : int + getAccountID() : String + setAccountID(accountID: String) + getinterestRate() : double + setInterestRate (interestRate: double) + applyinterest()<<abstract>> + accountInfo(): String<<abstract>> UML CLass Diagram: BankAccount Structure of the Fields As described by the UML Class Diagram above, your BankAccount class must have the following fields: • a protected field named accountID of type String, initialized to "0000-0000-0000-0000" • a protected field named interestRate of type double, initialized to 0.0 • a protected field named currentBalance of type int, initialized to 0 Structure of the Methods As described by the UML Class Diagram above, your BankAccount class must have the following methods: • a public method named credit that takes an int argument and returns a boolean • a public abstract method named debit that takes an int argument and returns a boolean • a public method named getBalance that takes no arguments and returns an int • a public method named getAccount ID that takes no arguments and returns an String Structure of the Methods As described by the UML Class Diagram above, your BankAccount class must have the following methods: • a public method named credit that takes an int argument and returns a boolean • a public abstract method named debit that takes an int argument and returns a boolean • a public method named getBalance that takes no arguments and returns an int • a public method named getAccount ID that takes no arguments and returns an String • a public method named setAccount ID that takes a string argument and returns nothing • a public method named getInterestRate that takes no arguments and returns a double • a public method named setInterestRate that takes a double argument and returns nothing • a public abstract method named apply Interest that takes no arguments and returns nothing • a public abstract method named account Info that takes no arguments and returns a String Behavior of the Methods • The credit method should add the argument amount to the currentBalance • The debit method is abstract so there will be no behavior or method body • The getBalance method should return the currentBalance • The getAccountID method should return the accountID • The setAccount ID method should store the argument value in the account ID field • The getBalance method should return the currentBalance • The getInterestRate method should return the interestRate • The setInterestRate method should store the argument amount in the interestRate field • The apply Interest method is abstract so there will be no behavior or method body • The accountInfo method is abstract so there will be no behavior or method body Additional Information • Since this is an abstract class, you will not be able to instantiate any object from it. • You are given a TestAccount class that inherits\extends the BankAccount class. you may use this to help with testing your BankAccount class. Additional Information • Since this is an abstract class, you will not be able to instantiate any object from it. • You are given a TestAccount class that inherits\extends the BankAccount class. you may use this to help with testing your BankAccount class. • You are also given a Main class whith a main method where you can write code to test your BankAccount class. All Bank Accounts 1. All accounts have balance, credit and debit amounts, and fees stored and passed as a number of pennies (int). 2. All debit amounts will be subtracted from the balance, and all credit amounts will be added to the balance. 3. All bank accounts have a non-negative interest rate (0.02 would be a 2% interest rate). 4. The credit method will always return true. Need Help? Additional help resources are available by clicking on the words "Need Help?" at the bottom of this page, and search for help or ask a question! Copyright 2021 Arizona State University - This content is protected and may not be shared, uploaded, sold, or distributed in whole or part. Copying any part of these instructions or any part of a solution and sharing online or otherwise in any form is a violation of copyright laws and the ASU Academic Integrity Policy. All violations will be prosecuted. 408928.2384696.qx3zqy7 LAB ACTIVITY 14.1.1: Bank Account (Individual Assignment) Downloadable files BankAccount.java TestAccount.java and Main.java Download Current file: BankAccount.java ▾ 0/100 Load default template... You must write a public abstract class named BankAccount with fields and methods as defined below. BankAccount <<abstract>> # accountID: String # interestRate: double # currentBalance : int + credit(pennies: int): boolean + debit(pennies: int): boolean<<abstract>> + getBalance() : int + getAccountID() : String + setAccountID(accountID: String) + getinterestRate() : double + setInterestRate (interestRate: double) + applyinterest()<<abstract>> + accountInfo(): String<<abstract>> UML CLass Diagram: BankAccount Structure of the Fields As described by the UML Class Diagram above, your BankAccount class must have the following fields: • a protected field named accountID of type String, initialized to "0000-0000-0000-0000" • a protected field named interestRate of type double, initialized to 0.0 • a protected field named currentBalance of type int, initialized to 0 Structure of the Methods As described by the UML Class Diagram above, your BankAccount class must have the following methods: • a public method named credit that takes an int argument and returns a boolean • a public abstract method named debit that takes an int argument and returns a boolean • a public method named getBalance that takes no arguments and returns an int • a public method named getAccount ID that takes no arguments and returns an String Structure of the Methods As described by the UML Class Diagram above, your BankAccount class must have the following methods: • a public method named credit that takes an int argument and returns a boolean • a public abstract method named debit that takes an int argument and returns a boolean • a public method named getBalance that takes no arguments and returns an int • a public method named getAccount ID that takes no arguments and returns an String • a public method named setAccount ID that takes a string argument and returns nothing • a public method named getInterestRate that takes no arguments and returns a double • a public method named setInterestRate that takes a double argument and returns nothing • a public abstract method named apply Interest that takes no arguments and returns nothing • a public abstract method named account Info that takes no arguments and returns a String Behavior of the Methods • The credit method should add the argument amount to the currentBalance • The debit method is abstract so there will be no behavior or method body • The getBalance method should return the currentBalance • The getAccountID method should return the accountID • The setAccount ID method should store the argument value in the account ID field • The getBalance method should return the currentBalance • The getInterestRate method should return the interestRate • The setInterestRate method should store the argument amount in the interestRate field • The apply Interest method is abstract so there will be no behavior or method body • The accountInfo method is abstract so there will be no behavior or method body Additional Information • Since this is an abstract class, you will not be able to instantiate any object from it. • You are given a TestAccount class that inherits\extends the BankAccount class. you may use this to help with testing your BankAccount class. Additional Information • Since this is an abstract class, you will not be able to instantiate any object from it. • You are given a TestAccount class that inherits\extends the BankAccount class. you may use this to help with testing your BankAccount class. • You are also given a Main class whith a main method where you can write code to test your BankAccount class. All Bank Accounts 1. All accounts have balance, credit and debit amounts, and fees stored and passed as a number of pennies (int). 2. All debit amounts will be subtracted from the balance, and all credit amounts will be added to the balance. 3. All bank accounts have a non-negative interest rate (0.02 would be a 2% interest rate). 4. The credit method will always return true. Need Help? Additional help resources are available by clicking on the words "Need Help?" at the bottom of this page, and search for help or ask a question! Copyright 2021 Arizona State University - This content is protected and may not be shared, uploaded, sold, or distributed in whole or part. Copying any part of these instructions or any part of a solution and sharing online or otherwise in any form is a violation of copyright laws and the ASU Academic Integrity Policy. All violations will be prosecuted. 408928.2384696.qx3zqy7 LAB ACTIVITY 14.1.1: Bank Account (Individual Assignment) Downloadable files BankAccount.java TestAccount.java and Main.java Download Current file: BankAccount.java ▾ 0/100 Load default template...
Expert Answer:
Answer rating: 100% (QA)
java public abstract class BankAccount protected String accountI... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Desa Cemerlang Sdn Bhd has been engaged in the process of forecasting its financing needs over the next quarter and has made the following forecasts of planned cash receipts and disbursements: The...
-
When Synthia went overseas for three months, she left her financial affairs and her share portfolio with Michael, her accountant. She gave him clear instructions to sell her 5000 BHP shares if they...
-
A national advertising program that costs $200,000 today is expected return a profit (like interest) of $72,000 in 6 years. Determine: (4 marks) a. The rate of return (interest) using simple...
-
For the couple-stress theory, show that the two stress functions satisfy: = 0= +-zd'0=+
-
Dunnsmore Company reported cost of goods sold of $318,450 on its 2017 income statement. Other information for Dunnsmore is as follows: 1/1/2017 12/31/2017...
-
What is Foyle talking about here? Is he correct about the effect this has?
-
The \(n=3\) state of hydrogen has \(E_{3}=-1.51 \mathrm{eV}\). a. Why is the energy negative? b. What is the physical significance of the specific number \(1.51 \mathrm{eV}\) ?
-
Por Corporation acquired its 90 percent interest in Sam Corporation at its book value of $1,800,000 on January 1, 2011, when Sam had capital stock of $1,500,000 and retained earnings of $500,000. The...
-
Post about the crisis and leader to which you are assigned, as follows: Cuban Missile Crisis President John F. Kennedy Using the internet for scholarly sources related to your assigned crisis and...
-
Spears was seeking employment and negotiating both with Amazon.com and with a firm called Intelligrated. Amazon made 2 offers to Spears which he rejected, because he believed they did not pay enough,...
-
All employees are supervised in the same way. Elaborate the statement?
-
Two customers ordered online food delivery, and their orders were assigned to the same delivery person because they lived close by each other. The delivery person was trapped in traffic jam. While...
-
Find the accumulated amount A if the principal P is invested at the interest rate of r/year for t years. (Use a 365-day year. Round your answer to the nearest cent.) A = $ P = $120,000, r = 2%, t =...
-
In today's world of constant change in technology, we must ensure that we are always up to date with the latest operating systems. Research and determine the best solution for a medium-sized business...
-
Where T is the time period (seconds) L is the length of the pendulum (metre) g is the acceleration due to gravity (g = 9.81 m/s2) Calculate an estimate of the expected percentage error in the time...
-
If you walked into a lab, and found the circuit in the picture connected, what will be the reading on the voltmeter? 24 V 10:1 5 Ohms
-
What is Q-Point? What is stiff voltage divider? What are the emitter voltage, VE, and current, le? 1. 2. 3. 12 k2 Boc -200 RE 089. 4. Compare Va for the case where b= 100 and b = 200. +15 RC 1.8 kS2...
-
Give the structural formulas of the alkenes that, on ozonolysis, give: a. (CH3)2C=O and CH2=O b. Only (CH3CH2)2C=O c. CH3CH=O and CH3CH2CH=O d. O=CHCH2CH2CH2CH=O
-
Consider a class that could be used to play a game of hangman. The class has the following attributes: The secret word. The disguised word, in which each unknown letter in the secret word is replaced...
-
Repeat any of the previous programming projects using JOptionPane, which is described in the graphics supplement. Previous programming projects The Harris-Benedict equation estimates the number of...
-
Suppose we attend a party. To be sociable, we will shake hands with everyone else. Write a fragment of code using a for statement that will compute the total number of handshakes that occur. Upon...
-
One kg weighs 10 N on Earth. Would it weigh more or less on the Moon?
-
Where would your weight be greateron Earth or on the Moon? Where would your mass be greater?
-
What two main ideas of Aristotle did Galileo discredit?
Study smarter with the SolutionInn App