Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the following method, which compares two parameters and returns-1,0, or 1 if the first parameter is less than, equal to, or greater than the

image text in transcribed

Complete the following method, which compares two parameters and returns-1,0, or 1 if the first parameter is less than, equal to, or greater than the second parameter. Note answers are case sensitive public int compare (int a, int b) result: /7 declare variable of appropriate type. The variable will get its value then be returned -1: 1/ assignment -1 to which variable? else (a b) t/ when the two parameters have same value, assign to variable to be returned elset11 a must be great than b in this case resuit -: result //one of the branching keywords

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

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions