Write a program that reads in a list of positive integers from the user
until the user enters the value –1 as a sentinel. At that time the program should display the largest value in the input list.
So I think I have the first part figured out, ending when you input -1. The problem that I am having is figuring out how to make the visual logic program give me the largest value at the end of the loop. Anyway this is what it looks like:
Begin:
Input: Number (and in the input statement I have it saying "Pick a Number")
While Statement: TRUE>true (I have nothing routing into the false)
From the true statement it goes into a IF statement
IF Statement: Number = -1> if true it goes to OUTPUT: "The largest Number was "
and if it is false to create a loop I put another input statement
INPUT: Number (and in the input statement it again says "Pick a Number")
I know that it can't be too complicated, I am probably just overthinking it, thanks!
until the user enters the value –1 as a sentinel. At that time the program should display the largest value in the input list.
So I think I have the first part figured out, ending when you input -1. The problem that I am having is figuring out how to make the visual logic program give me the largest value at the end of the loop. Anyway this is what it looks like:
Begin:
Input: Number (and in the input statement I have it saying "Pick a Number")
While Statement: TRUE>true (I have nothing routing into the false)
From the true statement it goes into a IF statement
IF Statement: Number = -1> if true it goes to OUTPUT: "The largest Number was "
and if it is false to create a loop I put another input statement
INPUT: Number (and in the input statement it again says "Pick a Number")
I know that it can't be too complicated, I am probably just overthinking it, thanks!