Question: public class ExerciseMethods 1 { / * * Integer method returns the maximum range between the 4 numbers given. intRange ( 1 , 2 ,
public class ExerciseMethods
Integer method returns the maximum range between the numbers given.
intRange returns
intRange returns
intRange returns
intRange returns
intRange returns
@param num int,
@param num int,
@param num int,
@param num int,
@return the distance between the max and min numbers given.
public static int intRangeint num int num int num int num
Your answer here. Edit the return statement as necessary.
return ;only here to compile, you will need to change.
end intRange
Integer method returns the integer given reversed. Leading zeros do not
need to show.
intReverse returns
intReverse returns
intReverse returns
intReverse returns
@param num int,
@return the integer given in reverse order.
public static int intReverseint num
Your answer here. Edit the return statement as necessary.
return ;only here to compile, you will need to change.
end intReverse
Double method returns the sum of the areas of individual triangles.
The baseheight of each triangle are equal and are given.
negitives can represent location as well as dimention
The formula for triangle area is bh and in our case,
b h num.
threeTriangles returns
threeTriangles returns
threeTriangles returns
threeTriangles returns
threeTriangles returns
@param num double
@param num double
@param num double
@return the sum of the area of all three triangles.
public static double threeTrianglesdouble num double num double num
Your answer here. Edit the return statement as necessary.
return ;only here to compile, you will need to change.
end threeTriangles
Double method returns the fractional part of the number given.
due to internal storage of floating point numbers, this will not
look exactly the same.
fractionalPart returns
fractionalPart returns
fractionalPart returns
fractionalPart returns
@param num double
@return The fractional part of the number.
public static double fractionalPartdouble num
Your answer here. Edit the return statement as necessary.
return ;only here to compile, you will need to change.
end fractionalPart
boolean method returns true if the given string ends with the same letter it
begins with, regardless of case false if otherwise
firstLastEqualRobert returns false
firstLastEqualAriana returns true
firstLastEqualTaco cat" returns true
firstLastEqual returns false
firstLastEqual returns false
firstLastEqualGoodness clean up that dog" returns true
firstLastEqualHoHOho returns false
@param original String,
@return true if ignoring case the first letter is the same as the last
letter Not just last character False otherwise.
public static boolean firstLastEqualString original
Your answer here. Edit the return statement as necessary.
return false;only here to compile, you will need to change.
end firstLastEqual
boolean method that returns true if the first string is shorter than the
second false if otherwise
shorterThanRobert "Robert" returns false
shorterThanRobert "Susie Q returns true
shorterThan "anything" returns true
shorterThanabcxyz returns false
@param s String,
@param s String,
@return true if string is shorter than string
public static boolean shorterThanString s String s
Your answer here. Edit the return statement as necessary.
return true; only here to compile, you will need to change.
end shorterThan
String method returns the given string reversed.
stringReverseTaco Casa" returns "asaC ocaT"
stringReversewhats up returns pu s'tahw"
stringReverse returns
stringReversePlatform Nine and ThreeQuarters" returns
"sretrauQeerhT dna eniN mroftalP"
stringReverse returns
stringReverse returns
@param s String,
@return the given string in reverse.
public static String stringReverseString s
Your answer here. Edit the return statement as necessary.
return ;
end stringReverse
Arrays are not allowed for this exercise. Do not use StringBuilder, imports, etc.
Compile code after completing each method using the javac command.
Evaluate the results using the java command.
Ensure all tests for a method, including hidden ones, pass for credit.
Avoid hardcoding; Gradescope will validate logic with additional hidden inputs.
Ensure the code compiles without errors. The code must compile without errors to receiv
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
