Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Zewd Review View Help Graimmarly Tell Want S Internet Contain Vinuses Unless Need Edil Ies Q35613922

Zewd Review View Help Graimmarly Tell me what you want to do s from the internet can contain vinuses. Unless you need to edil

A double called limit, which will hold the maximum that can be withdrawn at one time from that account. o o A double called M

Methods: Since BankAccount implements Accountinterface, it will need to have the methods defined in the interface. Implement

2. Create a new account (any variable name you want)-pass in YOUR name Tell it to deposit 45.00 Tell it to withdraw 20 Print

la to edrt, its safer to stay in Protected View. Enable Editing Extra Credit (optional, 6 pts): The variables that will hold

from the Internet can contain viruses. Unless you need to edit, ts safer to stay in Protected View. Enable Editing Comments

C++, code blocker

Zewd Review View Help Graimmarly Tell me what you want to do s from the internet can contain vinuses. Unless you need to edil iesse to stay Protected VrwEruble Edting BankAccount For this program, you will be the creator of a class (in Part1) and later the user of the class (in Part2). You will have to be familiar with classes, methods, passing things in and out of methods, constructors static data/methods, exception handling, interfaces, and “aggregate”,-has a-classes. The problem: You are to write a class called BankAccount, which will simulate a user’s bank account. You can use my Program5 as the “driver that will create instances and tell them to do things (through their methods) Then you will add some code to the Program5 to create other instances and tell them to do things. The BankAccount class: this class should implement Accountinterface and have the following: Data: it should have the following data. I have suggested variable names to heip in understanding what they do and to make the explanations clearer anything you want (as long as the name is meaningful), You can name them o A double called balance, which will hold the balance for that account. o A string called name, which will hold the name for that account. o A Date called creationDate, which will contain a reference to a Date that holds the creation date o A boolean calied frozen, which keeps track of whether or not the account is Trozen (cannot be accessed) A double called limit, which will hold the maximum that can be withdrawn at one time from that account o A double called limit, which will hold the maximum that can be withdrawn at one time from that account. o o A double called MAXI.IMIT, which will be a constant set to 500. This will be the maximum that the withdrawal limit can be set to. An int called accountNumber, which will hold the account number for that account. o A static int called howMany. The BankAccount class will use this to keep track of how many individual accounts have been created. o > Constructors: it should have the following 2 constructors. A default constructor (which receives no arguments). It should set the account’s name field to “classified” and the other fields s constructor (below) hould be set to the same initial values as the other o A parameterized constructor which receives 1 argument- the name (a string) of the person who has the account. It should do the following: Set the account’s name to the name that is passed in Create the creationDate using the default constructor of the Date class. It will initialize the creationDate to the current time (from the computer clock). v’ Set frozen to false: Set the limit to 300 (always, does not depend on what is passed in). Add 1 to howMany (so the class knows how many accounts are now created) Then set the accountNumber to hov Many be #3) v’ if there are now 3 accounts, then this will Set the balance to 0 Methods: Since BankAccount implements Accountinterface, it will need to have the methods defined in the interface. Implement all of the other methods listed in the Accountinterface. Please see the comments in Accountlnterface for their descriptions. o Part 1: Write your BankAccount class and compile it (with Date class as an “aggregate’, “has-a” class). Be sure to follow the rules of each BankAccount function given in Accountinterface.cpp. Program5 is used as a “driver” to create accounts and tell them to do things. The expected results from running Program5 java can be seen in ‘output.txt Part 2: Once your BankAccount class is working, add to the botton of Program5. Have it implement the following functionality inside main. Notice there are 3 sections (create/use 3 accounts). Put each of the 3 sections into a separate try-catch block; for each one make sure that every possible type of exception can be caught (either by having multiple catch blocks or by setting it up to catch every possible type of exception). You can just printException() if it is caught Create a new account (any variable name you want – pass in “Steve Nash Tell it to deposit 10 Tell it to withdraw 60 Print it using toString). 2. Create a new account (any variable name you want)-pass in YOUR name Tell it to deposit 45.00 Tell it to withdraw 20 Print it using toString). 3. > Create a new account (any variable name you want) – pass in “Scam Artist Tell it to deposit 10 Tell it to withdraw 260 > Print it using toString). 4. Now that you have created three new BankAccount instances, print out the total number of BankAccounts created. la to edrt, it’s safer to stay in Protected View. Enable Editing Extra Credit (optional, 6 pts): The variables that will hold money should be doubles (because of decimals). However, they will not automatically print out like money. After your program is working, make the following changes to have them print out like money In Program5, call methods in cout to set numbers to fixed with 2 decimal places. Please note that numbers coming from BankAcount functions will NOT be formatted with 2 decimals, only for a cout done in the Program5 main. Extra Credit (optional, 6 pts) Create a new class called lilegalWithdrawalException. Make it a public subclass of Exception. It should be modeled after the existing llegalArugmentException. Once your IllegalWithdrawalException compiles, change the BankAccount code so that it throws a new IllegalWithdrawalException instead of an illegalArgumentException for any of the bad conditions in the withdraw method. Change Program5 to catch the new llegalWithdrawalException instead of lllegalArgumentException. Finaly, go back to your Part2 and change the try-catch blocks everywhere so that they will also catch an llegaWithdrawalException. You can do this either by adding another catch block to the existing code everywhere or by changing the catch blocks so that the same catch block will the IllegalArgumentExceptions, llegalWithdrawalExceptions, and IliegalStateExceptions. Comments and indenting: from the Internet can contain viruses. Unless you need to edit, t’s safer to stay in Protected View. Enable Editing Comments and indenting: At the top of the program (class) should be a short comment which describes its purpose. It should also have your name and class on a separate line. In the code itself, indent inside the class and thern for loops. Also indent inside if statements and the else part. needed to describe “sections” of code. again inside main. Indent inside while loops and Put a blank line and then a comment as Finally, make sure that your variable names are meaningtul Handing in the program: Please submit your entire pgm5BankAccount project as a zip file in Canvas. Show transcribed image text Zewd Review View Help Graimmarly Tell me what you want to do s from the internet can contain vinuses. Unless you need to edil iesse to stay Protected VrwEruble Edting BankAccount For this program, you will be the creator of a class (in Part1) and later the user of the class (in Part2). You will have to be familiar with classes, methods, passing things in and out of methods, constructors static data/methods, exception handling, interfaces, and “aggregate”,-has a-classes. The problem: You are to write a class called BankAccount, which will simulate a user’s bank account. You can use my Program5 as the “driver that will create instances and tell them to do things (through their methods) Then you will add some code to the Program5 to create other instances and tell them to do things. The BankAccount class: this class should implement Accountinterface and have the following: Data: it should have the following data. I have suggested variable names to heip in understanding what they do and to make the explanations clearer anything you want (as long as the name is meaningful), You can name them o A double called balance, which will hold the balance for that account. o A string called name, which will hold the name for that account. o A Date called creationDate, which will contain a reference to a Date that holds the creation date o A boolean calied frozen, which keeps track of whether or not the account is Trozen (cannot be accessed) A double called limit, which will hold the maximum that can be withdrawn at one time from that account o
A double called limit, which will hold the maximum that can be withdrawn at one time from that account. o o A double called MAXI.IMIT, which will be a constant set to 500. This will be the maximum that the withdrawal limit can be set to. An int called accountNumber, which will hold the account number for that account. o A static int called howMany. The BankAccount class will use this to keep track of how many individual accounts have been created. o > Constructors: it should have the following 2 constructors. A default constructor (which receives no arguments). It should set the account’s name field to “classified” and the other fields s constructor (below) hould be set to the same initial values as the other o A parameterized constructor which receives 1 argument- the name (a string) of the person who has the account. It should do the following: Set the account’s name to the name that is passed in Create the creationDate using the default constructor of the Date class. It will initialize the creationDate to the current time (from the computer clock). v’ Set frozen to false: Set the limit to 300 (always, does not depend on what is passed in). Add 1 to howMany (so the class knows how many accounts are now created) Then set the accountNumber to hov Many be #3) v’ if there are now 3 accounts, then this will Set the balance to 0
Methods: Since BankAccount implements Accountinterface, it will need to have the methods defined in the interface. Implement all of the other methods listed in the Accountinterface. Please see the comments in Accountlnterface for their descriptions. o Part 1: Write your BankAccount class and compile it (with Date class as an “aggregate’, “has-a” class). Be sure to follow the rules of each BankAccount function given in Accountinterface.cpp. Program5 is used as a “driver” to create accounts and tell them to do things. The expected results from running Program5 java can be seen in ‘output.txt Part 2: Once your BankAccount class is working, add to the botton of Program5. Have it implement the following functionality inside main. Notice there are 3 sections (create/use 3 accounts). Put each of the 3 sections into a separate try-catch block; for each one make sure that every possible type of exception can be caught (either by having multiple catch blocks or by setting it up to catch every possible type of exception). You can just printException() if it is caught Create a new account (any variable name you want – pass in “Steve Nash Tell it to deposit 10 Tell it to withdraw 60 Print it using toString).
2. Create a new account (any variable name you want)-pass in YOUR name Tell it to deposit 45.00 Tell it to withdraw 20 Print it using toString). 3. > Create a new account (any variable name you want) – pass in “Scam Artist Tell it to deposit 10 Tell it to withdraw 260 > Print it using toString). 4. Now that you have created three new BankAccount instances, print out the total number of BankAccounts created.
la to edrt, it’s safer to stay in Protected View. Enable Editing Extra Credit (optional, 6 pts): The variables that will hold money should be doubles (because of decimals). However, they will not automatically print out like money. After your program is working, make the following changes to have them print out like money In Program5, call methods in cout to set numbers to fixed with 2 decimal places. Please note that numbers coming from BankAcount functions will NOT be formatted with 2 decimals, only for a cout done in the Program5 main. Extra Credit (optional, 6 pts) Create a new class called lilegalWithdrawalException. Make it a public subclass of Exception. It should be modeled after the existing llegalArugmentException. Once your IllegalWithdrawalException compiles, change the BankAccount code so that it throws a new IllegalWithdrawalException instead of an illegalArgumentException for any of the bad conditions in the withdraw method. Change Program5 to catch the new llegalWithdrawalException instead of lllegalArgumentException. Finaly, go back to your Part2 and change the try-catch blocks everywhere so that they will also catch an llegaWithdrawalException. You can do this either by adding another catch block to the existing code everywhere or by changing the catch blocks so that the same catch block will the IllegalArgumentExceptions, llegalWithdrawalExceptions, and IliegalStateExceptions. Comments and indenting:
from the Internet can contain viruses. Unless you need to edit, t’s safer to stay in Protected View. Enable Editing Comments and indenting: At the top of the program (class) should be a short comment which describes its purpose. It should also have your name and class on a separate line. In the code itself, indent inside the class and thern for loops. Also indent inside if statements and the else part. needed to describe “sections” of code. again inside main. Indent inside while loops and Put a blank line and then a comment as Finally, make sure that your variable names are meaningtul Handing in the program: Please submit your entire pgm5BankAccount project as a zip file in Canvas.

Leave a Reply

Your email address will not be published. Required fields are marked *