Question: import java.util.Scanner; public class Lab09 { public static void main ( String[] args ) { int num; Scanner in = new Scanner(System. in ); System.

import java.util.Scanner; public class Lab09{  public static void main(String[] args) {   int num;   Scanner in = new Scanner(System.in);   System.out.print(" Enter a number : ");   num = in.nextInt();   for(int i = 1;i <= num;i++){    if(i % 2 != 0)     System.out.print(2*i+" ");    else     System.out.print(-(2*i-1)+" ");   }   System.out.println();  }  static boolean isEven(int num) {   if (num % 2 == 0) {     return true;   } else {     return false;   }  } } 

add a method and call it multiple3or7(num) that gets an int number and returns true if the number is a multiple of 3 or 7.

Then, use that method inside your loop to count how many numbers are a multiple of 3 or 7. Match the formatting below.

>run Lab09 Enter a number: 10 2 -3 6 -7 10 -11 14 -15 18 -19 10: 6 multiple of 3 or 7 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!