CIS355A Week 3 iLab InheritanceTest and Greeting Java Program

$ 25

CIS355A Week 3 iLab InheritanceTest and Greeting Java Program

Scenario/Summary
In this lab, you will create one project that uses inheritance and one simple Applet.

Deliverables
Program files for each of the following programs
1. InheritanceTest; and
2. Greeting.

iLAB STEPS
Step 1: InheritanceTest
Implement an inheritance hierarchy based on the following specifications for Account class, Checking Account class, and Savings Account class:
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.
• 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 1% or .01 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. 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

Step 2: Greeting
Create an applet of size 500 by 500. The background color of the applet should be yellow. The four components to be included are
1. a Label object that has the text “Please enter your name;”
2. a Textfield object of size 20;
3. a Button object with the text “GREET;” and
4. a Label object with the text “Result goes here.” This label will change to “Hello,” followed by the entered name.
For this lab, you will need the actionPerformed method to provide event handling for the button.
The getText() method will be needed to get the string from the TextField.
The setText() method will be needed to change the text of the second Label.
Test your applet by entering your full name and confirming that the result label has changed.

53 in stock

SKU: CIS355AILAB3N Category:

Description

CIS355A Week 3 iLab InheritanceTest and Greeting Java Program

Scenario/Summary
In this lab, you will create one project that uses inheritance and one simple Applet.

Deliverables
Program files for each of the following programs
1. InheritanceTest; and
2. Greeting.

iLAB STEPS
Step 1: InheritanceTest
Implement an inheritance hierarchy based on the following specifications for Account class, Checking Account class, and Savings Account class:
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.
• 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 1% or .01 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. 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

Step 2: Greeting
Create an applet of size 500 by 500. The background color of the applet should be yellow. The four components to be included are
1. a Label object that has the text “Please enter your name;”
2. a Textfield object of size 20;
3. a Button object with the text “GREET;” and
4. a Label object with the text “Result goes here.” This label will change to “Hello,” followed by the entered name.
For this lab, you will need the actionPerformed method to provide event handling for the button.
The getText() method will be needed to get the string from the TextField.
The setText() method will be needed to change the text of the second Label.
Test your applet by entering your full name and confirming that the result label has changed.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.