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

  Java :a user-defined starting position (other than 0,0)

modifying the program so that it can start from a user-defined starting position (other than 0,0) and search for a user defined ending point (other than row-1, column-1) .

  Tracer for java

Implementation of a tracer of Java objects and the tracer can be invoked from any point of a Java program, accepting an object as argument.

  Alter the prototype form page by javascript function

Alter the prototype form page so that when JavaScript function has verified that all the required fields have been filled, cookie is added to user's computer.

  Application named arithmeticmethods

Create an application named ArithmeticMethods whose main() method holds two integer variables. Assign values to the variables. In turn, pass each value to methods named displayNumberPlus10()

  Client server monitoring system project design

client server monitoring system project design. The server adminstation can send messages to the clients and DESIGN WITH JAVA NETBEANS AND GUI.

  Multiple choice java programming questions

Determine which of the following may be a violation of information hiding if inserted for the comment above?

  Create java applet to input miles driven and gallons used

Create the Java applet which will input miles driven and gallons used (both as integers) for each tankful. Program must compute and display miles per gallon obtained for each tankful.

  Instance methods

instance methods: setWidth(double w), setHeight(double h), double getWidth(), double getHeight() and double getArea() * A triangle's area is calculated by width*height*0.5  * all variables are private and methods public.

  Implement a fish-lake simulation

Implement a Fish/Lake simulation similar to the previous assignment. You will then make adjustments to accommodate class hierarchies and make use of inheritance as well as a JAVA interface.

  Write a java program to register students for a college

Project is for designing and developing a College Registration program. Write a Java program to register students for a college

  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.

  Create file lab7.java with a main method.

Create file Lab7.java with a main method. Inside your main method, write a segment of code which instantiates an object of the Student class (This class has been created for you in the  Student.java  file that is provided as part of this lab).

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