Question

credit card processing project

credit card processing project

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: In case of any queries, just comment in box I would be very happy to assist all your queries

CreditCard.java
import java.util.*;
public class CreditCard
{
String name;
String cardNumber;
double balance;
double spendingLimit;
// constructor
CreditCard(String name, String cardNumber)
{
this.name = name;
// check if the length of card number is 16
if(cardNumber.length() == 16)
this.cardNumber = cardNumber;
else
{
System.out.println("Card Number is invalid. It should be 16 character long!");
System.exit(0);
}
this.balance = 0.0;
this.spendingLimit = 2000.0;
}
// accessor methods
public String getName()
{
return this.name;
}
public String getCardNumber()
{
return this.cardNumber;
}
public double getBalance()
{
return this.balance;
}
public double getSpendingLimit()
{
return this.spendingLimit;
}
// make a purchase
public void purchase(double amount)
{
this.balance += amount;
}
// increase Spending Limit by $50 each time it is called
public void increaseSpendingLimit()
{
this.spendingLimit += 50.0;
}
// reset balance to $0
public void payBill()
{
this.balance = 0;
}
public String toString()
{
String ans = "Name : " + this.name + "\n";
ans += "Card Number : " + this.cardNumber + "\n";
ans += "Balance : " + this.balance + "\n";
ans += "Spending Limit : " + this.spendingLimit + "\n";
return ans;
}
}
--------------------------- CardTest.java ---------------------------
public class CardTest
{
public static void main(String[] args)
{
// create a credit card object
CreditCard ob = new CreditCard("Chandler Bing", "1234567812345678");
System.out.println(ob);
System.out.println("\nAfter purchasing item of $100 ...\n");
ob.purchase(100);
System.out.println(ob);
System.out.println("\nAfter paying bill ...\n");
ob.payBill();
System.out.println(ob);
System.out.println("\nAfter Increasing Spending Limit ...\n");
ob.increaseSpendingLimit();
System.out.println(ob);
}
}

output:

C:\Users\user\Desktop>javac CardTest.java C:\Users\user\Desktop>java CardTest Name : Chandler Bing Card Number : 123456781234

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
credit card processing project
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • the role of IS in collecting and processing customer data by Credit Card companies.

    Describe with example the role of IS in collecting and processing customer data by Credit Card companies. Describe the reasons of processing these customer shopping details.

  • supposed a credit card processing colpany charged a 3.5% processing fee. you are selling an item...

    supposed a credit card processing colpany charged a 3.5% processing fee. you are selling an item for X write out an equation that will calculate what is the total amount that you should charge so that you will get excactly X amount of money after any processing fee is applied. For example, x=250, what should you charged the customer so that after the 3.5% proxessing fee is applied you will have excactly 250.00 write out an equation so that it...

  • 3.a Credit Card Payments. Tobyis owes $9,000 on his credit card at graduation. His credit card...

    3.a Credit Card Payments. Tobyis owes $9,000 on his credit card at graduation. His credit card charges him 24% interest annually compounded monthly. What will Tobyis' monthly payment be if he pays off the full amount in equal monthly payments over the next 4 years? Work: 3.b Credit Card Payments. Tobyis owes $9,000 on his credit card at graduation. His credit card charges him 24% interest annually compounded monthly but he can switch to a new lower interest rate card...

  • In a sample of credit card holders the mean monthly value of credit card purchases was...

    In a sample of credit card holders the mean monthly value of credit card purchases was $ 387 and the sample variance was 47 ($ squared). Assume that the population distribution is normal. Answer the following, rounding your answers to two decimal places where appropriate. (a) Suppose the sample results were obtained from a random sample of 10 credit card holders. Find a 95% confidence interval for the mean monthly value of credit card purchases of all card holders. {...

  • In a sample of credit card holders the mean monthly value of credit card purchases was...

    In a sample of credit card holders the mean monthly value of credit card purchases was $ 361 and the sample variance was 75 ($ squared). Assume that the population distribution is normal. Answer the following, rounding your answers to two decimal places where appropriate. (a) Suppose the sample results were obtained from a random sample of 15 credit card holders. Find a 95% confidence interval for the mean monthly value of credit card purchases of all card holders. (b)...

  • In a sample of credit card holders the mean monthly value of credit card purchases was...

    In a sample of credit card holders the mean monthly value of credit card purchases was $ 307 and the sample variance was 75 ($ squared). Assume that the population distribution is normal. Answer the following, rounding your answers to two decimal places where appropriate. (a) Suppose the sample results were obtained from a random sample of 13 credit card holders. Find a 95% confidence interval for the mean monthly value of credit card purchases of all card holders. (b)...

  • Ashley had $10,000 in credit card debt. She negotiated a settlement with the credit card company....

    Ashley had $10,000 in credit card debt. She negotiated a settlement with the credit card company. Ashley paid $4,000 of the credit card debt, and the credit card company agreed to cancel $6,000 of the debt. If Ashley has total assets of $27,000 and total liabilities of $25,000 immediately before the debt was cancelled, what amount of gross income does Ashley have as a result of the credit card company cancelling $6,000 of her debt?

  • Suppose you analyzed the average monthly credit card bill of Visa credit card customers using two...

    Suppose you analyzed the average monthly credit card bill of Visa credit card customers using two randomly selected samples: one with 144 Visa credit card customers (Sample #1) and one with 100 Visa credit card customers (Sample #2). Every credit card customer in Sample #1 had a monthly credit card bill of $1,812. Sample #2, on the other hand, had an average monthly credit card bill of $1,868 with a variance of 1,302,388 ($)^2. If you combined these samples into...

  • Suppose you analyzed the average monthly credit card bill of Visa credit card customers using two...

    Suppose you analyzed the average monthly credit card bill of Visa credit card customers using two randomly selected samples: one with 144 Visa credit card customers (Sample #1) and one with 100 Visa credit card customers (Sample #2). Every credit card customer in Sample #1 had a monthly credit card bill of $1,812. Sample #2, on the other hand, had an average monthly credit card bill of $1,868 with a variance of 1,302,388 ($)^2. If you combined these samples into...

  • if you are trying to build credit by using a credit card eah time you make a purchase with the credit card deduct that a...

    if you are trying to build credit by using a credit card eah time you make a purchase with the credit card deduct that amount from your checking account that way when your credit card is due you will have enough to pay the credit card off in full Kathy lehner is going to start doing this.she plans on paying her credit card bill in full this month.Hpw much does she owe with a 12% APR and the following transactions...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT