Question

*Step1: -Create UML of data type classes: reuse from lab3 for class Account, CheckingAccount and SavingAccount...

*Step1:
-Create UML of data type classes: reuse from lab3 for class Account, CheckingAccount and SavingAccount
-Read the requirement of each part; write the pseudo-code in a word document by listing the step by step what you suppose to do in main() and then save it with the name as Lab4_pseudoCode_yourLastName

*Step2:
-start editor eClipse, create the project→project name:

FA2019_LAB4PART1_yourLastName(part1) OR FA2019_LAB4PART2_yourLastName (part2) -add data type classes (You can use these classes from lab3)

Account_yourLastName.java CheckingAccount_yourLastName.java SavingAccount_yourLastName.java

-Add data structure class:
Stack_yourLastName and Queue_yourLastName (part 1) GenericStack_yourLastName (part2)

-Add the driver class
FA2019_RestrictedStructureDemo_yourLastName (part1) FA2019_EvaluatingInfixedExpression_yourLastName (part2)

*Step3: Write the code of classes:
Re-use the code of data type classes from lab3
Write the code of Stack_yourLastName and Queue_yourLastName (Part1) -using the code on the page 140

And page 160 in the text book for your reference
Write the code of GenericStack_yourLastName (part2) – Using the code on the page 165 in the text book

for your referece with the following notices: Line 8: data = new T [100];

Line13: data = new T [n];
Line20: data[top] = newNode; (just for this lab)

Based on the pseudo-code write the java code of main() of the driver class FA2019_RestrictedStructureDemo_yourLastName (part1) or FA2019_EvaluatingInfixedExpression_yourLastName (part2)

*Step4: compile and run the program
*Step5: debug if there is any errors to complete the program

REQUIREMENT

LAB4 PART1

DATA TYPE CLASSES:
Using the data type classes from lab3:
-class Account_yourLastName
-class CheckingAccount_yourLastName
-class SavingAccount_yourLastName
Using the code on the page from the text book for your reference to produce the class Stack_yourLastName and Queue_yourLastName. Add the code of the following method to Stack_yourLastName or Queue_yourLastName

//This method should be added to Stack_yourLastName public Account_Smith peek()
{

if (top != -1) {

return data[top].deepCopy(); }

return null; }

//This method should be added to Queue_yourLastName public Account_Smith peek()
{

If (numberOfNode !=0) {

return data[front].deepCopy(); }

return null; }

DRIVER CLASS
Provide the pseudo-code or flowchart then write the code for the application FA2019_RestrictedStructureDemo_yourLastName that first display the following menu to select types of data structure:

FA2019_RestrictedStructureDemo_Smith_Smith.java MAIN MENU

  1. Stack Structure

  2. Queue Structure

0. Exit

FOR EACH TYPE OF RESTRICTED STRUCTURE DO THE FOLLOWING TASKS SEQUENTIALLY:

INSERT 3 NODES TO THE STRUCTURE
Ask for the information and read from the keyboard for either CheckingAccount or SavingAccout For each one, insert the account to the data structure.
If Insert successfully display the message “Insert Account success”
Otherwise: display the message: “Insert Accout failed”

DELETE 1 NODE

Remove the node at the top (Stack) or at the front (Queue)
If the node exists, display the information of the node; otherwise display the message: “There is no account in the data structure”

DISPLAY THE NODE AT THE TOP (Stack) / AT THE FRONT (Queue)

Display the node at the top (Stack) or at the front (Queue)
If the node exists, display the information of the node, otherwise display the message: “Stack is empty” or “Queue is empty”

SHOW ALL NODES
Display all the accounts currently stored in the data structure

You should re-display the menu to allow users to continue using your program until they want to exit

---------------------------

