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

  Write complete java program to read from keyboard

Write complete Java program to read, from keyboard, a student's first and last name and six grades. It will display on screen last name then first letter of first name with a period.

  Create a class safestack that implements a stack of strings

Create a class SafeStack that implements a stack of strings

  Prompts the user for three first names

Write an application that prompts the user for three first names and concatenates them in every possible two-name combination so that new parents can easily compare them to find the most pleasing baby name. Save the file as BabyNameComparison.java

  Sets a loop to find 10 random generated

Write a java code that 1) uploads a file 2) sets a loop to find 10 random generated words from the file and then search those words by a. IndexSequential Method b. indexBinary Method. then, report how much time both methods took.

  You need to train for 10 weeks

You are preparing for a marathon. In order to prepare, you need to train for 10 weeks, running an increasing number of miles per week, starting at running at least 2 miles your first week up to 26 miles by week 10.

  Write a method called printlevel

Write a method called printLevel that takes an integer n as a parameter and that prints the values at level n from left to right. The values should be printed one per line.

  Write java program to compute how much federal need to pay

Write a java application to calculate how much federal and state tax you need to pay. The program should accomplish the following task.

  Program to translates a number into the closest letter grade

Write a program that translates a number into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-. Break ties in favor of the better grade

  Bilinear and nearest neighbour algorithm in java

How to do bilinear and nearest neighbour algorithm in java. Show how to eliminate change in pixel aspect ratio in java.

  Complete the twins() method

Complete the twins() method, which takes an integer argument n and prints all the sets of twin primes that are less than n, one pair per line

  Image to a "black-to-green scale" image

Call a method that will change the image to a "black-to-green scale" image.

  Write an array where the user can input 7 temperatures

Write an array where the user can input 7 temperatures; include a 'for' loop. Make sure the temperatures are larger than -100 and smaller than or equal to 120, if not, make sure the user enters a valid number. Make sure the temperature is between the..

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