943,945 Members | Top Members by Rank

Ad:
Oct 12th, 2009
0

Could you tell me how can I do this kind of question.

Expand Post »
Dear ALL,

Could you tell me how can I do this kind of question if I do not working with the computer and please find the attached document for your reference - it is the answer of the question?

Pascal and Delphi Syntax (Toggle Plain Text)
  1.  
  2. Complete the table below to show what each variable holds, the user enters the numbers 5, 6, 7, 8, 9
  3.  
  4. evens:=0;
  5. for count:= 1 to 5 do
  6. begin
  7. writeln('Please enter a number');
  8. readln(numbers[count]);
  9. if (numbers[count] mod 2 = 0) then
  10. begin
  11. evens := evens + 1;
  12. end
  13. end;
  14. writeln(evens);
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
turbomen is offline Offline
113 posts
since Feb 2009
Oct 12th, 2009
0
Re: Could you tell me how can I do this kind of question.
It is the attached document.
Attached Thumbnails
Click image for larger version

Name:	q2.jpg
Views:	12
Size:	50.2 KB
ID:	12087  
Reputation Points: 10
Solved Threads: 0
Junior Poster
turbomen is offline Offline
113 posts
since Feb 2009
Oct 12th, 2009
0
Re: Could you tell me how can I do this kind of question.
The way I read this, is that you need to calculate the value of the variable (evens). Just follow the source code in your head, or on paper, and do as it instructs.

I don't see output in the code, so I'm not sure what they mean by that.
Last edited by pritaeas; Oct 12th, 2009 at 7:19 am.
Sponsor
Featured Poster
Reputation Points: 550
Solved Threads: 731
Bite my shiny metal ass!
pritaeas is offline Offline
4,177 posts
since Jul 2006
Oct 12th, 2009
0
Re: Could you tell me how can I do this kind of question.
Thank you for your prompt reply. Yes, I want to calculate the value of the variable (evens). Just follow the source code in my head, or on paper. But how can I do in this way?

Maybe, it is not useful for me to work on the computer for this kind of question.
Reputation Points: 10
Solved Threads: 0
Junior Poster
turbomen is offline Offline
113 posts
since Feb 2009
Oct 12th, 2009
1
Re: Could you tell me how can I do this kind of question.
Try it on paper. Write the values down. Then change them as you walk through each loop (in your head).
Sponsor
Featured Poster
Reputation Points: 550
Solved Threads: 731
Bite my shiny metal ass!
pritaeas is offline Offline
4,177 posts
since Jul 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: DBISAM Question
Next Thread in Pascal and Delphi Forum Timeline: Formatting ComboBoxes





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC