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 credit card account instead of a credit card. An account represents the charges and payments made using 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 Exercises2;

import java.util.Scanner;

public class CreditCardAccount {

private int cardnumber; private String name; private int creditlimit; int creditamount;

public void charges() { Scanner in = new Scanner(System.in); int creditLimit = 500000; int numofdays; double charges = 0;

System.out.println("Enter credit amount"); creditamount = in.nextInt(); System.out.println("Enter number of days "); numofdays = in.nextInt(); if (numofdays = 10 && numofdays

public void payments(int cash) {

int balance; balance = creditamount - cash; System.out.println("Blance aamount =" + balance); } }

enumeration>> customer I cardnumber: 452133 name: Kamal Kumar S creditlimit 1 000000 enumeration>> cudtomer2 cardnumber: 452199 name tendra P creditlimit: 500000 enumeration>> Customer 3 cardnumber: 4519880 creditlimi: 2000000 name: Nagendra B

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!