Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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:lndiaStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started