')' expected error
Hello,
i am receiving this error when i am compiling my class, and i cannot find any missing parentheses. can someone help?
switch(menuSelection)
{
case 1:
System.out.println("Selection 1: \n2(8 ounce) packages cream cheese" +" \n3/4 cup white sugar " +"\n1 (15 ounce) can pumpkin puree" +"\n1 1/4 teaspoons ground cinnamon" +"\n1/2 teaspoon ground ginger" +"\n1/2 teaspoon ground nutmeg" +"\n2 eggs" +"\n1/4 teaspoon salt" +"\n2 prepared 8 inch pastry shells");
yummyCake.yummy(cakeType);
break;
case 2:
System.out.println("Selection 2: \n1/3 cup vegetable oil" +"\n2 squares unsweetened chocolate""\n3/4 cup water" +"\n1 cup sugar" +"\n1 1/4 cups all-purpose flour" +"\n1/2 teaspoon salt" +"\n1/2 teaspoon baking soda" ="\n1 teaspoon vanilla" +"\n1 cup semisweet chocolate chips" +"\n1/3 cup chopped pecans");
yummyCake.yummy(cakeType);
break;
case 3:
System.out.println("Selection 3: \n2 tablespoons butter" +"\n1/4 cup light brown sugar" +"\n1 cup fruit cocktail, drained" +"\n1 cup sifted cake flour" +"\n1 teaspoon baking powder" +"\n1/4 teaspoon salt" +"\n4 eggs, separated" +"\n1 cup granulated sugar" +"\n1/4 cup cold water" +"\n1 teaspoon vanilla");
yummyCake.yummy(cakeType);
break;
case 0:
System.out.println("Selection 0");
dyummyCake.yummy(cakeType);
break;
}
[2525 byte] By [
jimuna25a] at [2007-11-26 21:29:29]

thanks, i fixed that error, now i am getting another one further up. i might as well post the entire code, which isnt a lot. there error now says "cannot find symbol class cake". Below the initial code is my class.
public class Rogers_Jim_Cakes_Methods {
public static void main(String [] args) {
int input;
int cake;
int cakeType;
int menuSelection;
cake yummyCake = new cake();
//System.out.println("0. Exit");
//int menuSelection = System.inInt();
//System.out.println(menuSelection);
do
{
System.out.println("Cake Menu");
System.out.println(".......................");
System.out.println("1. Pumpkin Cheesecake");
System.out.println("2. Easy Chocolate Snack Cake");
System.out.println("3. Fruit Cocktail Upside Down Cake");
System.out.println("0. Exit");
System.out.println("Please select a cake number or enter 0 to exit: ");
//menuSelection = input.nextInt();
cakeType=menuSelection;
switch(menuSelection)
{
case 1:
System.out.println("Selection 1: \n2(8 ounce) packages cream cheese" + " \n3/4 cup white sugar " + "\n1 (15 ounce) can pumpkin puree" + "\n1 1/4 teaspoons ground cinnamon" + "\n1/2 teaspoon ground ginger" + "\n1/2 teaspoon ground nutmeg" + "\n2 eggs" + "\n1/4 teaspoon salt" + "\n2 prepared 8 inch pastry shells");
yummyCake.yummy(cakeType);
break;
case 2:
System.out.println("Selection 2: \n1/3 cup vegetable oil" + "\n2 squares unsweetened chocolate" + "\n3/4 cup water" + "\n1 cup sugar" + "\n1 1/4 cups all-purpose flour" + "\n1/2 teaspoon salt" + "\n1/2 teaspoon baking soda" + "\n1 teaspoon vanilla" + "\n1 cup semisweet chocolate chips" + "\n1/3 cup chopped pecans");
yummyCake.yummy(cakeType);
break;
case 3:
System.out.println("Selection 3: \n2 tablespoons butter" + "\n1/4 cup light brown sugar" + "\n1 cup fruit cocktail, drained" + "\n1 cup sifted cake flour" + "\n1 teaspoon baking powder" + "\n1/4 teaspoon salt" + "\n4 eggs, separated" + "\n1 cup granulated sugar" + "\n1/4 cup cold water" + "\n1 teaspoon vanilla");
yummyCake.yummy(cakeType);
break;
case 0:
System.out.println("Selection 0");
yummyCake.yummy(cakeType);
break;
}
}while (menuSelection!=0);
System.out.println("Adios, you fat bastard!");
}
}
Code for class:
public class Rogers_Jim_Cakes {
public void Cakes() {
}
public void yummy(int cakeToMake){
System.out.println("Cake Made." + cakeToMake);
}
}
You've got a couple of problems with those literals:
1. You need to check carefully where those '" + " ' combinations are ... you
will need to correct a couple of them.
2. There is no need to add the Strings the way you are doing. Instead of
adding them up, make them on continuous String Object.
"Selection 3: \n2 tablespoons butter" + "\n1/4 cup light brown sugar" + "\n1 cup fruit cocktail, drained" + "\n1 cup sifted cake flour" + "\n1 teaspoon baking powder" + "\n1/4 teaspoon salt" + "\n4 eggs, separated" + "\n1 cup granulated sugar" + "\n1/4 cup cold water" + "\n1 teaspoon vanilla"
-becomes-
"Selection 3: \n2 tablespoons butter\n1/4 cup light brown sugar\n1 cup fruit cocktail, drained\n1 cup sifted cake flour\n1 teaspoon baking powder\n1/4 teaspoon salt\n4 eggs, separated\n1 cup granulated sugar\n1/4 cup cold water\n1 teaspoon vanilla"
Unless you want to break it up into separate lines, that is.
OPPS too late ... about the cake thing - you've got it declared as an int (primitive / atomic variable type), and then try to define it as an Object.