943,717 Members | Top Members by Rank

Ad:
Feb 20th, 2006
0

Procedure Repeat Loop

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rcwally is offline Offline
4 posts
since Jan 2006
Feb 21st, 2006
0

Re: Procedure Repeat Loop

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
Reputation Points: 11
Solved Threads: 0
Light Poster
mrmike is offline Offline
41 posts
since May 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Serious help needed ASAP error message!!!!
Next Thread in Pascal and Delphi Forum Timeline: How to pre-set second VGA as MDA?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC