Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions