RSS Forums RSS
Please support our Pascal and Delphi advertiser: Programming Forums
Views: 7579 | Replies: 11
Reply
Join Date: Mar 2007
Posts: 14
Reputation: cigar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
cigar cigar is offline Offline
Newbie Poster

Re: Pascal Examples

  #11  
Mar 29th, 2007
[quote=needs_help;301144]{a random problem generator, test your math skills}
[code]
program learn;
uses crt;
var a,b,c,e,f,right: integer; d:real;
label 1,2,3,4,5;
begin
textbackground(green);
textcolor(white);
clrscr;
repeat
inc(f);
until f=100000;
randomize;
1:
e:=random(3)+1;
b:=random(200)+1;
c:=random(200)+1;
if e=1 then d:=b+c;
if e=2 then d:=b-c;
if e=3 then d:=b*c;
writeln(' ',b:3);
if e=1 then write('+ ');
if e=2 then write('- ');
if e=3 then write('x ');
writeln(c:3);
writeln('______');
readln(a);
if a=d then
begin
inc(right);
writeln('HORRAY! YOU GOT IT RIGHT! you have ',right,' points!');
end
else
begin
right:=right-1;
writeln('WRONG! you have ',right,' points');
end;
goto 1;
end.

This program you've made work but there are nothing displayed but green
Reply With Quote  
Join Date: Dec 2006
Location: Romania
Posts: 171
Reputation: radu84 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 16
radu84 radu84 is offline Offline
Junior Poster

Re: Pascal Examples

  #12  
Mar 30th, 2007
ok, and what you suggest? try to correct it, and post the good version

best regards,
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 9:27 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC