Using get() to read multiple keyboard input
- Posted by Caracatsanis Pty Ltd <sunpsych at VIC.OZLAND.NET.AU> Aug 23, 2000
- 561 views
I'm curious to know whether it's possible to use get() in this situation: 1 ask user to type some numbers, each separated by a space 2 enter the whole set of numbers 3 read the numbers -- can you use get() here? 4 compute their average 5 display the average to screen The point of my query is that get() has to be issued separately for each number - which is OK if you know beforehand how many numbers the user will enter. If the choice is left up to the user (so it may vary at each program run), is it possible to write code that can "sense" how many numbers have been entered? This value could then be used to call get() the required number of times. Thank you Alex Caracatsanis