Hi. so we have this tutorial, a program that we have to complete, that we have to do before attending class and I've sort of completed it except for this small error.
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
id cannot be resolved or is not a field id cannot be resolved to a variable
id thats refered to is in the Main Class:
System.out.println("###### Our Loyalty Programme ###### \n");
System.out.print("Enter Member ID >> ");
String.id = sc.nextLine();
System.out.print("Enter Name >> ");
String name = sc.nextLine();
Member member = new Member(id, name);
LoyaltyCard card = member.getCard();
Problem Description
To celebrate the 2nd anniversary of the company, ABC Kiosk is giving a free loyalty card to all its
customers.
Customers who register for its loyalty programme will be rewarded 1 point for every RM 1 spent at
the kiosk. Then, the points that have been collected by registered members can be redeemed to pay
for items bought from the kiosk.
Each member can have only one loyalty card, and the type of the loyalty card is categorised into
three categories based on the current total of the collected points.
some code for Member Class
private String memberID;
private String name;
private LoyaltyCard card;
public Member(String memberID, String name){
this.memberID = memberID;
this.name = name;
card = new LoyaltyCard();
}
also just to inform, the main class was actualy already given we just had to do the Member Class and LoyaltyCard Cass.