ITEC 1620 Lecture Notes - Init, Triangular Number, Flowchart
10 views6 pages
I have a number. Should you guess my number, I will say “You guessed my number.”
Otherwise, I will say “Lower” when your guess was too high, and I will say “Higher”
when your guess was too low.
my number your guess
5 3 Higher
5 You guessed my number.
On the following page, there is a flowchart for a program that will take as input the value
of my number and the value of your guesses, and that will output my response to each
Input: 5 No output.
Input: 3 Output: Higher
Input: 6 Output: Lower
Input: 4 Output: Higher
Input: 5 Output: You guessed my number.
On the page after the flowchart, please convert the program from the flowchart into
Input my number
“You guessed my number.”
public class Sample1
public static void main( String args  )