Write a class to represent a credit card.

Assignment Help JAVA Programming
Reference no: EM13165543

write a class to represent a credit card. The class details are as follows:

1. Static Variables

a. baseRate - The minimum interest rate that the card can have. This should be a

constant that is hard coded.

b. lastAccountNumber - The last account number assigned to a customer. Account

numbers should be assigned sequentially.

2. Instance Variables

a. accountholder - The name of the person who owns the card.

b. accountNumber - A unique 7-digit identifier number.

c. creditScore - The account holder's credit score.

d. rate - The annual interest rate charged to the card.

e. balance - The current balance on the card.

f. creditLimit - The card holder's credit limit.

3. Methods

a. Constructor - Should only take the account holder's name and a credit score. The

next account number available should be assigned. The balance will be 0 as nothing

has been charged yet. The rate and credit limit will be determined by the credit

score. Use the following table to set the rate and credit limit.

Credit Score Rate Limit

0-300 baseRate + 10% $1000

300-500 baseRate + 7% $3000

500-700 baseRate + 4% $7000

700+ baseRate + 1% $15000

b. makePurchase - Takes a purchase amount as a parameter and updates the current

balance. If the amount + balance > creditLimit, deny the transaction.

c. makePayment - Takes a payment amount as a parameter and updates the current

balance. If the payment is greater than the balance, set the balance to zero and print

an appropriate message. If the payment is less than 10% of the balance, apply the

payment and raise the account holder's rate by 1%. If the balance is paid off entirely,

raise the creditScore by 10. If the increased creditScore changes where the account

holder falls in the above table, change the rate and limit as appropriate.

d. raiseRate - Raises the account holder's rate by a given percentage.

e. raiseLimit - Raises the account holder's limit by a given dollar amount.

f. calculateBalance - Calculates the balance on a monthly basis. Remember that the

rate is yearly, so the formula for calculating the balance monthly is balance +

(balance * (rate / 12)).

g. toString - Print the account holder's name, account number obscured with stars (ex:

1234567 would display as ****567), balance, and limit.

To test your class, write a driver program to track an account holder over six months. Each month,

allow the account holder to make as many purchases as he wishes. At the end of each month, if the

balance is greater than 0, ask the user if he would like to make a payment. Apply the payment if he

makes one. If a payment is not made during any given month when there is a bala

 

 

Reference no: EM13165543

Questions Cloud

What is the least amount of mercury : The latent heat of vaporization of mercury is around 300,000 J/kg. What is the least amount of mercury (in kg) that can be vaporized when 3 million joules are introduced?
File containing a series of integers is named : Assume that a file containing a series of integers is named numbers.dat and exists on the computer's disk. Design a java program that reads all the numbers stored in the file and calculates and displays on the console
Compute the molar heat capacity : when a 1421 J of heat energy is added to 39.5 g of hexane, C6H14, the temperature increases by 15.9 degree centegrade. Calculate the molar heat capacity
Use polar arrows to indicate the bond polarity of each bond : Rank SCl2, PCl3, and SiCl4 in order of increasing ionic character of their bonds. Use polar arrows to indicate the bond polarity of each bond.
Write a class to represent a credit card. : write a class to represent a credit card.
Calculate the mole fraction of toluene in the solution : Toluene (C6H5CH3) is a liquid compound similar to benzene (C6H6). Calculate the mole fraction of toluene in the solution that contains 138 g toluene and 106 g benzene.
Calculate the overall energy change : Calculate the overall energy change (in kilojoules per mole) for the formation of Csf from its elements using the following data.
Prepare a sales budget by month : Prepare a sales budget, by month and in total, for the third quarter. Also prepare a schedule of expected cash collections, by month and in total, for the third quarter.
State standardized ascorbic acid : A student standardized her I2 solution by preparing a solution of 0.0450 g of ascorbic acid (vitamin C) in a 100 mL volumetric flask. She titrated several 10.00 mL samples of the Vitamin C solution and found an average of 24.95 mL of I2 solution

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd