Create 2 interfaces: BankInterface and PetInterface. BankInterface contains
1. Create 2 interfaces: BankInterface and PetInterface. BankInterface contains only 1 abstract method: accountType() which does not return anything and takes 1 String argument: accType. PetInterface contains only 1 abstract method: petType() which does not return anything and takes 1 String argument petType.
2. Create an abstract class named Student. This class contains 2 instance variables, 1 constructor, and 2 abstract methods. a. Instance variables: stId and stName (Use must use appropriate data type.) b. A 2-argument constructor that will be called from its subclass (the concrete class) to load 2 instance variables of this level during the creation of an object in its subclass. c. 2 abstract methods: getStId and getStName.. Each of these methods, when sub classed into concrete ones, should return the respective values of the instance variables stId and stName. d. At this level you should do something to get the object state at this level.
3. Create a concrete class named CentennialStudent that makes use of the abstract class Student and the 2 interfaces: BankInterface and PetInterface. This class has two instance variables of its own, one constructor, and two methods of its own. a. Instance variables: stDept and stTuitionFees. (Use appropriate data types.) b. Constructor: one constructor that constructs a CentennialStudent object with all the centennialStudent information (stId, stName, stDept, and stTutionFees) supplied during the centennialStudent object creation. c. Take necessary action to make this class a concrete class. d. Take necessary action to get the complete string representation (i.e., the object state) of objects made from this class.
4. Create a driver class named TestXXX (replace XXX by three letters of your name) that would ask for student Id, name, department, and tuition fees from the user and creates an object with the information entered. You ask also about the type of bank account the CentennialStrudent uses and also ask about his/her pet animal type. Use the implemented interface methods accountTpe and petType to display the values you entered. In order to accomplish this, you need to create variables at appropriate place to store the data entered by the user and use them in the implemented interfaces .You may use JOptionPane input dialog to get the input from the user and messageDialogs display the output.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps