Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1.Method name: findSmallestPositiveNumber Parameter(s): A String containing integer numbers separated by spaces. There must be at least one positive number in the String. Return value:

1.Method name: findSmallestPositiveNumber

Parameter(s): A String containing integer numbers separated by spaces. There must be at least one positive number in the String. Return value: An int value that is the smallest number greater than 0 in the input string. Example: findSmallestPositiveNumber("2 -4 5") should return 2. Note: Even though I put this first, I would consider working on this later. The other methods are basically just applying the patterns we looked at in class. This one is similar but requires a little more working out the logic of the problem.

2.Method name: lowestAlphabetically Parameter(s): A String of lower-case words separated by spaces and made up of the letters a-z. The String will have at least one word. Return value: A String containing the lowest alphabetical word. The String method compareTo() does a lexicographic comparison between two strings, which allows you to test for the lowest alphabetical word. Read documentation on compareTo() in order to understand how to use it. Example: lowestAlphabetically("cat dog apple fish") would return "apple".

3.Method name: findSmallestNumberInTwoStrings Parameter(s): Two String parameters. Each string is made up of numbers separated by spaces. The first string must have at least one number. Return value: An int containing the smallest number found in the two strings. Example: findSmallestNumberInTwoStrings("12 3 5", "2 -1 10") would return -1.

4.Method name: curveScores Parameter(s): A String containing numbers from 0 to 100. Each number is separated by a space. There must be at least one number in the String. Return value: A String of numbers scaled so that the highest number in the parameter String becomes 100 and all the other numbers are moved up by the same amount. This String should also be numbers separated by spaces with no additional characters. Example: curveScores("45 85 90") would return "55 95 100".

5.Method name: containsThisColor Parameter(s): A Picture object that is at least 1x1 pixels and a Color object. Return value: A boolean value. Return true if the Color parameter matches one of the pixels in the image and false otherwise. A color match is done by using the .equals method rather than ==. Example: For a 1 pixel picture with a color of (100, 200, 50) and a color to search for of (100, 100, 100), this method would return false.

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

Students also viewed these Databases questions