NEED HELP! Java computer programmers needed?

Discussion in 'Off Topic' started by Please_Respect_Tables, Feb 24, 2015.

  1. I'm a c programmer but java is derived from it so you should be able to figure it out from this .

    It's asking you to basically use the arithmetic operators, if you don't know what they are google them . Program would look like this depending on what IDE you are using

    int DisplayNumberPlus10( int a, int b)
    {
    a = a 10;
    {return a;}

    b = b 10;
    {return b;}

    }

    int DisplayNumberPlus100( int a, int b)
    {
    a = a 100;
    {return a;}

    b = b 100;
    {return b;}
    }

    main()
    {
    int a= 3;
    int b = 5;

    cout << "This is the original values of variables a and b"<<"\n"<<endl;
    cout << "a ="<<a<< endl;
    cout << "b ="<<b<<"\n\n" <<endl;


    a= DisplayNumberPlus10(a,a);
    b= DisplayNumberPlus10(b,b);

    cout << "This is the result after calling the first function"<<"\n"<<endl;

    cout << "a ="<<a<< endl;
    cout << "b ="<<b<<"\n\n" << std::endl;

    a= DisplayNumberPlus100(a,a);
    b= DisplayNumberPlus100(b,b);

    cout << "This is the result after calling the second function"<<"\n"<<endl;
    cout << "a ="<<a<< endl;
    cout << "b ="<<b<< endl;

    return 0;
    }


    I've done 2 for you see if you can do the 3rd function on you're own. As for the next part getting user input google search for "Get line" and "Cin" these are basic programming functions to get a users keyboard input

    Hope this helps if not I'll be home tonight and I'll try and make the java version for you
     
  2. When you run the program it will look like this so far

    This is the original values of variables a and b

    a =3
    b =5


    This is the result after calling the first function

    a =13
    b =15


    This is the result after calling the second function

    a =113
    b =115
     
  3. He's not going to learn if you guys write it for him. If he doesn't learn he's just going to fail.


    Do him a favour, help him don't do it for him
     
  4. If you know some Cplusplus (yeah, idevice!), this should be pretty trivial to you.

    Just focus on what exactly has been asked, the rest is just semantics. Once you got the logic and be it only expressed in words, the rest gets easy.
     
  5. @scream pretty sure from what I read so far I would have to type import. Something something and Scanner. Something something for user input from keyboard  sadly that's all I remember......
     
  6. ??? What you talking about, are you trying to troll or just playing dumb . I've told you everything you need to know to do this task easy. If you just want to copy and paste someone else's work just quit now cos you will have zero chance of doing anything programming related .
     
  7. There's this thing called, "code academy." It's been teaching me how to code so far. Look into it, it's free.
     
  8. /**
    * @(#)ArithmeticMethods.java
    *
    *
    * @author
    * @version 1.00 2015/2/24
    */
    import java.util.Scanner;
    public class ArithmeticMethods2 {

    private static Scanner IO = new Scanner(System.in);

    public static void main(String[] args) {
    int a = 0, b = 0;
    System.out.print("Enter the value of A: ");
    a = IO.nextInt();
    System.out.print("Enter the value of B: ");
    b = IO.nextInt();
    System.out.println("A + 10 = " + displayNumberPlus10(a));
    System.out.println("A + 100 = " + displayNumberPlus100(a));
    System.out.println("A + 1000 = " + displayNumberPlus1000(a));
    System.out.println("B + 10 = " + displayNumberPlus10(b));
    System.out.println("B + 100 = " + displayNumberPlus100(b));
    System.out.println("B + 1000 = " + displayNumberPlus1000(b));
    }
    public static int displayNumberPlus10(int x){
    return x + 10;
    }
    public static int displayNumberPlus100(int y){
    return y + 100;
    }
    public static int displayNumberPlus1000(int z){
    return z + 1000;
    }
    }
     
  9. Because java is ass
     
  10. And C# is cancer
     
  11. Each language has its pros and cons.