Write a method , makeSubjectLine, that gets a String argument and returns the same String but with "Subject: " in front of it. So if the argument is "Are you going to the show?" the method returns "Subject: Are you going to the show?".
  • public int min (int aint, int bint){ return Math.min(aint, bint);}
  • public static int twice(int a) {int b = 2 * a;return b;}
  • public static int add(int a, int b) {int c = a + b;return c;}
  • public String makeSubjectLine(String text) { return "Subject: " + text; }
Write the definition of a method min that has two int parameters and returns the smaller.
  • public int min (int aint, int bint){ return Math.min(aint, bint);}
  • public static int add(int a, int b) {int c = a + b;return c;}
  • public String makeSubjectLine(String text) { return "Subject: " + text; }
  • public static int twice(int a) {int b = 2 * a;return b;}
toThePowerOf is a method that accepts two int arguments and returns the value of the first parameter raised to the power of the second.An int variable cubeSide has already been declared and initialized . Another int variable , cubeVolume, has already been declared .Write a statement that calls toThePowerOf to compute the value of cubeSide raised to the power of 3 and that stores this value in cubeVolume.Assume that toThePowerOf is defined in the same class that calls it.
  • cubeVolume = toThePowerOf(cubeSide, 3);
  • max(population1, population2)
  • public static int twice(int a) {int b = 2 * a;return b;}
  • eurasiaSales = add(euroSales, asiaSales);
max is a method that accepts two int arguments and returns the value of the larger one.Two int variables , population1 and population2, have already been declared and initialized .Write an expression (not a statement !) whose value is the larger of population1 and population2 by calling max.Assume that max is defined in the same class that calls it.
  • max(population1, population2)
  • cubeVolume = toThePowerOf(cubeSide, 3);
  • public String makeSubjectLine(String text) { return "Subject: " + text; }
  • eurasiaSales = add(euroSales, asiaSales);
Assume that x is a variable that has been declared as a double and been given a value . Write an expression to compute the quartic root of x. The quartic root of a number is the square root of its square root. EXAMPLES: For example, the quartic root of 16.0 is 2.0 because: the square root of 16.0 is 4.0 and the square root of 4.0 is 2.Another example: the quartic root of 81.0 is 3.0 because the square root of 81.0 is 9.0 and the square root of 9.0 is 3.Thus, to find the quartic root of a number you take the square root of the number and then take the square root of that. In this exercise you must find the quartic root of x in a single expression -- you must not write any statements . Also, you may only use the sqrt() static method defined in the Math class -- no other methods . (HINT: you will need to call the Math.sqrt() method twice-- and you will need to pass the return value of one of those calls as argument to the other call. AND REMEMBER: write an expression , not a statement .)
  • cubeVolume = toThePowerOf(cubeSide, 3);
  • max(population1, population2)
  • printTodaysDate();
  • Math.sqrt(Math.sqrt(x))
Write the definition of a method printAttitude, which has an int parameter and returns nothing. The method prints a message to standard output depending on the value of its parameter .If the parameter equals 1, the method prints disagreeIf the parameter equals 2, the method prints no opinionIf the parameter equals 3, the method prints agreeIn the case of other values , the method does nothing.Each message is printed on a line by itself.
  • public static int add(int a, int b) {int c = a + b;return c;}
  • void printAttitude (int pint){ if (pint == 1){ System.out.println("disagree"); } if (pint == 2){ System.out.println("no opinion"); } if (pint == 3){ System.out.println("agree"); }}
  • public int min (int aint, int bint){ return Math.min(aint, bint);}
  • public static int twice(int a) {int b = 2 * a;return b;}
add is a method that accepts two int arguments and returns their sum .Two int variables , euroSales and asiaSales, have already been declared and initialized . Another int variable , eurasiaSales, has already been declared .Write a statement that calls add to compute the sum of euroSales and asiaSales and that stores this value in eurasiaSales.Assume that add is defined in the same class that calls it.
  • cubeVolume = toThePowerOf(cubeSide, 3);
  • eurasiaSales = add(euroSales, asiaSales);
  • max(population1, population2)
  • public String makeSubjectLine(String text) { return "Subject: " + text; }
Write the code for invoking a method named sendObject. There is one argument for this method which is of type Customer. Assume that there is a reference to an object of type Customer, in a variable called John_Doe. Use this reference as your argument .Assume that sendObject is defined in the same class that calls it.
  • max(population1, population2)
  • void printAttitude (int pint){ if (pint == 1){ System.out.println("disagree"); } if (pint == 2){ System.out.println("no opinion"); } if (pint == 3){ System.out.println("agree"); }}
  • sendObject(John_Doe);
  • public String makeSubjectLine(String text) { return "Subject: " + text; }
Write the definition of a method add, which receives two integer parameters and returns their sum .
  • public static int twice(int a) {int b = 2 * a;return b;}
  • public String makeSubjectLine(String text) { return "Subject: " + text; }
  • public int min (int aint, int bint){ return Math.min(aint, bint);}
  • public static int add(int a, int b) {int c = a + b;return c;}
0 h : 0 m : 1 s

Answered Not Answered Not Visited Correct : 0 Incorrect : 0