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

This is what I have so far but I know it is not right I am wrong....I need help.

ID: 3626679 • Letter: T

Question

This is what I have so far but I know it is not right I am wrong....I need help...its a loop and needs to have this in it somehow::
for (x=100; x<=200; x++)
{
if (x%5==0)

print - yes x is evenly divisible by 5....system.out.println...
if(x%6==0)

print - yes x is evenly divisible by 6....system.out.println...(i cant figure it out??)

here it is::::

public class Test {

public static void main(String[] args) {
boolean b6, b5;
String s = "";
int iTotal = 0;
for (int i=100; i <= 200; i++) {
b5 = (i % 5) == 0;
b6 = (i % 6) == 0;

if ((b5 || b6) && (!(b5 && b6)) ) {
iTotal++;
s = s + " " + i;
if (iTotal == 10) {
System.out.println(s);
iTotal = 0;
s = "";
}
}
}
if (s.length() > 0)
System.out.println(s);
}

}

Explanation / Answer

hope this will give u an idea how to do it this is a program for prime numbers up to 100 class PrimeNum { //Program to generate prime numbers from 1 to 100 public static void main(String args[]){ int num1,num2; int flag=0; //Checks to see if the number in question is prime or not for(num1=1;num1
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote