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

Problem 14: all 5 parts must be complete to receive credit for the question /**

ID: 3741600 • Letter: P

Question

Problem 14: all 5 parts must be complete to receive credit for the question
  
/**
* q1: Write a public static method named q1 that takes no parameters and returns void. The
* method should print all the integers from -8 to 47 to the screen. The output should be
* inclusive of these end points
*/
  
  
  
  
/**
* q2: Write a public static method named q2 that takes two ints as parameters and returns a
* boolean. The output should be the evaluation of the boolean expression: The first
* parameter is less than or equal to 25 or the second parameter is less than 2
*/
  
  
  
  
/**
* q3: Write a public static method named q3 that takes a String as a parameter and returns a
* String. The returned String is based on the input String as follows:
*
* If the input String has no characters, return "empty"
* If the input String has less than 3 characters, return "short"
* If the input String has 3 or more characters but less than 12, return "medium"
* If the input String has greater than or equal to 12 characters, return "long"
* If the input String contains any instances of the letter 'y', return "found y" regardless
* of the length of the input
*/
  
  
  
  
/**
* q4: Write a public static method named q4 that takes two ints as parameters and returns a
* boolean. The output should be the evaluation of the boolean expression: The first
* parameter is less than or equal to -9 and the second parameter is less than or equal to 2
*/
  
  
  
  
/**
* q5: Write a public static method named q5 that takes no parameters and returns void. The
* method should print all the integers from 1 to 69 to the screen. The output should be
* inclusive of these end points
*/
  
  
  
  
public static void main(String[] args){
  
/* Test your code here to verify it is correct before submitting */
  
}
}

Explanation / Answer

public class Qs { /** * q1: Write a public static method named q1 that takes no parameters and returns void. The * method should print all the integers from -8 to 47 to the screen. The output should be * inclusive of these end points */ public static void q1() { for (int i = -8; i