class Account
{
public String accNumber;
public String name;
public double balance;
public Account()
{
accNumber="-1";
name="default";
balance=-1;
}
public Account(String acc, String nam, double bal)
{
accNumber=acc;
name=nam;
balance=bal;
}
public void openAccount()
{
System.out.println("Name is "+ name +", account number "+ accNumber+ ", and balance is "+balance);
}
public void checkBal()
{
System.out.println("Account Name: "+name);
System.out.println("Account Number: "+accNumber);
System.out.println("Current Balance: "+balance);
  
}
public void deposit(double amount)
{
balance+=amount;
System.out.println("Account Name: "+name);
System.out.println("Account Number: "+accNumber);
System.out.println("Deposit Amount: "+amount);
System.out.println("New Balance: "+balance);
}
public void withdraw(double amount)
{
if(balance>amount)
{
balance-=amount;
System.out.println("Account Name: "+name);
System.out.println("Account Number: "+accNumber);
System.out.println("Withdrawn Amount: "+amount);
System.out.println("New Balance: "+balance);
}
else
System.out.println("Not enough balance");
}
public void printStatement()
{
System.out.println("Account Name: "+name);
System.out.println("Account Number: "+accNumber);
System.out.println("End Balance: "+balance);
}
};
class CheckingAccount extends Account
{
public double serviceFee;
public CheckingAccount()
{
super();
}

--------------------------
public CheckingAccount(String acc, String nam, double bal,double fee)
{
super(acc,nam,bal);
serviceFee = fee;
}
public void openAccount()
{ System.out.println("Account Type: Checking Account");
super.openAccount();
}
public void checkBal()
{
System.out.println("Account Type: Checking Account");
super.checkBal();
}
public void deposit(double amount)
{
System.out.println("Account Type: Checking Account");
super.deposit(amount);
}
public void withdraw(double amount)
{
System.out.println("Account Type: Checking Account");
super.withdraw(amount);
}
public void calculateFee()
{
super.balance-=super.balance*serviceFee*0.01;
}
public void printStatement()
{
calculateFee();
System.out.println("Account Type: Checking Account");
System.out.println("Service Fee"+serviceFee);
super.printStatement();
}
}
class SavingAccount extends Account
{
public double interestRate;  
public SavingAccount()
{
super();
}

----------------

public SavingAccount(String acc, String nam, double bal,double inter)
{
accNumber=acc;
name=nam;
balance=bal;
interestRate = inter;
}
public void openAccount()
{ System.out.println("Account Type: Saving Account");
super.openAccount();
}
public void checkBal()
{
System.out.println("Account Type: Saving Account");
super.checkBal();
}
public void deposit(double amount)
{
System.out.println("Account Type: Saving Account");
super.deposit(amount);
}
public void withdraw(double amount)
{
System.out.println("Account Type: Saving Account");
super.withdraw(amount);
}
public void calculateInterest()
{
super.balance+=super.balance*interestRate*0.01;
}
public void printStatement()
{
calculateInterest();
System.out.println("Account Type: Saving Account");
System.out.println("Interest Rate: "+interestRate);
super.printStatement();
}
}

using java language

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Can you make the question more clearer. It has dependency on lab 3. So answering it without knowing lab 3 is impossible.

