Question: JAVA Design a class to represent a credit card. Think about the attributes of a credit card; that is, what data is on the card?

JAVA

Design a class to represent a credit card. Think about the attributes of a credit card; that is, what data is on the card? What behaviors might be reasonable for a credit card?

Repeat Exercise for a coin instead of a credit card.

I want then give three examples of instances of this class.

JAVA Design a class to represent a credit card. Think about the

Is the code used

package Exercises3;

public class Coin {

private int coinValue; private String country;

public void getValue(){ System.out.println("value of the coin "+coinValue); } }

enumeration>> coin 1 Country:lndia enumeration>> coin2 CoinValue:2 Country Australia enumeration>> coin3 CoinValue:20 Country:lndia

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!