General discussion

Locked

plz help me this is my final exam

By reine099 ·
import java.io.*;
public class Ordering1
{
public static InputStreamReader reader=new InputStreamReader(System.in);
public static BufferedReader input=new BufferedReader(reader);
public static void main(String[]args) throws IOException
{
String sausage="a1";
String crispy="a2";
String longganisa="a3";
String corn="a4";
String beef="a5";
String steak="a6";
String hotdog="a7";
String pancake="a8";

String order="";
String end="none";
String sure="yes";

int a1=0;
int a2=0;
int a3=0;
int a4=0;
int a5=0;
int a6=0;
int a7=0;
int a8=0;

int suma1=0;
int suma2=0;
int suma3=0;
int suma4=0;
int suma5=0;
int suma6=0;
int suma7=0;
int suma8=0;

int numa1=0;
int numa2=0;
int numa3=0;
int numa4=0;
int numa5=0;
int numa6=0;
int numa7=0;
int numa8=0;

int total=0;

System.out.println("\n\n \"WELCOME\"\n\n BREAKFAST & BRUNCH ENTREES\n\n ");
System.out.print(" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n");
System.out.print(" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
System.out.print(" ? code MENU ?\n");
System.out.print(" ? a1: Sausage and Egg Pandesal ?\n");
System.out.print(" ? a2: Crispy Bangus ?\n");
System.out.print(" ? a3: Longganisa ?\n");
System.out.print(" ? a4: Corned Beef ?\n");
System.out.print(" ? a5: Beef Tapa ?\n");
System.out.print(" ? a6: Breakfast Steak ?\n");
System.out.print(" ? a7: Hotdog ?\n");
System.out.print(" ? a8: Pancake ?\n");
System.out.print(" ? ?\n");
System.out.print(" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
System.out.print(" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n");

do
{
System.out.print("may i take your order? ");
order=input.readLine();

while(!order.equalsIgnoreCase(end))
{
while(order.equalsIgnoreCase(sausage))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a1++;
}

while(order.equalsIgnoreCase(crispy))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a2++;
}

while(order.equalsIgnoreCase(longganisa))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a3++;
}

while(order.equalsIgnoreCase(corn))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a4++;
}

while(order.equalsIgnoreCase(beef))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a5++;
}
while(order.equalsIgnoreCase(steak))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a6++;
}

while(order.equalsIgnoreCase(hotdog))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a7++;
}

while(order.equalsIgnoreCase(pancake))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a8++;
}

suma1=suma1+a1;
suma2=suma2+a2;
suma3=suma3+a3;
suma3=suma3+a3;
suma3=suma3+a3;
suma3=suma3+a3;
suma3=suma3+a3;
suma3=suma3+a3;
System.out.print("You Order n"+suma1+" - Sausage and egg pandesal\n"+suma2+" - crispy bangus \n"+suma3+" - longganisa \n"+suma4+" - corned beef \n"+suma5+" - beef tapa \n"+suma6+" - brakfast steak \n"+suma7+" - hotdog \n"+suma8+" - pancake");

}
numa1=10*suma1;
numa2=20*suma2;
numa3=30*suma3;
numa4=30*suma4;
numa5=30*suma5;
numa6=30*suma6;
numa7=30*suma7;
numa8=30*suma8;
total=numa1+numa2+numa3+numa4+numa5+numa6+numa7+numa8;

System.out.println("Total Amount : P"+total+".00\n");
System.out.print("Order Again? ");
order=input.readLine();
}
while(order.equalsIgnoreCase(sure));
System.out.print("Just w8 4 a while Maam/Sir..");




System.exit(0);
}
}
//this is my program... pls help me solve the errors

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Good luck!

by seanferd In reply to plz help me this is my fi ...

I don't do code, but that looks rather simple to me. Of course, you didn't say what it is actually supposed to do.

I suppose I could install a Java SDK and a debugger, look up any problems, and then I would... get course credit for this?

If you want to be a developer, you should really figure this out for yourself. Not to mention that you will likely get an ear-full here. If you don't want to be a dev, find another career path. You will be much happier.

Collapse -

And it's due tomorrow morning, no?

by NickNielsen In reply to plz help me this is my fi ...

Time to apply everything you learned in that programming course.

Good luck!

Collapse -

Please tell me you are not doing programming

by Tony Hopkinson In reply to plz help me this is my fi ...

This is so bad, I don't even know where to start.

Have you heard the idea that if you get a thousand monkeys to jump up and down on a keyboard for long enough one of them will turn out a Shakespeare sonnet?

If you are attempting the java program equivalent, you stopped early, way too early.

What in Cthulu's name is it meant to do?

I see academia still isn't marking down for incomprehensible code...

If you are taking a degree in the retail food industry I might help, if it's in programming then I'll have let you gain the reward you so richly deserve, failure!

It would be rude not to.

Collapse -

Very bad menu

by TobiF In reply to plz help me this is my fi ...

You should have more healthy choices in your menu.
(And you should design your program in such a way that you don't need to take the same course once more as soon as you want to add hummus to the menu.)

Collapse -

I'm hungry

by neilb@uk In reply to plz help me this is my fi ...

I so like the sound of a "crispy bangus".

:)

Collapse -

I was looking at the menu myself

by NickNielsen In reply to I'm hungry

In fact, I was so taken by the idea of a "Sausage and Egg Pandesal", I had an omelet for breakfast this morning.

Now that I've looked up what the pandesal actually is, I should probably have had an egg sandwich.

Back to Software Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums