Re: need help
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Wed, 22 Feb 2006 22:29:30 -0600
entilzah wrote:
I am in a Pascal programming class, my problem is I am writing a
program that adds numbers together and then tracks positives
entered,negatives entered, and zeroes entered then gives a total of all
three and displays each. This part I have working with no problem,
even have the terminal value of 9999 working. What I do not get is how
to track consecutive repeat numbers entered and display the number
repeated the most times in a row. Please help.
To recognize that the number entered this time is the same as the number entered last time, you'll need a variable for holding what the previous number was. Each time you get a new number, you'll also need to update the "previous" number.
You might also need a variable or variables for remembering what the current run of numbers is -- which number is being repeated, and how many times has it been repeated?
Each time through your loop, compare the current run of numbers with the most recent record. If the current run exceeds the length of the previous run, then update the previous run.
Does that make things any clearer for you?
--
Rob
.
- References:
- need help
- From: entilzah
- need help
- Prev by Date: need help
- Next by Date: Re: BDS2006 exe sizes
- Previous by thread: need help
- Next by thread: need help
- Index(es):
Relevant Pages
|