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 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.

image text in transcribed

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

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

More Books

Students also viewed these Databases questions

Question

Compare the different types of employee separation actions.

Answered: 1 week ago

Question

Assess alternative dispute resolution methods.

Answered: 1 week ago

Question

Distinguish between intrinsic and extrinsic rewards.

Answered: 1 week ago