Add a comment
Know the answer?
Add Answer to:
*Step1: -Create UML of data type classes: reuse from lab3 for class Account, CheckingAccount and SavingAccount...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • According to the following information, define Account, CheckingAccount, and TestPart1 classes. 1. Account and CheckingAccount classes...

    According to the following information, define Account, CheckingAccount, and TestPart1 classes. 1. Account and CheckingAccount classes Account - number: int - openDate: String - name: String - balance: double + Account(int, String, String, double) + deposit(double): void + withdraw (double): boolean + transferTo(Account, double): int + toString(): String CheckingAccount + CheckingAccount(int, String, String, double) + transferTo(Account, double): int Given the above UML diagam, define Account and CheckingAccount classes as follow: Account (8 points) • public Account(int nu, String op, String...

  • TASK 1 Create a new class called CheckingAccount that extends BankAccount. It should contain a static...

    TASK 1 Create a new class called CheckingAccount that extends BankAccount. It should contain a static constant FEE that represents the cost of clearing onecheck. Set it equal to 15 cents. Write a constructor that takes a name and an initial amount as parameters. Itshould call the constructor for the superclass. It should initializeaccountNumber to be the current value in accountNumber concatenatedwith -10 (All checking accounts at this bank are identified by the extension -10). There can be only one...

  • Use the Java codes below (Checking Account and Checking Account Demo), and work on these problems....

    Use the Java codes below (Checking Account and Checking Account Demo), and work on these problems. You have to do both of your java codes based on the two provided Java codes. Create one method for depositing and one for withdrawing. The deposit method should have one parameter to indicate the amount to be deposited. You must make sure the amount to be deposited is positive. The withdraw method should have one parameter to indicate the amount to be withdrawn...

  • LAB1 PART 1 FOR THE DATA TYPE CLASS: If you do not have UML of class...

    LAB1 PART 1 FOR THE DATA TYPE CLASS: If you do not have UML of class Account_yourLastName, you should do that first Basesd on the UML, provide the code of data type class Account_yourLastName to hold the information of an account with account number (String), name (String), balance (double), with no-argument constructor, parameter constructor Also, define some methods to handle the tasks: open account, check current balance, deposit, withdraw, and print monthly statement. At the end of each task we...

  • Requirements:  Your Java class names must follow the names specified above. Note that they are...

    Requirements:  Your Java class names must follow the names specified above. Note that they are case sensitive. See our template below.  BankAccount: an abstract class.  SavingAccount: a concrete class that extends BankAccount. o The constructor takes client's firstname, lastname and social security number. o The constructor should generate a random 6-digit number as the user account number. o The initial balance is 0 and the annual interest rate is fixed at 1.0% (0.01).o The withdraw method signature...

  • The code is attached below has the Account class that was designed to model a bank account.

    IN JAVAThe code is attached below has the Account class that was designed to model a bank account. An account has the properties account number, balance, annual interest rate, and date created, and methods to deposit and withdraw funds. I need creat program using the 2 java programs.Create two subclasses for checking and savings accounts. A checking account has an overdraft limit, but a savings account cannot be overdrawn.I need to write a test program that creates objects of Account,...

  • For this lab you must write a complete class in C++. This will be a class...

    For this lab you must write a complete class in C++. This will be a class named BankAccount. This class must have the following private variables: 1. accountHolderName : string 2. balance : double 3. interestRate: double This class must have the following public constructor: 1. BancAccount(name : string, balance : double, rate : double) This class must have the following public member functions: 1. getAccountHolderName() : string a. returns the account holders name 2. getBalance() : double a. returns...

  • (Reading & Writing Business Objects) I need to have my Classes be able to talk to...

    (Reading & Writing Business Objects) I need to have my Classes be able to talk to Files. How do I make it such that I can look in a File for an account number and I am able to pull up all the details? The file should be delimited by colons (":"). The Code for testing 'Select' that goes in main is: Account a1 = new Account(); a1.select(“90001”); a1.display(); Below is what it should look like for accounts 90000:3003:SAV:8855.90 &...

  • Introduction Extend the inheritance hierarchy from the previous project by changing the classes to template classes....

    Introduction Extend the inheritance hierarchy from the previous project by changing the classes to template classes. Do not worry about rounding in classes that are instantiated as integer classes, you may just use the default rounding. You will add an additional data member, method, and bank account type that inherits SavingsAc-count ("CD", or certicate of deposit). Deliverables A driver program (driver.cpp) An implementation of Account class (account.h) An implementation of SavingsAccount (savingsaccount.h) An implementation of CheckingAccount (checkingaccount.h) An implementation of...

  • In this lab, a piece of working software is given. You are asked to make changes...

    In this lab, a piece of working software is given. You are asked to make changes to the software according to some requirement. The scenario in this lab mimics the situation that most old software applications are facing---need to update. When covering inheritance and polymorphism, we introduced a pattern that has three elements: instanceof operator, base pointers, and a collection data structure. In the given code, the collection used is a dynamic array (will change its length automatically) called Vector....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT