Results 1 to 4 of 4
 10132014, 06:34 AM #1Member
 Join Date
 Oct 2014
 Posts
 2
 Rep Power
 0
Test Arithmetic java programming error
Hi
I have written this program but I am seeing error when I compile this program ( javac TestArithmetic.java).
1)TestArithmetic.java:26 cannot find symbol
2)symbol: class Arithmetic
3)location: class TestArithmetic
4) Arithmetic ar = new Arithmetic(x1,x2,x3);
1)TestArithmetic.java:26 cannot find symbol
2)symbol: class Arithmetic
3)location: class TestArithmetic
4) Arithmetic ar = new Arithmetic(x1,x2,x3);
2 errors. Can someone help me on this. Thx
import java.util.*;
class TestArithmetic {
public static void main (String[] args){
float number;
Scanner console= new Scanner (System.in);
System.out.println("Enter first number");
int x1 = console.nextInt();
System.out.println("Enter second number");
int x2 = console.nextInt();
System.out.println("Enter third number");
int x3 = console.nextInt();
Arithmetic ar = new Arithmetic(x1, x2, x3);
int answer1=ar.sum(x1,x2);
int answer2=ar.sum(x1,x2,x3);
int answer3=ar.substract(x1,x2);
double answer4=ar.divide(x1,x2);
int answer5=ar.modulas(x2,x3);
int answer6=ar.multiply(x2, x3);
boolean evenNumber1= ar.isEvenNumber(x2);
boolean evenNumber2= ar.isEvenNumber(x3);
System.out.println("Sum of x1 and x2 is "+answer1);
System.out.println("Sum of x1, x2, x3 is "+answer2);
System.out.println("Subtraction of x1 and x2 is "+answer3);
System.out.println("Division of x1 and x2 is "+answer4);
System.out.println("Modulas division of x2 and x3 is "+answer5);
System.out.println("Multiplication of x2 and x3 is "+answer6);
if (evenNumber1)
System.out.println("x2 is an even number");
else
System.out.println("x2 is an odd number");
if (evenNumber2)
System.out.println("x3 is an even number");
else
System.out.println("x3 is an odd number");
}
}
 10132014, 06:57 AM #2
Re: Test Arithmetic java programming error
If you're forever cleaning cobwebs, it's time to get rid of the spiders.
 10132014, 10:54 AM #3Senior Member
 Join Date
 Oct 2010
 Posts
 393
 Rep Power
 10
Re: Test Arithmetic java programming error
Hi insong04, welcome.
Firstly, please edit your code using th [code][/code] tags as shown in the link provided by Darryl. It makes reading code so much easier.
The code above shows just the main method which is fine. Your problem lies in code you have not shown.
These errors state that symbol has been used in the Arithmetic class and location has been used in the TestAritmetic classes, neither of which have been declared.
Regards.
 10182014, 04:24 PM #4Member
 Join Date
 Oct 2014
 Posts
 2
 Rep Power
 0
Similar Threads

NetPay java programming errorNeed help
By thessler1 in forum New To JavaReplies: 15Last Post: 06212012, 12:21 AM 
I am not able to clear java programming test.Please help me out
By arjit in forum New To JavaReplies: 3Last Post: 11162011, 10:37 AM 
Java Arithmetic Program. PLEASE HELP!
By Ahdood in forum New To JavaReplies: 9Last Post: 10312011, 09:15 AM 
Polynomial Arithmetic Java
By thisisIT in forum New To JavaReplies: 3Last Post: 03092010, 05:33 PM 
Test Advisory PanelTelecommute Test your Java skills + share insights on Java tests
By michelle in forum Jobs OfferedReplies: 0Last Post: 04052008, 12:38 AM
Bookmarks