Create 2 interfaces: BankInterface and PetInterface. BankInterface contains

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education