Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

Khalil Adam

@Khalil Adam
About
Posts
10
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • About Calculate....
    K Khalil Adam

    Mr. Cedric Moonen :) 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......"); } }

    Java help java

  • About Calculate....
    K Khalil Adam

    l've done it the code has compiled?

    Java help java

  • About Calculate....
    K Khalil Adam

    Mr. Cedric, I think u've tried alot best for me but l did try what u said and l got 3 error. anyway,l appreciate very well for ur help since am a beginner in java and once l cant compile this code those not make me to stop learning?please if u get anytime,try and correct this code for another people to lean from it? remain bless always from God.. I'll go back and learn the tutorials...thanks.

    Java help java

  • About Calculate....
    K Khalil Adam

    //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"); } } }

    Java help java

  • About Calculate....
    K Khalil Adam

    Mr. Cedric please a question? 1- how should make the sign veriable work and? 2- how to initialize those to variables( num1 and num2)?

    Java help java

  • About Calculate....
    K Khalil Adam

    thanks again.. l dont wont u to write all the program for for but to guide me Fix the errors is all what l need..but thanks alot for ur time becouse this's my first time of sending a code in this forum...

    modified on Wednesday, January 19, 2011 10:02 AM

    Java help java

  • About Calculate....
    K Khalil Adam

    thanks alot Mr. Cedric the reason for this code is that l wonted to do CALCULATING IN JAVA? l understand u completely but for now,how should l make the code work(l mean to initialize it)and not to fall back the way l was before? thanks for ur alert for the tutorials.please help me for this one...

    modified on Wednesday, January 19, 2011 9:57 AM

    Java help java

  • why validation wont work?
    K Khalil Adam

    please pancakeleh, how did u do it?show as the code please...thanks alot..

    Java help question

  • ResultSet to Int [modified]
    K Khalil Adam

    thanks but where should u put all this code(mean to put it inside the try and catch or where...)

    Java database question debugging help tutorial

  • About Calculate....
    K Khalil Adam

    // I need someone to help me fix this codes // it's about CALCULATING in Java, thanks alot...

    import java.util.Scanner; public class Calculate { static Scanner in = new Scanner(System.in); 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]); ans = num1 + num2; ans = num1 - num2; ans = num1 / num2; System.out.println("Answer = "+ ans); }else if(args[1].equal("+")) { ans = num1 + num2; System.out.println("num1 "+ "num2 " = ans); } else if(args[2].equal("-")) { ans = num1 - num2; System.out.println("num1 "- "num2 "= ans); } else if(args[3].equal("/")) { ans = num1 / num2; System.out.println("num1 "/ "num2 "= ans); } else if("Do it again => Calculate arg1, arg2, arg3"); } } }

    modified on Wednesday, January 19, 2011 9:58 AM

    Java help java
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups