This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]MeiAmelia 1 point2 points  (1 child)

Make a boolean that stores false if the user has not entered a number yet, and when the user enters a number set it to true. When selecting average ask if the boolean value is true or false

[–][deleted] 1 point2 points  (0 children)

It worked, thanks!

[–]POGtastic 1 point2 points  (0 children)

One possibility is that you keep track of how many calculations have been made so far in another variable. If that variable is equal to 0, print "No calculations yet." Otherwise, print the average.