Question: Consider the following method. public void numberCheck(int maxNum) { int typeA = 0; int typeB = 0; int typeC = 0; for (int k =

Consider the following method.

public void numberCheck(int maxNum) { int typeA = 0; int typeB = 0; int typeC = 0; for (int k = 1; k <= maxNum; k++) { if (k % 2 == 0 && k % 5 == 0) typeA++; if (k % 2 == 0) typeB++; if (k % 5 == 0) typeC++; }

System.out.println (typeA + " " + type B + " " + typeC); }

What is printed as a result of the call numberCheck(50)?

Question 20 options:

A)

5 20 5

B)

5 25 10

C)

5 25 5

D)

30 25 10

E)

5 20 10

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 Databases Questions!