import java.io.*;

class FinalProject{

	public static void main(String[]args){

		

		String name=" ", month, date;

		int total,cash=0,bal=0,y=0;

		int r=0;

		boolean ans=true;

		int test;

		do{



		try{

    	FileWriter extend = new FileWriter("extension.txt",true);

    	BufferedWriter out = new BufferedWriter(extend);

        

	

		System.out.print("Welcome! to GLORIA'S FUDHAUZ \n");

		System.out.print("Enter date: ");

		date = Enter.readString();

		System.out.print("Enter name: ");

		name = Enter.readString();

		out.write(name); 

	

		

		System.out.print("GLORIA'S FUDHAUZ");

		System.out.print("\nHI! " + name + "! HAVE A NICE DAY");

		System.out.print("\n\tSECTIONS:");

		System.out.print("\n 1. Carbohydrates\n 2. Vians\n 3. Beverages\n 4. Desserts\n\n");

		System.out.print("Enter a number: ");

		int x = Enter.readInt();

		

		

		if (x == 1){

		

			

 			System.out.println();

			

			System.out.print("\tCarbohydrates\n 1. Rice\n 2. Bread\n\n");

			System.out.print("Choose Order: ");	

			int x1 = Enter.readInt();

			

			if (x1 == 1){

				

 				System.out.println();

 				 

 				System.out.print("Enter Quantity of Rice: ");

 				 y = Enter.readInt();

 				

 				total = y * 8;

 				System.out.println();

 				

 				System.out.println("You ordered " + y + " Per serve of rice. Amounting to Php " + total + ".\n\n");

 				System.out.print("Enter your cash amount: ");

				cash = Enter.readInt();

				bal=cash-total;

 			System.out.print("View receipt? \n 1. Yes \n 2. No\n Yes or no? Enter Letter: ");

 			 r = Enter.readInt();

 			if (r == 1){

 				

 				System.out.print("Name \t\t\t\t Date: \t\t\t\t Total Amount\n\n");

 				System.out.print(name + "\t\t\t\t" + date + "\t\t\t\t" + "Php " + total);

 				System.out.print("\n Your cash is : "+cash+" & now it is only : "+bal);

 			

 			}

 			else{

 				System.out.print("Thank you for coming "+name+" !!..Please come again..");

 			}

 			}/*End of if  **/	

 		else if (x1 == 2){

 					

 				 	System.out.println();

 				 		

 				 	System.out.print("Enter Quantity of Bread: ");

 				 	int y1 = Enter.readInt();

 					total = y1 * 15;

 				 	System.out.println();

 				 	

 				 	System.out.println("You ordered " + y1 + " Per serve of Bread. Amounting to Php " + total + ".");

 					System.out.print("Enter your cash amount: ");

					cash = Enter.readInt();

					bal=cash-total;

 			System.out.print("View receipt? \n 1. Yes \n 2. No\n");

 			System.out.print("Yes or no? Enter number: ");

 			 r = Enter.readInt();

 			

 			

 			System.out.println();

 				

 				if (r == 1){

 				System.out.print("Name \t\t\t\t Date: \t\t\t\t Total Amount\n\n");

 				System.out.print(name + "\t\t\t\t" + date + "\t\t\t\t" + "Php " + total);

 				System.out.print("\n  Your cash is : "+cash+" & now it is only : "+bal);

 				}

 			else{

 				System.out.print("Thank you for coming "+name+" !!..Please come again..");

 			}

 				}

		}/*end of first condition  **/			

		else if (x == 2){

		

 			System.out.println();

 			

 			System.out.print("\tVian\n 1. Fried Chicken\n 2. Pork Chop\n\n");

 			System.out.print("Choose Order: ");

 			int x2 = Enter.readInt();

 			

 				if (x2 == 1){

 					

 				 	System.out.println();

 				 	

 				 	System.out.print("Enter Quantity of Fried Chicken/Slices: ");

 				 	int y2 = Enter.readInt();

 				 	

 				 	total = y2 * 18;

 				 	bal=cash-total;

 				 	

 				 	System.out.println();

 				 	

 				 	System.out.println("You ordered " + y2 + " Per sliced of Fried Chicken . Amounting to Php " + total + ".");

 					System.out.print("Enter your cash amount: ");

					cash = Enter.readInt();

					bal=cash-total;

 			System.out.print("View receipt? \n 1. Yes \n 2. No\n");

 			System.out.print("Yes or no? Enter number: ");

 			 r = Enter.readInt();

 			

 			

 			System.out.println();

 			

 		 	if (r == 1){

 				System.out.print("Name \t\t\t\t Date: \t\t\t\t Total Amount\n\n");

 				System.out.print(name + "\t\t\t\t" + date + "\t\t\t\t" + "Php " + total);

 				System.out.print("\n  Your cash is : "+cash+" & now it is only : "+bal);

 				}

 			else{

 				System.out.print("Thank you for coming "+name+" !!..Please come again..");

 			}	

 				}/*End of if statement **/

 				

 				if (x2 == 2){

 				

 				 	System.out.println();

 				 	

 				 	System.out.print("Quantity of Pork Chop/Slice: ");

 				 	int y3 = Enter.readInt();

 				 	

 				 	total = y3 * 25;

 				 	

 				 	System.out.println();

 				 	

 				 	System.out.println("You ordered " + y3 + " Quantity of Pork Chop/Slice. Amounting to Php " + total + ".");

 					System.out.print("Enter your cash amount: ");

					cash = Enter.readInt();

					bal=cash-total;

 			System.out.print("View receipt? \n 1. Yes \n 2. No\n");

 			System.out.print("Yes or no? Enter Number: ");

 			r = Enter.readInt();

 			

 		

 			System.out.println();

 			

 		 	if (r == 1){

 				System.out.print("Name \t\t\t\t Date: \t\t\t\t Total Amount\n\n");

 				System.out.print(name + "\t\t\t\t" + date + "\t\t\t\t" + "Php " + total);

 				System.out.print("\n  Your cash is : "+cash+" & now it is only : "+bal);

 				}

 			else{

 				System.out.print("Thank you for coming "+name+" !!..Please come again..");

 			}	

 				}

 				

		}/*end of 2nd condition  **/

		

		else if (x == 3){

			

 			System.out.println();

 			

 			System.out.println("Dessert: \n 1. Coke\n 2. PineApple Juice");

 			System.out.print("Enter Order: ");

 			int x3 = Enter.readInt();

 			

 				if (x3 == 1){

 					

 				 	System.out.println();

 				 	

 				 	System.out.print("Quantity of Coke/cup: ");

 				 	int y4 = Enter.readInt();

 				 	

 				 	total = y4 * 12;

 				 

 				 	System.out.println();

 				 	

 				 	System.out.println("You ordered " + y4 + " Quantity of Coke/cup. Amounting to Php " + total + ".");

 					System.out.print("Enter your cash amount: ");

					cash = Enter.readInt();

					bal=cash-total;

 			System.out.print("View receipt? \n 1. Yes \n 2. No\n");

 			System.out.print("Yes or no? Enter Number: ");

 			r = Enter.readInt();

 			

 				if (r == 1){

 				System.out.print("Name \t\t\t\t Date: \t\t\t\t Total Amount\n\n");

 				System.out.print(name + "\t\t\t\t" + date + "\t\t\t\t" + "Php " + total);

 				System.out.print("\n Your cash is : "+cash+" & now it is only : "+bal);

 				

 				}

 			else{

 				System.out.print("Thank you for coming "+name+" !!..Please come again..");

 			}

 				}

 				

 				if (x3 == 2){

 				

 				 	System.out.println();

 				 	

 				 	System.out.print("Quantity of PineAplle Juice/cup: ");

 				 	int y5 = Enter.readInt();

 				 	

 				 	total = y5 * 20;

 				 

 				 

 				 	System.out.println();

 				 	

 				 	System.out.println("You ordered " + y5 + " Quantity of PineAPlle juice. Amounting to Php " + total + ".");

 					System.out.print("Enter your cash amount: ");

					cash = Enter.readInt();

				bal=cash-total; 

 			System.out.print("View receipt? \n 1. Yes \n 2. No\n");

 			System.out.print("Yes or no? Enter Number: ");

 			 r = Enter.readInt();

 			

 		

 			System.out.println();

 			

 				if (r == 1){

 				System.out.print("Name \t\t\t\t Date: \t\t\t\t Total Amount\n\n");

 				System.out.print(name + "\t\t\t\t" + date + "\t\t\t\t" + "Php " + total);

 				System.out.print("\n Your cash is : "+cash+" & now it is only : "+bal);

 			}

 			else{

 				System.out.print("Thank you for coming "+name+" !!..Please come again..");

 			}

 				}

		}/*end of 3rd condition  **/

		else if (x == 4){

			

 			System.out.println();

 			

 			System.out.println("Desserts:\n 1. Salad\n 2. Shake");

 			System.out.print("Enter Order: ");

 			int x4 = Enter.readInt();

 			

 				if (x4 == 1){

 				

 				 	System.out.println();

 				 	

 				 	System.out.print("Quantity of Salad/serve: ");

 				 	int y6 = Enter.readInt();

 				 	

 				 	total = y6 * 30;

 				 

 				 

 				 	System.out.println();

 				 	

 				 	System.out.println("You ordered " + y6 + " Quantity of Salad/serve. Amounting to Php " + total + ".");

 					System.out.print("Enter your cash amount: ");

					cash = Enter.readInt();

					bal=cash-total;

 			System.out.print("View receipt? \n 1. Yes \n 2. No\n");

 			System.out.print("Yes or no? Enter Number: ");

 			 r = Enter.readInt();

 			

 			

 			System.out.println();

 			

 			if (r == 1){

 				System.out.print("Name \t\t\t\t Date: \t\t\t\t Total Amount\n\n");

 				System.out.print(name + "\t\t\t\t" + date + "\t\t\t\t" + "Php " + total);

 				System.out.print("\n Your cash is : "+cash+" & now it is only : "+bal);

 				

 				}

 				else{

 				System.out.print("Thank you for coming "+name+" !!..Please come again..");

 				}

 			}

 				

 				if (x4 == 2){

 					

 				 	System.out.println();

 				 	

 				 	System.out.print("Quantity of Shake/serve: ");

 				 	int y7 = Enter.readInt();

 				 	

 				 	total = y7 * 15;

 				 

 				 

 				 	System.out.println();

 				 	

 				 	System.out.println("You ordered " + y7 + " Quantity of Shake/serve. Amounting to Php " + total + ".");

 					System.out.print("Enter your cash amount: ");

					cash = Enter.readInt();

				bal=cash-total; 

 			System.out.print("View receipt? \n 1. Yes \n 2. No\n");

 			System.out.print("Yes or no? Enter Number: ");

 			 r = Enter.readInt();

 		

 			System.out.println();

 			

 				if (r == 1){

 				System.out.print("Name \t\t\t\t Date: \t\t\t\t Total Amount\n\n");

 				System.out.print(name + "\t\t\t\t" + date + "\t\t\t\t" + "Php " + total);

 				System.out.print("\n Your cash is : "+cash+" & now it is only : "+bal);

 			}

 				else{

 				System.out.print("Thank you for coming "+name+" !!..Please come again..");

 			}

 				}

		}/*end of 4th condition  **/

		else{

			System.out.print("Invalid Entry!!");

		}

		}catch (Exception namata){

      	System.err.println("Error: " + namata.getMessage());

    	}

    	System.out.println();

		System.out.println("Do you want to go back in menu ? \n 1. Yes \n 2. No \n Enter Choice : ");

 				 	 test = Enter.readInt();		 	 

 		if(test == 1){

 			ans=true;

 		}

 		else if (test == 2){

 			ans=false;

 		}

 		else{

 			System.out.print("Invalid Entry!!");

 			System.exit(0);

 		}		 	

		}while(ans);

			System.out.print("Thank you for coming "+name+" !!..Please come again..");

	}

}

This is the code that given in our programming instructor and their are errors in this code. the error says "cannot find symbol variable enter":(
this project will submitted this coming wednesday thanks for the help..

Recommended Answers

All 3 Replies

cannot find symbol variable enter

The error is because you dint declared the variable before using it in your code.

The error is because you dint declared the variable before using it in your code.

Can you teach how? im so confuse about the codes, and im not the one who make this codes

propably the point of this exercise is for you to figure out the obvious: why this code isn't working and to correct it.
it is very, very basic to declare a variable. if you are taking a programming class, chances are this is about the first thing you've learned about, so just overlook your notes of the first classes, or just google what harinath_2007 suggested:
'java declare a variable' that should get you all the information you need.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.