Click here to Skip to main content
16,020,345 members
Home / Discussions / Java
   

Java

 
AnswerRe: About Calculate.... lt compiles but the calculating is always false......could someone help me to correct this code..... Pin
Cedric Moonen19-Jan-11 1:35
Cedric Moonen19-Jan-11 1:35 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 2:31
Khalil Adam19-Jan-11 2:31 
GeneralRe: About Calculate.... lt compiles but the calculating is always false......could someone help me to correct this code..... Pin
Cedric Moonen19-Jan-11 2:59
Cedric Moonen19-Jan-11 2:59 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 3:10
Khalil Adam19-Jan-11 3:10 
GeneralRe: About Calculate.... lt compiles but the calculating is always false......could someone help me to correct this code..... Pin
Richard MacCutchan19-Jan-11 3:14
mveRichard MacCutchan19-Jan-11 3:14 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 3:26
Khalil Adam19-Jan-11 3:26 
GeneralRe: About Calculate.... Pin
Cedric Moonen19-Jan-11 3:29
Cedric Moonen19-Jan-11 3:29 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 3:45
Khalil Adam19-Jan-11 3:45 
//l've change the code but still 1 error has been occur

public static void main(String [] args)
{
String sign;
int num1;
int num2;
//int num3;
int ans;

System.out.print("Enter your Calculations =>: \n");
sign = in.nextLine();


if(args.Length == 3)
{
num1 = Integer.parseInt(args[0]);
sign = (args [1].equal("1"));
num2 = Integer.parseInt(args[2]);
//num3 = Integer.parseInt(args[3]);

System.out.println("Answer = "+ ans);
}else if(args[0].equal("+")) {
ans1 = num1 + num2;
System.out.println("num1 "+ "num2 " = ans);
}
else if(args[1].equal("-")) {
ans2 = num1 - num2;
System.out.println("num1 "- "num2 "= ans);
}
else if(args[2].equal("/")) {
ans3 = num1 / num2;
System.out.println("num1 "/ "num2 "= ans);
}
System.err.println("Try Again");
}
}
}
GeneralRe: About Calculate.... Pin
Cedric Moonen19-Jan-11 3:58
Cedric Moonen19-Jan-11 3:58 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 4:14
Khalil Adam19-Jan-11 4:14 
GeneralRe: About Calculate.... Pin
Richard MacCutchan19-Jan-11 5:19
mveRichard MacCutchan19-Jan-11 5:19 
GeneralRe: About Calculate.... Pin
TorstenH.19-Jan-11 22:20
TorstenH.19-Jan-11 22:20 
Generalthanks Cedric, Pin
Khalil Adam20-Jan-11 1:57
Khalil Adam20-Jan-11 1:57 
GeneralAbout Calculate.... Pin
Khalil Adam20-Jan-11 3:06
Khalil Adam20-Jan-11 3:06 
Questionwhat does this errors means? Pin
pancakeleh18-Jan-11 19:54
pancakeleh18-Jan-11 19:54 
AnswerRe: what does this errors means? Pin
TorstenH.18-Jan-11 20:38
TorstenH.18-Jan-11 20:38 
General[THEORETICAL] Layering I/O streams Pin
shpid3r18-Jan-11 6:58
shpid3r18-Jan-11 6:58 
GeneralRe: [THEORETICAL] Layering I/O streams Pin
TorstenH.18-Jan-11 20:40
TorstenH.18-Jan-11 20:40 
QuestionHow to make indentation in less time?? Pin
aesthetic.crazy17-Jan-11 7:03
aesthetic.crazy17-Jan-11 7:03 
AnswerRe: How to make indentation in less time?? Pin
Cedric Moonen17-Jan-11 8:19
Cedric Moonen17-Jan-11 8:19 
AnswerRe: How to make indentation in less time?? Pin
David Skelly17-Jan-11 22:17
David Skelly17-Jan-11 22:17 
AnswerRe: How to make indentation in less time?? Pin
TorstenH.18-Jan-11 1:49
TorstenH.18-Jan-11 1:49 
AnswerRe: How to make indentation in less time?? Pin
Yadav Akash21-Mar-11 2:39
Yadav Akash21-Mar-11 2:39 
QuestionResultSet to Int [modified] Pin
pancakeleh16-Jan-11 15:54
pancakeleh16-Jan-11 15:54 
AnswerRe: ResultSet to Int Pin
pancakeleh16-Jan-11 21:23
pancakeleh16-Jan-11 21:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.