Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

compile code to java Translate into Java the following pseudo-code, expressed in plain English. Goal: Write a method that returns true if an int value,

compile code to java 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 Go ...Save, Compile, Run (ctrl-enter)

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions