1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'General Programming Chat' started by h1tman, Oct 24, 2009.

  1. h1tman

    h1tman Junior Member

    Joined:
    Oct 2, 2009
    Messages:
    148
    Likes Received:
    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 :)
     
  2. razohad

    razohad Power Member

    Joined:
    Jan 11, 2008
    Messages:
    701
    Likes Received:
    1,005
    Occupation:
    Software engginer
    Location:
    online most of the time
    it wont run because its written in pascal , move on to easier better programming languages.
     
  3. LilWayne

    LilWayne BANNED BANNED

    Joined:
    Aug 20, 2009
    Messages:
    34
    Likes Received:
    12

    Most ignorant thing I've read.


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