Question
Please help me with this Java code I have two errors on the top portion of the code where am i making the mistake. Here
Please help me with this Java code I have two errors on the top portion of the code where am i making the mistake.
Here is my code:
package project1;
public class creditCard{
public static void main(String[] args){ CCard cc1 = new CCard(" Ivan Flores ", 0123 4567 8910 1112, " March 22, 2019 "); cc1.CreditCharge(150);
cc1.Cash_Advance(0); cc1.Payment(25); cc1.Interest(5); } } class CCard {
private String CustomerName;
private long AccountNumber;
private String DueDate;
public CCard(String CustomerName, long AccountNumber, String DueDate) {
this.CustomerName = CustomerName;
this.AccountNumber = AccountNumber;
this.DueDate = DueDate;
System.out.println("The Credit Card Details Are ");
System.out.println("Acct Number" + AccountNumber); System.out.println("Customer Name" + CustomerName); System.out.println("Due Date" + DueDate);
}
public void CreditCharge(int charge) { System.out.println("Credit Card has a new Charge of $" + charge); }
public void Cash_Advance(int Cash_Advance) { System.out.println("New Cash Advance issued in the amount of $" + Cash_Advance); }
public void Payment(int Amount) { System.out.println("Thank you for you payment of $" + Amount); }
public void Interes(int Interest) { System.out.println("An interest charge of $" + Interest + " has been added to your account"); }
}
3. Design and implement an ADI named treditcard that represehts a creait cara. the data e ADT should include Java variables for the customer name, the account number, the next due date, the reward points, and the account balance. The initialization operation should set the data to client-supplied values. Include operations for a credit card charge, a cash advance, a payment, the addition of interest to the balance, and the display of the statistics of the account. Be sure to include a main class which creates an object from your CreditCard class. Do not worry too much about the correctness of the methods, the method headers and whether they are invoked correctly from client code is what really matters (20 points)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started