Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java get a thumbs up :) Question 2. (16 pts, 2 cach) Part A: Consider the following method: public static boolean methodAcinta, int b 1f

java get a thumbs up :)
image text in transcribed
Question 2. (16 pts, 2 cach) Part A: Consider the following method: public static boolean methodAcinta, int b 1f ( ac) 17 Cbce) return true; else return false; else return false; int ) Suppose you are writing a test method to test methodA. You include the following calls in the test method. Write the value that will be returned by each of the following three calls. 1. methodA(1, 2, 3) 11. methodA(3, 2, 1) 111. methodAC2, 1, 3) Tv. Write one sentence in English to describe what methodA accomplishes. v. Give a suggestion for an additional call to methodA that you would add to your test function to determine whether it works correctly. If you have no suggestion, write "nothing else is necessary." vi. Rewrite the body of methodA so that it does not use the if statement; rather it uses a return statement that return a Boolean Expression. Part B: Consider the following method: public static int methodB(int z) { return +50; Write the value that will be returned by each of the following expressions. i. methodB(methodB(methodB(10))) ii methodR0501*methodB/501

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

Step: 3

blur-text-image

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions