Message 2/111 Carl Gibson Jan 29, 99 04:25:34 am -0800

 

Return-Path: <ir118>

Subject: Re: Practice programs...

To: abarnett@ucsd.edu (Anissa Barnett)

Date: Fri, 29 Jan 1999 04:25:34 -0800 (PST)

Cc: ir118@sdcc3.ucsd.edu (Carl Gibson)

Reply-To: ir118@sdcc3.ucsd.edu

 

Dear Anissa:

Thanks for the email. Reading a textbook about computer

programming is certainly different than reading one about cooking or

gardening...which are more forgiving activities. You have to read, then do,

then read again, etc. etc., before it will become intuitive. See

it, say it, hear it, speak it, read it, write it, then repeat

it...this is the way to learn a language.

Regarding PP4.1 and PP4.2, they are supposed to get you to

practice using for loops with a negative step, and do loops, which

you have done in the modified programs. Try this for PP4.1:

LET int = 0 ! initialize int, the control variable

FOR int = 10 to 1 step -1

PRINT int;

NEXT int

END

A little fancier version for PP4.2 is:

LET int = 0 ! initialize control variable int

DO

LET int = int + 2

PRINT int;

LOOP until int => 20

PRINT

PRINT "The value of the control variable int is ";int

 

LET int = 2 ! initialize control variable int

DO until int = 22

PRINT int;

LET int = int + 2

LOOP

PRINT "Now the value of the control variable int is ";int

 

PAUSE 2

SET COLOR "green"

PRINT "20 was better"

PAUSE 1

SET COLOR "red"

PRINT "Sound the alarm!"

SOUND 500,.2

SOUND 500,.5

SOUND 500,.2

PAUSE 1

SOUND 500,.5

SOUND 500,.5

SOUND 500,.5

PAUSE 1

SOUND 500,.2

SOUND 500,.5

SOUND 500,.2

 

END

 

Try this one out. It gives an SOS signal in morse code at

the end for fun.

Please don't get discouraged. You can do it!

Regards,

CHG

> I have finished all the modified examples for ch. 4, but I'm not really sure

> how that prepared us for practice program 1 and 2. There wasn't anything in

> the book that dis that... the rest of the examples were sums, not individual

> displays, so how are we supposed to do that? My section is tomorrow (thurs.)

> and I would really like to do all my homework, since it is such a large

> percentage of our grade. And unfortunately, I do have to agree with Samantha

> about the value of our book and our final project. I have read ahead, but

> there is no way I could come up with a program of the caliber that is

> required. I know how to incorporate shapes, and switch colors, but that's

> about it. And I too believe that we should drop the 2 lowest quiz grades,

> because some of us don't yet have the ability to think in a computer

> language like BASIC, and it's really hard to absorb the stuff in the book.

> And also, where can I find out what my grades are so far? I don't know if

> you mentioned it while I was gone, but they're not up on the web site, and I

> would like to see how I'm doing so far to decide if I would rather take the

> class P/NP. This class has made me seriously think about changing my major,

> because I just don't know if I can handle it. Please calm my fears. Thank you.

>

> Anissa Barnett