Question: Please help with my ADT Java Program. It is for a credit card. This is the code and I keep getting an error saying my
Please help with my ADT Java Program. It is for a credit card. This is the code and I keep getting an error saying my Credit Class does not have a main method, where am i going wrong? This is my Java code
public class CreditCard {
//* Error starts here
public static void main(String[], args) {
CreditCard CC1 = new CreditCard("IFlores", 431633445, "3/SEP/2018");
CC1.CreditCharge(100);
CC1.Cash_Adv(300);
CC1.Payment(50);
CC1.InterestAdded(20); } }
//* Error ends here
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_Adv(int C_Adv) { System.out.println("New Cash Advance issued in the amount of $" + C_Adv); }
public void Payment(int Amount) { System.out.println("Thank you for you payment of $" + Amount); }
public void InterestAdded(int Interest) { System.out.println("An interest charge of $" + Interest + " has been added to your account"); }
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
