Question: import java.util.Scanner; public class question2{ public static void main(String[] args){ Scanner in = new Scanner(System.in); System.out.println(Enter a number: ); boolean input = fizzBuzz(24); System.out.print(input); }
![import java.util.Scanner; public class question2{ public static void main(String[] args){ Scanner](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3bf3a0d224_23366f3bf394bc4f.jpg)
import java.util.Scanner;
public class question2{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.println("Enter a number: ");
boolean input = fizzBuzz(24);
System.out.print(input);
}
public static boolean fizzBuzz(int input){
if(input%3 == 0 && input%8 == 0)
{
return true;
}
else
{
return false;
}
}
}
import java.util.Scanner;
public class question3{
public static void main(String[] args){
int first = 0;
int second = 0;
Scanner in = new Scanner(System.in);
System.out.println(" Enter two numbers");
first = in.nextInt();
second = in.nextInt();
order(first,second);
}
public static void order(int first, int second){
if(first
System.out.println(" the numbers " + first + " and " + second + " are in correct order");
System.exit(0);
}
else{
int temp;
temp = first;
first = second;
second = temp;
System.out.println(" The numbers were not in ascending order and hence have been swapped ");
System.out.println(" first" + first + "second " + second);
System.exit(0);
}
}
}
I have done 2 and 3.
just need question4.
250 he nert heighest int. Eg 7 87 Should retun &.Use rath, ns tilen v meststs public static int myceil dutble imputy f your student rurntes orntosya ell method tnat takes in a douide and retuns an it Tre etures velue Stras e argument is divisible by both 3 an &. Return lse otewie public static boolean fizzeiul int tnputy 3.Write a void method tat accepts ints s amumersoe mwn s a single intl s an argument and returts tue tte Your method first determines that the argunents aveinfbe oreti lt si they are not (pint mesang letin h e public static void order (int first, int conp 4. WIrite a main method totest the metos a. Modify the main metholdto coletiyn Bonus: Modify the void method tocll he bolen method deme between low and high that are divisibe by and Bard rit tephe When that comple and runs propery p a s nt w the Lab TA your final workn progam andyour l set an
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
