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

ublic class JavaLogicStructures { /* 1. Method singleIf(int i, int j) * 2. Takes

ID: 440655 • Letter: U

Question

ublic class JavaLogicStructures { /* 1. Method singleIf(int i, int j) * 2. Takes two integer arguments i, j and determines if i is greater than * j. * 3. If i is greater than j the function should print out: * Executing singleIf method. * Result: i is greater than j * Value of i was: xxx * Value of j was: yyy */ public void singleIf(int i, int j){ // singleIf /* 1. Method doubleIf(int i, int j) * 2. Takes two integer arguments and prints out which one was larger and * its value * 3. The function should print out: * Execution doubleIf method. * Result: i was larger and its value was: xxx */ } public void doubleIf(int i, int j){ } // doubleIf /* 1. Method switchStruc(int i) * 2. This method takes a single integer as an argument. This integer will * be the selector value for a switch statement found inside the method. * 3. The value of the selector lies between 1 and 5, anything outside this * range should not be evaluated. * 4. For any given i, i -> {1, 2, 3, 4, 5} the function should print out: * Executing the switch function. * Result: A selector value of xxx was passed into the function * *** If a selector value outside of the range is passed in the * the following message should appear *** * Result: A selector value outside the range of the function was chosen. */ public void switchStruc(int i){ } // switchStruc /*************************************************************************** * * Repetition structures * * ************************************************************************/ /* 1. Method whileLoop(int i) * 2. This method takes a single integer as input and repeats a loop the * number of times as set by the integer being passed in as an argument * 3. The function should add up each of the values that the iteator assumes * and print out a total. * 4. Example: i=3 -> 0+1+2+3 -> prints out 6 as a total */ public void whileLoop(int i){ } // whileLoop /* 1. Method doWhileLoop * 2. This method takes a single integer as input and repeats a do-while * loop the number of times the loop is executed. * 3. The function should add up each of the values that the iterator assumes * and print out a total. */ public void doWhileLoop(int i){ } /* 1. Method forLoop * 2 This method takes two integers as input and implement a for loop which * executes between i and j. * 3. The loop should add up the value of each of the iterators values and * print this total out. * 4. for exzmple: i-7,j-0 Total - 7+8+9 = 24 */ public void forWhileLoop(int i, int j){ } // forWhileLoop /* Method Math exercise, mathMethod * 1. This method exercise the Math package * 2. Generate x random numbers on the interval 0 to 360 * 3. x will be passed to the function as an integer * 4. Assume these to be directions given in degrees, convert these degrees * to radians * 5. Present a tabular output showing the degrees, radians, sin, cos,and tan * of each angle. */ public void mathMethod(int i) { }// mathMethod /* Method randomArray * 1. populate an array which contains 20 random integers * 2. print out the array after it is populated */ public void createArray(int [] theArray){ } /* Method selection sort array, selectionSort * 1. use the array generated by the createArray method given as an argument * as the inbound array * 2. implement a selection sort algorithm to sort it in ascending order * 3. Print the sorted array to the terminal */ public void selectionSort(int [] theArray){ } }

Explanation / Answer

The question is so far not clear.... however this may help you http://www.tutorialspoint.com/java/index.htm