CPS 130 Homework #2, Due January 29, 1996

Structure Charts and Looping

Do this homework with your partner.

Name Section

Name Section

Staple this page to your homework as the cover page.

If the grader has any difficulty reading your homework, you will lose points.

If you have any doubts about the readability of your handwriting, please use a word processor.

1.Electronic Mail (1 point)

Send electronic mail to your TA with answers to the following questions.

a)What is the meaning of the "Subject of Message:" line you see when sending an E-mail message?

b)What is the E-mail address for the LeadGA’s?

c)What is the E-mail address for Dr. Don?

2.Netscape (2 points)

Do not answer the rest of the questions via E-mail.

a)A URL (Uniform Resource Location) is the address of a WEB site; it specifies what U R Looking at. What is the URL (i.e. the address) of the CPS130 home page.

b)Can you get directly to any computer (or site) on the WEB without following a long path of links? If so, how, if not, why?

c)Surf the WEB and find your favorite site. Give the URL for that site.

3.Structure Charts (2 points)

Draw a structure chart for the following program.

'Main Module

CALL Eat

CALL Sleep

CALL Eat

END

SUB Eat

CALL EatPizza

CALL DrinkPop

CALL Sleep

END SUB

7.Which Loop??? (2 points)

In parts (a) and (b) you must determine which type of loop should be used. You must indicate whether the loop should be a WHILE or an UNTIL loop and whether it should be a top-tested or bottom-tested loop. In each case, explain your answer.

a)Computers are taking over the world! Actually, they are taking over MSU by replacing your TA. You need to write a program which simulates a TA teaching a topic to your class. You have at your use the SUB ExplainTopic which explains a topic to the entire class and a function FUNClassUnderstands that returns TRUE when the entire class understands the topic and FALSE otherwise. Which type of loop will you use so that the whole class understands the topic?

b)The holiday shopping season may be getting over, but you just won some money for shopping. You have a SUB ShopMore which spends money for you, and a function FUNMoneyLeft which returns TRUE as long as you have money left, and FALSE otherwise. Which type of loop will you use to shop until you spend all the money?

CPS 130, Spring 1996, Homework #2, Page 1