CSCI 150, Spring 2003

Home | | Course Schedule | | Assignments | | Lecture Notes

CSCI 150 Homework 1

Due January 31, at the beginning of class.

Overview

This week you will write a program which administers a questionaire, then prints back a few sentences using the information it got from you. The program will be written in the Pascal language, and it will use variables to keep the information it collects.

A Sample session running a completed version of the homework program

 C:\WINDOWS\DESKTOP> home1

 Hi there!  What is your name?
 Frodo Baggins
 Where are you going?
 Mordor
 How far have you traveled (in miles)?
 10

 Let me see if I have this straight:
 Frodo Baggins has traveled 17600 yards on the way to Mordor.

 Thanks for running the program.
 
 C:\WINDOWS\DESKTOP>

Wordier explanation

You've probably gotten form letters written by computer, which fill in your name in the body of the letter in an attempt to make them seem personal. In this assignment we write a program which could be used for such a mailing, except instead of a whole long letter, we're just printing out a few lines.

The idea is that the person running the program (which might not be you) answers the three questions, and then the computer fits the answers into its sentence. Note that for this example to work, the user has to answer in a particular form. If the user had answered 'to Mordor' in response to the second question, the program would print out 'Frodo Baggins has traveled 17600 yards on the way to to Mordor.' More advanced programs can check for this kind of thing and correct for it, but you don't have to worry about it for this assignment.

What you will turn in