Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

BAC3 Assignment Create an application named ArithmeticMethods whose main() metho

ID: 664005 • Letter: B

Question

BAC3 Assignment

Create an application named ArithmeticMethods whose main() method holds two integer variables. Assign values to the variables. In turn, pass each value to methods named displayNumberPlus10(), displayNumberPlus100(), and displayNumberPlus1000(). Create each method to perform the task its name implies. Save the application as ArithmeticMethods.java. Submit code below.

Paste your Code Answer here:

Modify the ArithmeticMethods class to accept the values of the two integers from a user at the keyboard. Save the file as ArithmeticMethods2.java. Submit code below.

Paste your Code Answer here:

Create an application named Percentages whose main() method holds two double variables. Assign values to the variables. Pass both the variables to a method named computePercent() that displays the two values and the value of the first number as a percentage of the second one. For example, if the numbers are 2.0 and 5.0, the method should display a statement similar to “2.0 is 40% of 5.0.” Then call the method a second time, passing the values in reverse order. Save the application as Percentages.java. Submit code below.

Paste your Code Answer here:

Modify the Percentages class to accept the values of the two doubles from a user at the keyboard. Save the file as Percentages2.java. Submit the code below.

Paste your Code Answer here:

Explanation / Answer

Class Airthmetic Methods

{

Public static void main(Strings [ ] args)

{

int length = 7, width = 8;

int k = length * breadth;

int m = DIsplayNumberPlus10(k):

Int q = DisplayNumberPlus100(k);

intp = DisplayNumberPlus1000(k);

System.out.println ( "Displaynumberplus 10 is"+m");

Sytem.out.println( "Displaynumberplus100 is "+q ");

System.out.println(Displaynumberplus1000 is "+p");

}

public static int DisplayNumberPlus10( int k)

{

k = k+10;

return result;

}

public static int DisplayNumberPlus100( int k)

{

k = k+100;

return result;

}

public static int DisplayNumberPlus1000( int k)

{

k = k+1000;

return result;

}

}

B)taking variables from the users

Class AirthmeticMethod

{

int length;

int breadth;

DisplayNumberPlus10( int x, int y)

{

length = x;

breadth = y;

int m   = length * breadth

m = m +10;

System.out.println("numberplus 10 ="+m);

}

DisplayNumberPlus100( int x, int y)

{

length = x;

breadth = y;

int m   = length * breadth

m = m +100;

System.out.println("numberplus 100 ="+m);

}

DisplayNumberPlus1000( int x, int y)

{

length = x;

breadth = y;

int m   = length * breadth

m = m +1000;

System.out.println("numberplus 1000 ="+m);

}

}

ClassAirthmeticMethods2

{

public static void main(Strings args [ ])

{

AirthmeticMethods method = new AirthmeticMethods ( );

method.DisplayNumberPlus10( 14 , 12);

method.DisplayNumberPlus100(13,15);

method .DisplayNumberPlus1000(16, 17);

}

}

C)

Class Percentages()

{

public static void main( String [ ] args)

{

double x = 2.0;

double y = 5.0;

double z = computePercent(double x, double y);

double z = computepercent (double y, double x);

System.out.println( "the value of z is = +z);

}

public static computePercent (double x, double y)

{

int result;

System.out.println(the value of x is ="+x);

System.out,println (the value of y is ="+y);

int k = (int) ( x * y /100.0);

System.out.println("String .format ("%.0f%%", percent));

}

}

D)

Class Percentages

{

double ist =x;

double 2nd = y;

computePercent( double ist, double 2nd)

{

float percent = ( y *x/100.0);

system.out.println(string.format("% .0f%%, percent));

}

}

Class percentages2

{

public static void main( Strings [ ] args)

{

Percentages percent = new percentages()

percent.computePercent(5.0, 2.0);

Percent.computePercent(2.0, 5.0);

}

}