I'm sorry, but start your own thread, don't hijack someone else's.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Just reformat the code and the error will be glaring in your face.
Use Astyle e.g.
Also use the code tags:
class waiters
{
private double tab;
public waiters(String name);
{
System.out.println("my name is"+name+",i''ll be your waiter!");
tab = 0.0;
}
public double priceof(String s)
{
double price;
if(s.equals("chicken"))
{
price = 5.95;
}
else
{
if(s.equals("burger"))
{
price = 4.95;
}
else
if(s.equals("fries"))
{
price = 1.95;
}
}
return price;
}
public void order(String s)
{
if(s.equals("chicken"))
{
tab = tab + 5.95;
}
else
{
if(s.eqauals("burger"))
{
tab = tab + 4.95;
}
else
{
tab = tab + 1.95;
}
public void check()
{
System.out.println("Please Pay $");
}
}
public class object4
{
public void main(String [] args)
{
waiter ourwaiter;
ourwaiter = new waiter("jeff");
double x;
double y;
x = ourwaiter.priceof("burger");
y = ourwaiter.priceof("Chicken");
if(x<y)
{
System.out.println("i'll gonna take the burger coz it's cheaper");
ourwaiter.order(burger);
}
else
{
System.out.println("i'll take the chicken");
ourwaiter.order("chicken");
}
System.out.println("and i'll have fries with that");
ourwaiter.order("Fries");
System.out.println("\n eat......\n");
ourwaiter.check();
}
}
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75
Also, it has been requested of the poster that he use code tag at least 5 times and yet he still refuses.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847