Click here to Skip to main content
15,899,475 members
Home / Discussions / Java
   

Java

 
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 
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 
Mr. Cedric Moonen Smile | :)
bellow is the code that l did compile and it works perfectly..thanks alot..





public class Calculate {

public static void main(String[] args) {
double x,y;

if (args.length == 3)
{
x = Double.parseDouble(args[0]);
y = Double.parseDouble(args[2]);

if(args[1].equals("+"))
{
System.out.println("Answer = "+ (x + y));
}else
if(args[1].equals("-"))
{
System.out.println("Answer = "+ (x - y));
}else
if(args[1].equals("/"))
{
System.out.println("Answer = "+ (x / y));
}else
if(args[1].equals("x"))
{
System.out.println("Answer = "+ (x * y));
}
}else
System.out.println("Do it again......");
}

}


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 
GeneralRe: ResultSet to Int Pin
David Skelly16-Jan-11 22:29
David Skelly16-Jan-11 22:29 
GeneralRe: ResultSet to Int Pin
Richard MacCutchan17-Jan-11 0:36
mveRichard MacCutchan17-Jan-11 0:36 
GeneralRe: ResultSet to Int Pin
jschell17-Jan-11 8:27
jschell17-Jan-11 8:27 
GeneralRe: ResultSet to Int Pin
pancakeleh17-Jan-11 14:30
pancakeleh17-Jan-11 14:30 
GeneralRe: ResultSet to Int Pin
Khalil Adam19-Jan-11 1:27
Khalil Adam19-Jan-11 1:27 
Questionwhat is the basic purpose of static class/methode Pin
khurram_shahzad15-Jan-11 3:21
khurram_shahzad15-Jan-11 3:21 

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.