473,324 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

My pascal code wont compile

4
can someone help? Its the following code it just wont compile

thanks :)

PROGRAM Store (INPUT, OUTPUT);
VAR
Change, AmountPaid, TotalPrice :REAL;
IntChange, Dollars, Quarters, Dimes, Nickels, Cents :INTEGER;
BEGIN
WRITE('Enter the total-price in dollars:');
READLN(Totalprice);
WRITE('Enter the amount-paid in dollars:');
READLN(AmountPaid);
{ Dollars }
Change := AmountPaid - Totalprice;
Dollars := TRUNC(Change);
Change := (Change - Dollars)*100;
IntChange := ROUND(Change);
{ Quarters }
Quarters := IntChange DIV 25;
IntChange := IntChange MOD 25;
{ Dimes }
Dimes := IntChange DIV 10;
IntChange := IntChange MOD 10;
{ Nickels }
Nickels := IntChange DIV 5;
IntChange := IntChange mod 5;
{ Cents }
Cents := IntChange;
WRITELN('The Change is: ');
WRITELN('Dollars,'Dollars');
WRITELN('Quarters,'Quarters');
WRITELN('Dimes,'Dimes');
WRITELN('Nickels,'Nickels');
WRITELN('Cents,'Cents');
READLN;
END.
Oct 25 '09 #1
7 1890
H1TM4N
4
16 views and not 1 reply?
Oct 27 '09 #2
gits
5,390 Expert Mod 4TB
i think you should fix the last lines:

Expand|Select|Wrap|Line Numbers
  1. WRITELN('The Change is: ');
  2. WRITELN('Dollars,'Dollars');
  3. WRITELN('Quarters,'Quarters');
  4. WRITELN('Dimes,'Dimes');
  5. WRITELN('Nickels,'Nickels');
  6. WRITELN('Cents,'Cents');
to something syntactically correct ones to compile :) ... and to something you want to have as output like:

Expand|Select|Wrap|Line Numbers
  1. WRITELN('The Change is: ');
  2. WRITELN('Dollars:', Dollars);
  3. WRITELN('Quarters:', Quarters);
  4. WRITELN('Dimes:', Dimes);
  5. WRITELN('Nickels:', Nickels);
  6. WRITELN('Cents:', Cents);
  7.  
kind regards
Oct 27 '09 #3
H1TM4N
4
ah yes of course, wow i was looking at it for a long time sometimes i need a break i think :)
Oct 27 '09 #4
gits
5,390 Expert Mod 4TB
that is a typical thing ... that's why we often use pair-programming here :)

kind regards
Oct 27 '09 #5
Dheeraj Joshi
1,123 Expert 1GB
@gits
Wow pair programing? Interesting...

Regards
Dheeraj Joshi
Nov 6 '09 #6
gits
5,390 Expert Mod 4TB
?? ... it's nothing very special ... pair programming is just one of the techiniques that might be used during software development ... by following the link you might see some advantages and disadvantages of that technique

kind regards
Nov 10 '09 #7
Dheeraj Joshi
1,123 Expert 1GB
Never worked in pair programming technique....

Lets see some where down the line i may get an opportunity...

Regards
Dheeraj Joshi
Nov 10 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
4
by: Chris Gordon-Smith | last post by:
I am tying to call a Pascal function from C++, and vice versa. Does anyone know how to do this, or where detailed information on this topic can be found? For the C++ to Pascal call I have...
9
by: Rich Herrick | last post by:
The latest version of my "Pascal-like" set class is available here: http://www.richherrick.com/software/herrick-1.0.zip Those from the old YAHOO BOOST forum might remember it from several...
28
by: Skybuck Flying | last post by:
Hi, I think I understand now a bit better what the difference is between a c compiler and a pascal compiler. For example: When compiling source code with a pascal compiler. The pascal...
14
by: Peter Williams | last post by:
Hi All, I am attempting to reverse-obsfuscate an IOCCC entry, and my ultimate goal is to convert the code into Delphi (OO Pascal). I don't understand what the question-mark (?) operator, and...
5
by: Kristelle | last post by:
I need to combine (and modify) several applications into one. Some are written in C++, other in Pascal How can I translate the available code to use in VS.Net? Even the C++ code won't compile (i...
7
by: dktekno | last post by:
I have tried C++ Builder and Delphi and Visual Studio. What are the reasons people do not like Delphi and would rather develop in C++? C++ compilers are so.. pedantic and so slowy. In Pascal...
7
by: SMALLp | last post by:
Hy! I desperately need help! I need to make application that would accept Pascal code and check if it returns good results. My idea is (from a beginner point of view) to make application in...
0
by: sourpo | last post by:
wonder if anyone can help... I have access db with a whole lot of vb code... If i use access 2000 it works perfectly but when using 2003 it doesn't work properly. The db copies outlook mailboxes......
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.