السلام عليم اخوان,
اسف على ازعاجكم , بكتب برنامج بسيط لادخال قيم ثلاثة ATM. المشكلة التي تواجهني هية انة البرنامج لاينفذ والمشلكة هية Cannot find symble للميثود في الsubclass.
حاولت امسح اي class في الفولدر و اغلقت وفتحت الcmd ولكن نفس المشكلة . ارجو منكم المساعدة.
الكود للبرنامج
public class ATM (سوبر كلاس)
{
int customerID;
float balance;
String cardType;
int withdralInput;
ATM( int inCustomer, float inBalance,String inCard, int inWDI )
{
customerID= inCustomer;
balance = inBalance;
cardType= inCard;
withdralInput= inWDI;
}
int getId()
{
return customerID;
}
String getCard()
{
return cardType;
}
float getBalance()
{
return balance;
}
int getwInput()
{
return withdralInput ;
}
int getWithdrwal()
{
if (balance>0)
{
return getwInput();
}
else
{
return 0;
}
}
}(سب كلاس)
public class SATM extends ATM
{
int deposet;
int newBalance;
float userInput;
SATM (int inCustomer, float inBalance,int inWDI, String inCard, float inUI)
{
super(inCustomer,inBalance,inCard, inWDI);
//deposet=inDeposet
// newBalance = inNewBalance;
userInput= inUI;
}
float getInput()
{
return userInput;
}
float getDeposet()
{
return balance + getInput() ;
}
float getNewBalance()
{
return getDeposet();
}
}واخيرا الدرايفر او التيستر
public class AtmCheck]
{
ATM atm1;
ATM atm2;
ATM atm3;
AtmCheck()
{ // idnumber balance card type userenter
atm1= new ATM(10030001,500, "Master Card",40);
atm2= new SATM(3332342,23332,8, "Visa",200);
atm3= new DATM(23422224, 443, "American Express",43, 55);
}
void processClient()
{
System.out.println("\n"+"\n"+"Welcome Customer: "+ atm1.getId() +"\t"+"Your Account Balance is: "+" "+"$"+" " + atm1.getBalance()+"\n"+"\n");
System.out.println("You Are Usiung:" +" "+atm1.getCard()+"\n"+"\n");
System.out.println("You Ordered to Withdrawl:"+" "+" "+"$"+" " + atm1.getWithdrwal()+" "+"Please Don't Forget to Take Your Money"+"\n"+"\n");
System.out.println("\t"+ "\t"+ "Thank You for Your Business With US"+"\n"+"\n");
System.out.println("----------------------------------------------------------------");
System.out.println("\n"+"\n"+"Welcome Customer: "+ + atm2.getId()+"\t"+"Your Account Balance is:+"+" "+"$"+" " + atm2.getBalance()+"\n"+"\n");
System.out.println("You are Using :"+" "+atm2.getCard()+"\n"+"\n");
System.out.println ("You are orderd to deposet "+" "+atm2.getWithdrwal()+" "+" "+"\n"+"\n");
System.out.println("\t"+"\t"+"Thank You and Have a Great Day"+"\n"+"\n");
System.out.println("----------------------------------------------------------------");
System.out.println("\n"+"\n"+"Welcome Customer: "+ atm3.getId()+"\t "+ "Your Account Balance is: "+"$"+" "+ atm3.getBalance()+"\n"+"\n");
System.out.println("Your are Using:"+" "+ atm3.getCard()+"\n"+"\n");
[System.out.println(atm3.getInput()+"\n"+"\n");المشكلة هنا
System.out.println("\t"+"\t"+"\t"+"Thank You "+"\n"+"\n");
System.out.println("----------------------------------------------------------------");
}
public static void main (String srgs[])
{
AtmCheck at = new AtmCheck();
at.processClient();
}
}