Results 1 to 6 of 6
  1. #1
    Concacaf is offline Newb Member
    Join Date
    May 2011
    Location
    Canada
    Posts
    1
    Rep Power
    0

    Exclamation Cannot Find Symbol

    I hope the arbitrary title is good enough for a hint. I do have the code here, and hope that I could get some successful compiling done. I'm such a newb. I'm using notepad... ended up with about 38 errors. Anyways, here it is:





    mport java.util.*;
    public class IceCreamShop{
    public static void main (String[] args)
    {
    {
    Scanner inputit = new Scanner(System.in);
    double numChoc, numStraw, numVan, cost, cost1, cost2, total, choc =40, straw = 35, van = 30;
    String month, yesno;
    }
    {
    System.out.println("Would you like to make an order?");
    yesno = inputit.nextLine();
    while (yesno.equals ("Yes") || (yesno.equals ("yes")));
    }
    {
    System.out.println("Enter The month your in: ");
    month = inputit.nextLine();

    System.out.println("Please Enter the number of Chocolate tubs you would like to buy: ");
    numChoc = inputit.nextInt();

    System.out.println("Please Enter the number of Strawberry tubs you would like to buy: " );
    numStraw = inputit.nextInt();

    System.out.println("Please Enter the number of Vanilla tubs you would like to buy: ");
    numVan = inputit.nextInt();
    }

    {
    if (month.equals ("feb") || month.equals ("Feb") || month.equals ("febuary") || month.equals ("Febuary")){
    choc = 40 * 0.8;
    straw = 35 * 0.7;
    van = 30 * 0.8;
    }
    }
    {
    cost = numChoc * choc;
    cost1 = numStraw * straw;
    cost2 = numVan * van;
    total = cost + cost1 + cost2;
    }
    {
    System.out.println("The price of the Chocolate tubs you orders will cost: " + cost);
    System.out.println("The price of the StawBerry tubs you orders will cost: " + cost1);
    System.out.println("The price of the Vanilla tubs you orders will cost: " + cost2);
    System.out.println("The total price of the tubs you orders will cost: " + total);
    }
    {
    System.out.println("Would you like to make another order?");
    yesno = inputit.nextLine();
    }
    }
    }
    Last edited by Concacaf; 05-09-2011 at 08:44 AM. Reason: Possibly necessary information left out.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,447
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Concacaf View Post
    I hope the arbitrary title is good enough for a hint. I do have the code here, and hope that I could get some successful compiling done. I'm such a newb. I'm using notepad... ended up with about 38 errors. Anyways, here it is: [snip]
    And you don't show even one of them? Do you want us to guess?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    BZwap's Avatar
    BZwap is offline Member
    Join Date
    May 2011
    Location
    Lucknow
    Posts
    8
    Rep Power
    0

    Default

    import java.util.*;
    public class IceCreamShop{
    public static void main (String[] args)
    {
    Scanner inputit = new Scanner(System.in);
    double numChoc, numStraw, numVan, cost, cost1, cost2, total, choc =40, straw = 35, van = 30;
    String month, yesno;
    System.out.println("Would you like to make an order?");
    yesno = inputit.next();
    if(yesno.equalsIgnoreCase("yes"))
    {
    for(;;)
    {
    System.out.println("Enter The month your in: ");
    month = inputit.next();
    System.out.println("Please Enter the number of Chocolate tubs you would like to buy: ");
    numChoc = inputit.nextInt();
    System.out.println("Please Enter the number of Strawberry tubs you would like to buy: " );
    numStraw = inputit.nextInt();
    System.out.println("Please Enter the number of Vanilla tubs you would like to buy: ");
    numVan = inputit.nextInt();
    if ((month.equals ("feb")) || (month.equals ("Feb")) || (month.equals ("febuary")) || (month.equals ("Febuary"))){
    choc = 40 * 0.8;
    straw = 35 * 0.7;
    van = 30 * 0.8;
    cost = numChoc * choc;
    cost1 = numStraw * straw;
    cost2 = numVan * van;
    total = cost + cost1 + cost2;
    System.out.println("The price of the Chocolate tubs you orders will cost: " + cost);
    System.out.println("The price of the StawBerry tubs you orders will cost: " + cost1);
    System.out.println("The price of the Vanilla tubs you orders will cost: " + cost2);
    System.out.println("The total price of the tubs you orders will cost: " + total);
    System.out.println("Would you like to make another order?");
    yesno = inputit.next();
    if(yesno.equalsIgnoreCase("yes"))
    continue;
    else System.exit(0);
    }else System.exit(0);
    }
    }
    }
    }

    __________________________________________________ ________________________
    Use this code

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,447
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by BZwap View Post
    Use this code
    I am not going to guess; look at the mess: unformatted code (use those [code] ... [/code] tags) and get rid of those silly smilies in your code; show us where the errors happened and what the errors were.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Solarsonic is offline Senior Member
    Join Date
    Mar 2011
    Posts
    261
    Rep Power
    4

    Default

    That code is just completely messed up. Recode it with a decent editor like Eclipse.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    Learning in notepad (or similar basic text editor) is generally a good idea, if nothing else it forces you to understand how the compiler works.

Similar Threads

  1. Cannot find Symbol
    By webbby in forum New To Java
    Replies: 3
    Last Post: 04-14-2011, 12:51 AM
  2. Cannot find symbol
    By TripleZigZag in forum New To Java
    Replies: 4
    Last Post: 02-02-2011, 02:36 AM
  3. can't find symbol
    By globo in forum New To Java
    Replies: 21
    Last Post: 01-17-2011, 04:06 AM
  4. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  5. Replies: 3
    Last Post: 05-01-2008, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •