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 collection of coins 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 Exercises4;

public class CollectionOfCoins {

private int coinvalue;

private String country;

private String coinname;

public void getvalue() {

System.out.println("value of the coin " + coinvalue);

}

public void convert() {

coinname = "Euro";

coinvalue=20;

int conver = coinvalue*24;

System.out.println("Convertion value "+conver);

}

}

enumeration>> Coin 1 1 Country:India Coinname Rupee Coinvalue:5 enumeration>> Coin2 Country:Europ Coinname Euro Coinvalue2 enumeration>> Coin3 Country:India Coinvalue:20 Coinname Rupee

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!