Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Translate into Java the following pseudo-code, expressed in plain English. Goal: Write a method that returns true if an int value, given as parameter, is

image text in transcribed
Translate into Java the following pseudo-code, expressed in plain English. Goal: Write a method that returns true if an int value, given as parameter, is close enough to either one of two pre-defined target values. The target values are 100 and 200. The method will return true if the parameter is within 10 (included) of either value. Variables declarations & initialization: Boolean variable named "result", initialized to false. Steps for the code: If the value in "n" is greater or equal to 90 Then: if the value in "n" is lesser or equal to 110 Then: set "result" to true. Else: if n is lesser or equal to 210 Then: if n is greater or equal to 190 Then: set "result" to true. Else: set "result" to false. Else: set "result" to false. Else: set result to false. Return the value contained in the variable "result". targetPractice(90) - true targetPractice(89) - false targetPractice(110) true

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

Explain the service recovery paradox.

Answered: 1 week ago