About turbo pascal....starter.

Posted on 2000-03-17
Last Modified: 2010-04-16
Please look at the following code


USES wincrt;

TYPE num= ARRAY[1..10] OF integer;
     money= ARRAY[1..10] OF real;

PROCEDURE loadata(VAR number:num; VAR moneys:money);
 VAR i:integer;
  FOR i:=1 TO 10 DO

PROCEDURE dosearch(number2:num; VAR n2,numm:integer; VAR search2:boolean);
 VAR i:integer;

  writeln('Please enter your ID numbers');
  FOR i:=1 TO 10 DO
   IF numm=number2[i] THEN

PROCEDURE output(number3:num; moneys2:money; search3:boolean; VAR wrong2,right2:integer);
  IF search3=true THEN
   writeln('Your ID numbers is ',number3[n]);
   writeln('You have $ ',moneys2[n]:1:2);
   writeln('This ID is invalid');

 UNTIL id=9999;
  writeln('Thanks for using me');
  writeln('You entered ',wrong,' invalid ID numbers and ',right,' valid ID numbers');
  writeln('Here is the information');
  writeln('ID#       BALANCE');    
   FOR i:=1 TO 10 DO
   writeln(numbers[i],'       ',money1[i]:1:2);
and here is the data
1357    33.50   Flo Chart
6666    150.33  Hedda Hare
3312    226.97  Holly Wud
1020    0.0     Sue Err
8282    78.77   Otto Mobile
2200    924.75  Howard Countee
1234    8000.00 Jim Sox
1313    1.00    Adam Upp
7971    0.0     Barney Ard
7894    445.12  Debihi
The program is work fine, but if enter a invalid number after a valid number then it will output the info for the last valid number
And it's always a one more value to what ever number you enter..doesn't matter it valid or invalid.

any question mail me at
Question by:debesta
LVL 17

Expert Comment

ID: 2630664
you should ask this in pascal programming section to get quicker response:

Accepted Solution

sunsetyang earned 50 total points
ID: 2633250
If not found,you forget to set the search value to false so it just use the last ...

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
array6 challenfge 6 81
wordcount challenge 11 103
Program to display an alert on Windows Toolbar 2 71
Base1 Encode/Decode 3 67
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now