Question: please add comments CSC 201 Computer Science I Inheritance Lab Create a class Card that represents a general type of membership card. The Card class

 please add comments CSC 201 Computer Science I Inheritance Lab Create

a class Card" that represents a general type of membership card. The

please add comments

CSC 201 Computer Science I Inheritance Lab 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 which always returns false which returns the value stored in the name instance variable. And which returns the String "Card Holder: "concatenated with the name instance variable. public boolean isExpired DI public String getName ) f public String cardTostring ) ( Create a class "DebitCard" which subclasses the "Card" class. The "DebitCard" class will have two instance variables of type int: cardNumber & pin 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 calls the constructor of its superclass, passing it the name parameter. The parameterized constructor must also initialize cardNumber and pin instance variables 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 cardToString method which calls the super class's cardToString 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 "IDNumber" 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 anlDNumber, 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 cardToString method which calls the super class's cardToString 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!