2. Attach Your Java Code and Your Results (You Can Use Snapshots)

Total Page:16

File Type:pdf, Size:1020Kb

2. Attach Your Java Code and Your Results (You Can Use Snapshots)

Student Name: ______

Instructions:

1. Submit you Final Exam using this Microsoft Word Document. The name of the file should be YourfirstnameLastNameFinalCIS355.docx. 2. Attach your Java code and your Results (you can use snapshots). 3. This Final should take no more than 120 minutes. ______

Final Exam Steps (Total: 230):

1. Write the following Program: Account class  Methods: o processDeposit ( ) – accepts a single double parameter containing the deposit amount. Updates the balance by adding the deposit amount to the balance. o processWithdrawal ( ) – accepts a single double parameter containing the withdrawal amount. Updates the balance by subtracting the withdrawal amount for the balance. Note: For now do not worry about negative balances. o calcInterest ( ) – Coded as a double method with an empty body. o ShowMessage() - Coded as a void method accepts an string (the message to be show) show a popup windows saying the message.  Attributes: o String Account Name o Integer Account ID o Double balance  Constructor o Prompt the user and accept input for the Account Name, Account ID and the initial balance. The CheckingAcct class which is a derived class of the Account class.  Attributes: o Inherits all the attributes of the Account class. o The overDraftFee is double and is populated in the constructor of the CheckingAcct class.  Methods: o calcInterest () – If the account balance is greater than or equal to 3000.00 an interest rate of 2% or .02 is applied to increase the balance.  Constructor: o Prompt the user for the OverDraftFee. The SavingsAcct class which is a derived class of the Account class.  Attributes: o Inherits all the attributes of the Account class. o There are no other attributes.  Methods: o calcInterest ( ) – If the account balance is greater than or equal to 5000.00 an interest rate of 4% or .04 is applied to increase the balance. If the balance is greater than or equal to 3000.00 an interest rate of 3% or .03 is applied to increase the balance. Otherwise use an interest rate of 2%. The new balance is returned to the calling program.  Constructor: o Inherited from the Account class. (no code needed) Main: Prompt the user for the bank name and routing number. Create at least two account objects (each of a different type). Process a deposit then withdraw then calculate the interest for each account, then run the ShowMessage() method passing the following string “Congratulation for using this program”. Generate the following report: Bank Name: XXXXXXXX Routing Number: XXXXXX Account Name: XXXXXX Account ID: XXXXXXXXX Balance: 9999.99 Account Name: XXXXXX Account ID: XXXXXXXXX Balance: 9999.99

2. Write a Java program to the form below. The program must work with decimal numbers and each button must work correctly. The result must be done in a popup window. The division must check if the number 2 is ‘0” if then send a message “You can’t divide by zero” otherwise make the divivion: GOOD LUCK!!!!!!!!!!!!

Recommended publications