Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project should have: 1. one Java Project with the following files: 0 Printable.java (interface file) o Shape.java (abstract class) Circle.java inherits from Shape) Square.java (inherits
Project should have: 1. one Java Project with the following files: 0 Printable.java (interface file) o Shape.java (abstract class) Circle.java inherits from Shape) Square.java (inherits from Shape) o BankAccount.java (implements Printable ) ApplicationRunner.java (has a main method) Instructions 1. Create an interface as follows. 2. public interface Printable { 3. void printToConsole(Object x); 4. void printToFile(Object x); 5. } 6. Create a simple BankAccount class that implements the Printable interface. a. You must implement the printToConsole() method. Bank Account Fields double balance; String account Number; Methods Constructor Sets all properties Getters Yes, No setters. public void deposit(double amount) public void withdraw(double amount) 1. Create a simple abstract class Shape that implements the Printable interface. 2. Create a Circle class that extends the Shape class. 0 You must implement all the Shape methods. You must implement the printToConsole() method. (For 1 Extra Point) implement the printToFile() method 3. Create a Rectangle class that extends the shape class. You must implement all the shape methods. 0 You must implement the printToConsole() method. (For the same 1 Extra Point) implement the printToFile() method 0 0 . What type of ArrayList should this be? 3. Loop over all the objects and call the printToConsole method. 4. (For 4 Extra Points) o Copy the Filter interface from the lab. o Create a LargeShapesFilter class that implements the Filter interface. Modify the accept implementation so it accepts any shape with an area of 50 units and above. in the ApplicationRunner, make sure you have multiple shapes of different sizes, filter out all the large ones and print them to console. 5. Used Junit to test the getters, deposit and withdraw methods of the BankAccount class. This project should have the following: 1. The program runs with no errors. 2. Created and defined the Interface file. 3. The BankAccount class includes all the fields and methods specified above. 4. The BankAccount class properly implements the Printable interface. 5. Used Junit to test the getters, deposit and withdraw methods of the BankAccount class. 6. (For 1 Extra Point) implement the printToFile() method for (BankAccount, Circle, and Rectangle Classes) 7. Created a proper ArrayList to house all the different printable objects. 8. The ApplicationRunner.java properly prints all instances of the classes. 9. ApplicationRunner properly utilizes the static helper method to filter the arraylist of shapes. 10.(For 4 Extra Points) Proper implementation and usage of the Filter interface. 11. Proper usage of Git and GitHub (frequent commits, explanatory commit messages)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started