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.
7 1890
16 views and not 1 reply?
gits 5,390
Expert Mod 4TB
i think you should fix the last lines: - WRITELN('The Change is: ');
-
WRITELN('Dollars,'Dollars');
-
WRITELN('Quarters,'Quarters');
-
WRITELN('Dimes,'Dimes');
-
WRITELN('Nickels,'Nickels');
-
WRITELN('Cents,'Cents');
to something syntactically correct ones to compile :) ... and to something you want to have as output like: - WRITELN('The Change is: ');
-
WRITELN('Dollars:', Dollars);
-
WRITELN('Quarters:', Quarters);
-
WRITELN('Dimes:', Dimes);
-
WRITELN('Nickels:', Nickels);
-
WRITELN('Cents:', Cents);
-
kind regards
ah yes of course, wow i was looking at it for a long time sometimes i need a break i think :)
gits 5,390
Expert Mod 4TB
that is a typical thing ... that's why we often use pair-programming here :)
kind regards
@gits
Wow pair programing? Interesting...
Regards
Dheeraj Joshi
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
Never worked in pair programming technique....
Lets see some where down the line i may get an opportunity...
Regards
Dheeraj Joshi
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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......
|
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...
|
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...
|
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...
|
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...
|
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)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
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...
|
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...
| |