Answered step by step
Verified Expert Solution
Question
1 Approved Answer
16. If a is 8316 and b = 500, what does mx return? 17. (8 pts) Rewrite the mx method so that it uses a
16. If a is 8316 and b = 500, what does mx return? 17. (8 pts) Rewrite the mx method so that it uses a helper method. The helper method should contain only one loop. The rewritten mx method should have no loops. public int mx{ int a, int b) { } public int mx{ int a, int b) { int c1 = 1; while( a >= 10) { a = a/10; c1++; } int c2 = 1; while b >= 10 ) { b = b/10; c2++; } return c1 + c2; } private {
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started