Back to DFS's Pascal Page


Pascal Madlib Problem I

Without Using Procedures

Herman's maître d' says, "Me and the boys were trying to guess how you spell your name." Obviously, he has some grammar and sequencing problems. To help him out, you have two jobs to do.

Be creative!!! Your fellow students will have an opportunity to do your madlib during the next class.

Program Madlib1(input, output);
 var
  uname, noun, place, number, liquid: string;

 begin
  { GREET THE USER }
  write('Hello, what is your name? ');
  readln(uname);
  writeln;
  writeln('I hope you enjoy madlibs, ', uname:0, '.');

  { USER MAKES CHOICES }
  writeln('Please choose your words.');
  writeln('Try to pick funny words, ', uname:0, '.');
  writeln;
  write('Type a noun which is a thing. ');
  readln(noun);
  write('Type your least favorite city or country. ');
  readln(place);
  write('Type a number. ');
  readln(number);
  write('Type a liquid. ');
  readln(liquid);

  { PRINT THE LAW }
  writeln;
  writeln('It will be unlawful to own a ', noun:0);
  writeln('or to carry a concealed ', noun:0);
  writeln('without a ', noun:0, ' license.');
  writeln('The penalty for ', noun:0, '-carrying');
  writeln('will be thirty days in ', place:0);
  writeln('or a fine of ', number:0, ' dollars.');
  writeln('The penalty is double if the person');
  writeln('is arrested while under the influence');
  writeln('of ', liquid:0, '.');

  { THANK THE USER }
  writeln;
  write('I hope you liked your new law, ');
  writeln(uname:0, '.');
  writeln;
  writeln('Thank you for using my madlib.');
  readln
 end.

© 2000 DFStermole
Created 27 May 00