Procedure Repeat Loop

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jan 2006
Posts: 4
Reputation: rcwally is an unknown quantity at this point 
Solved Threads: 0
rcwally rcwally is offline Offline
Newbie Poster

Procedure Repeat Loop

 
0
  #1
Feb 20th, 2006
Please help me with the End on this problem. I just can't seem to finish it off properly. I keep getting a parse error on the last End.

program ValueParameters (input,output);
{Author: Cheryl Wahlheim
Class: CS241XP
Assignment: User Income and Tax Rate procedure}

Var income, taxrate, totaltaxdue : real; response : char;

Procedure Taxes;
Begin
writeln('Welcome to Your Friendly Tax Service');
writeln('Your declared income is $',income:8:2);
writeln('Your tax rate is ',taxrate:2:2,'%');
writeln('Your Total Tax Due is $',totaltaxdue:7:2)
End;

Begin
writeln('Enter your income and tax rate.');
writeln('Note: tax rate should be entered as a percentage.');
readln;
totaltaxdue := income*(taxrate/100);
Begin
Repeat
writeln('Do you want to enter your income and tax rate again? (Y/N)');
readln(response);
if (response = 'Y') or (response = 'y') then
Taxes
else
if (response = 'N') or (response = 'n')then
writeln('We are done.');
readln
End;
End.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 41
Reputation: mrmike is an unknown quantity at this point 
Solved Threads: 0
mrmike mrmike is offline Offline
Light Poster

Re: Procedure Repeat Loop

 
0
  #2
Feb 21st, 2006
this is because you have a 'repeat' without an 'until' and a 2nd 'begin' with out an 'end'

ie

Repeat
do this statement
do this statement
Until endresult=certainvalue or condition

before the last end add another end

regards
mrmike
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Pascal and Delphi Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC