Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Is it clear what happens if an employee violates the policy?

Answered: 1 week ago

Question

=+free to pirate employees from competitors?

Answered: 1 week ago