Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Cannot find symbol?

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cannot find symbol?

    hey really strange error...help please.
    this is my code

    import javax.swing.JOptionPane;
     
    class GearPumps
    {
    	public static void main(String[]args)
    	{
     
    	String input1;
    	String input2;
    	String input3;
    	double gearw;
    	double borediameter;
    	double gearchambers;
    	double gpm;
    	double cir;
    	int again;
     
    		do
    		{
    			//This gets the input for the equations.
    			input1 = JOptionPane.showInputDialog("Enter the gear width in Inches.");
    			input2 = JOptionPane.showInputDialog("Enter the Bore Diameter.");
    			input3 = JOptionPane.showInputDialog("Enter the distance across both Gear Chambers.");
     
     
    			//converts the inputed strings to a double
     
    			gearw = Double.parseDouble(input1);
    			borediameter = Double.parseDouble(input2);
    			gearchambers = Double.parseDouble(input3);
     
    			//sets formulas for cubic inch revolution and gallons per minute;
    			gpm =( 47.0 * gearw * ((2.0*borediameter)-gearchambers) * (gearchambers - borediameter)/2);
     
    			cir = (6.0 * gearw ((2.0 * borediameter) -gearchambers) * (gearchambers - borediameter)/2);
     
    			//displays results
    			JOptionPane.showMessageDialog(null,"GPM: "+ gpm  + "CIR: "+cir);
     
     
    			//ask user to go again.
    			again = JOptionPane.showConfirmDialog(null, "Another calculation?");
     
    		}
    		while(again  == JOptionPane.YES_OPTION);
    	}
    }

    and i get this error:
    GearPumps.java:35: cannot find symbol
    symbol : method gearw(double)
    location: class GearPumps
    cir = (6.0 * gearw ((2.0 * borediameter) -gearchambers) * (gearchambers - borediameter)/2);


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Cannot find symbol?

    Not strange at all ...look closely at the code
    gearw ((//
    vs
    gearw  * ((

  3. #3
    Junior Member
    Join Date
    Sep 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cannot find symbol?

    hm?
    i didnt put // though, i have the ((

  4. #4
    Junior Member
    Join Date
    Sep 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cannot find symbol?

    oooh i c my bad...didnt look closely enough. thank you!

Similar Threads

  1. Help with Cannot Find Symbol Variable errors
    By skboone in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 20th, 2010, 10:52 AM
  2. cannot find symbol Error
    By bananasplitkids in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 9th, 2010, 02:36 AM
  3. Why the compiler can not find the symbol?
    By AlicNewbie in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 16th, 2010, 08:16 PM
  4. cannot find symbol - method
    By kyuss in forum Object Oriented Programming
    Replies: 2
    Last Post: December 7th, 2009, 01:01 PM
  5. cannot find symbol variable radius?
    By noobish in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 4th, 2009, 10:29 AM