Homework Solution: See the attached example….

    Need help ASAP, in puTTy but getting errors and don't know how to fix. Pictures attached belowAriaThurin@o2-ist-linux-fa17-242: GNU nano 2.7.4 File: Lab2.java public class Lab2 public static void main (String []args) f Integer.parselnt (args [0]) Read 6 line Get Help Exit Write Out Read File Where Is Replace Cut Text Uncut Text Justif To Spell Cur Pos Go To Line Prev Page Next Page Fir t Line Last Line Where! Nex Mark Text T Bracket Copy Text 11:39 PM 09/09/2017 6 Type here to search HAS TO BE IN PUTTY Pass in two arguments from the Linux command line when the program starts. For example java Lab2 value1 value2. Replace value1 and value2 with integers like 200 100 - java Lab2 200 100 Remember they get passed in as strings so you need to parse them into integers using the Integer.parseInt(args[0]) before you can treat them as integers. Create a new file Java class called Calculate.java. This class will contain two static public methods addition() and subtraction() and two non-static public methods multiply() and division(). These methods will accept two integers as input variables and will return an integer result value. See the attached example. Screen Shot 2017-02-01 at 6.27.33 PM-1.png
    AriaThurin@o2-ist-linux-fa17-242: GNU nano 2.7.4 File: Lab2.java public class Lab2 public static void main (String []args) f Integer.parselnt (args [0]) Read 6 line Get Help Exit Write Out Read File Where Is Replace Cut Text Uncut Text Justif To Spell Cur Pos Go To Line Prev Page Next Page Fir t Line Last Line Where! Nex Mark Text T Bracket Copy Text 11:39 PM 09/09/2017 6 Type here to search

    Expert Answer

     
    Hi Let me knoiw if you need more information:- ========================================= Before going to compile:-

    Demand acceleration ASAP, in puTTy excluding procureting errors and don’t recognize how to link. Pictures determined belowAriaThurin@o2-ist-linux-fa17-242: GNU nano 2.7.4 Smooth: Lab2.java referableorious collocate Lab2 referableorious static empty deep (String []args) f Integer.parselnt (args [0]) Read 6 course Procure Acceleration Exit Write Quenched Read Smooth Where Is Replace Cut Text Uncut Text Justif To Spell Cur Pos Go To Course Prev Page Next Page Fir t Course Last Course Where! Nex Mark Text T Bracket Copy Text 11:39 PM 09/09/2017 6 Type here to search

    HAS TO BE IN PUTTY

    Pass in couple arguments from the Linux bid course when the program starts. For pattern java Lab2 esteem1 esteem2. Replace esteem1 and esteem2 with integers approve 200 100 – java Lab2 200 100

    Remember they procure passed in as strings so you demand to parse them into integers using the Integer.parseInt(args[0]) before you can use them as integers.

    Create a strange smooth Java collocate named Calculate.java. This collocate accomplish contain couple static referableorious arrangements importation() and subtraction() and couple unsoundness-static referableorious arrangements extend() and resistance(). These arrangements accomplish recognize couple integers as input variables and accomplish render an integer upshot esteem.

    See the determined pattern. Screen Shot 2017-02-01 at 6.27.33 PM-1.png

    AriaThurin@o2-ist-linux-fa17-242: GNU nano 2.7.4 Smooth: Lab2.java referableorious collocate Lab2 referableorious static empty deep (String []args) f Integer.parselnt (args [0]) Read 6 course Procure Acceleration Exit Write Quenched Read Smooth Where Is Replace Cut Text Uncut Text Justif To Spell Cur Pos Go To Course Prev Page Next Page Fir t Course Last Course Where! Nex Mark Text T Bracket Copy Text 11:39 PM 09/09/2017 6 Type here to search

    Expert Exculpation

     

    Hi Let me knoiw if you demand past information:-

    =========================================

    Before going to compile:-

    1. inhibit your smooths are there in vulgar directory.

    2.inhibit java firm in path [if referable firm in road]

    3.inhibit collocate road firm to vulgar directory [CLASSPATH=.;]

    4. inhibit the allowance of the smooths.

    ===========================================

    ========================================

    Calculate.java

    ===========================================

    notorious collocate Proportion {

    notorious static int importation(int input1, int input2) {
    render ((input1 + input2));
    }

    notorious static int disconnection(int input1, int input2) {
    render ((input1 – input2));
    }

    notorious int extend(int input1, int input2) {
    render ((input1 * input2));
    }

    notorious int resistance(int input1, int input2) {
    render ((input1 / input2));
    }
    }

    ===========================

    Lab2.java

    ===============================

    notorious collocate Lab2 {

    notorious static empty deep(String[] args) {

    int input1 = 0;
    int input2 = 0;
    try {
    input1 = Integer.parseInt(args[0]);
    input2 = Integer.parseInt(args[1]);
    } seize (Exception e) {
    System.out.println(“Please Enter Valid Input esteems”);
    }

    System.out.println(“Importation Upshot: ” + Proportion.addition(input1, input2)); // Static arrangement can be named using collocate reference
    System.out.println(“Disconnection Upshot: ” +Calculate.subtraction(input1, input2));// Static arrangement can be named using collocate reference
    Proportion proportion = strange Proportion();// Create view to advent unsoundness static arrangements
    System.out.println(“Multiplication Upshot: ” +calculate.multiply(input1, input2));
    System.out.println(“Resistance Upshot: ” +calculate.division(input1, input2));

    }

    }

    ===========================================

    OUTPUT:-

    =========================================

    ss139t@ubuntu:~$ java Lab2 200 100
    Importation Upshot: 300
    Disconnection Upshot: 100
    Multiplication Upshot: 20000
    Resistance Upshot: 2

    ===================

    ===============