LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-01-2003, 04:49 PM   #1
looney1430
LQ Newbie
 
Registered: Jan 2003
Location: wisconsin
Posts: 1

Rep: Reputation: 0
Angry what am i missing


i am writing this program and there are errors when I put it through the compiler. I don't understand what the problems are and where they are. The type of programming is Pascal.

The output of my program is suppose to be The end of the day stock for each of the six items. There is stock numbers 1-6. Each of the morning stock has a value. There is a certain amount sold during the day for each stock and so the output is suppose to be the end of the day totals.
Here is what I have:
program invent;
var
s:array[1..6] of integer;
stocknumber,
bsales,(*beginning sales*)
sold,
esales:integer;
begin
repeat
writeln('please enter the stocknumber');
readln(stocknumber);
writeln('please enter the beginning sales for that stocknumber');
readln(bsales);
writeln('please enter the amount sold');
readln(sold);
esales:=(bsales-sold);
end.
I know there has to be a repeat in there so I can do multiple stock numbers but I don't know where to insert it.
Is there anything else wrong with this?
 
Old 01-04-2003, 12:06 PM   #2
holst
LQ Newbie
 
Registered: Nov 2002
Location: Stockholm
Posts: 28

Rep: Reputation: 15
I dont really get what you want to do but I do know that you need a "until" statement for each "repeat" statement. Like:

repeat
(* do stuff *)
until <some bool statement is true>;
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Am I missing something? mapesju Linux - Software 0 08-28-2004 03:44 AM
Am I missing something? brent1a Linux - Networking 12 08-14-2004 04:10 AM
Just don't know what I'm missing here... hpnadig Linux - Software 2 03-15-2004 07:36 AM
Missing gd.h gmartin Slackware 3 02-11-2004 01:16 AM
what am I missing? shanenin Linux - Software 1 11-02-2003 11:18 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration