Can someone please tell me why my pascal code wont execute?

h1tman

Junior Member
Joined
Oct 2, 2009
Messages
148
Reaction score
16
Yeah it wont execute can someone tell me why?

{--DRILL 2.1--}
{Grocery Store}
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.


thanks in advanced :)
 
it wont run because its written in pascal , move on to easier better programming languages.
 
it wont run because its written in pascal , move on to easier better programming languages.


Most ignorant thing I've read.


WRITELN('The Change is: ');
WRITELN('Dollars,'Dollars');
WRITELN('Quarters,'Quarters');
WRITELN('Dimes,'Dimes');
WRITELN('Nickels,'Nickels');
WRITELN('Cents,'Cents');

Try changing these for example dollars shouldnt be 'Dollars,'Dollars' should be 'Dollars,Dollars' and so on.
 
Back
Top