Question: JAVA language Create a class Card that represents a general type of membership card. The Card class will have one instance variable called name which

 JAVA language Create a class "Card" that represents a general type

of membership card. The "Card" class will have one instance variable called

JAVA language

Create a class "Card" that represents a general type of membership card. The "Card" class will have one instance variable called "name" which will be of type String. Write a default constructor which sets name to " (an empty String). Write a parameterized constructor which receives a single String parameter and sets name to this given parameter. The "Card" class must also implement the following methods public boolean isExpired ()) which always returns false. And public String toString ) [) which returns the String "Card Holder: " concatenated with the name instance variable Create a class DebitCard', which subclasses the Card" class. The DebitCard" class will have two instance variables of type int: cardNumber& pirn. Write a default constructor which calls the constructor of its superclass, passing it the string "Jane Doe". The default constructor must also initialize cardNumber to 00000000 and pin to 0 Write a parameterized constructor which takes three parameters: A String for the card name, an int for the cardNumber, and an int for the card pin. The parameterized constructor which calls the constructor of its superclass, passing it the name parameter. The parameterized constructor must also initialize cardNumber and pin using the passed parameters. The "DebitCard" class must also implement the following methods A getter for the cardNumber instance variable A function isPin which takes a single int parameter and returns true (a Boolean value) if the passed int parameter is equal to the pin instance variable and false if it is not A toString method which calls the super class's toString method and concatenates it with "Card Number "and the value of the cardNumber instance variable Create a class "IDCard', which subclasses the "Card" class. The IDCard" class will have one instance variable called IDN umber" which will be of type int. Write a default constructor which passes the String "Jane Smith" to the superclass constructor and sets IDNumber to 0 Write a parameterized constructor which takes a String for name and an int for anIDNumber, passing the superclass constructor the name parameter and initalizing the IDNumber instance variable using the passed anIDNumber parameter Write a getter method for IDNumber Write a toString method which calles the super class's toString method and concatenates it with "ID Number:" and the value of the IDNumber instance variable Create a class "Card" that represents a general type of membership card. The "Card" class will have one instance variable called "name" which will be of type String. Write a default constructor which sets name to " (an empty String). Write a parameterized constructor which receives a single String parameter and sets name to this given parameter. The "Card" class must also implement the following methods public boolean isExpired ()) which always returns false. And public String toString ) [) which returns the String "Card Holder: " concatenated with the name instance variable Create a class DebitCard', which subclasses the Card" class. The DebitCard" class will have two instance variables of type int: cardNumber& pirn. Write a default constructor which calls the constructor of its superclass, passing it the string "Jane Doe". The default constructor must also initialize cardNumber to 00000000 and pin to 0 Write a parameterized constructor which takes three parameters: A String for the card name, an int for the cardNumber, and an int for the card pin. The parameterized constructor which calls the constructor of its superclass, passing it the name parameter. The parameterized constructor must also initialize cardNumber and pin using the passed parameters. The "DebitCard" class must also implement the following methods A getter for the cardNumber instance variable A function isPin which takes a single int parameter and returns true (a Boolean value) if the passed int parameter is equal to the pin instance variable and false if it is not A toString method which calls the super class's toString method and concatenates it with "Card Number "and the value of the cardNumber instance variable Create a class "IDCard', which subclasses the "Card" class. The IDCard" class will have one instance variable called IDN umber" which will be of type int. Write a default constructor which passes the String "Jane Smith" to the superclass constructor and sets IDNumber to 0 Write a parameterized constructor which takes a String for name and an int for anIDNumber, passing the superclass constructor the name parameter and initalizing the IDNumber instance variable using the passed anIDNumber parameter Write a getter method for IDNumber Write a toString method which calles the super class's toString method and concatenates it with "ID Number:" and the value of the IDNumber instance variable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!