Lecture 13. MAE 5, Tuesday, May 14, 2002

From the course outline we see the reading assignment this week includes Chapter 8 on Arrays for Lists and Tables and Chapter 9 on Storing Information in Text Files. Laboratory Quiz 3 will be given in sections. As discussed in class last week the quiz will be closed book, closed notes, and will probably involve your debugging of a program provided by Pak. Turn in modified versions of all the example programs in both chapters (such as MEX8-1 on array modification), Practice Programs such as 8.1 are interesting, but not required. These are the second two chapters in Part 2 Advanced Programming Techniques, and both chapters provide important new tools that you may be able to demonstrate in your Project 2, which should be underway by this time. This project should be something relevant to your major course of study or your professional plans (although projects just for fun are acceptable). Give it a title and include a full explanation of the purpose of your program in a comment section at its beginning. Make sure it runs properly and doesn't require the user to spend much time to see the point of the program (put yourself in the place of the TA or the class witnessing your demonstration). Points will be awarded or lost depending on good programming style.

Some of the methods presented in Chapter 8 include:

All of these concepts are illustrated by the Example Programs 8-X which you will modify in your homework. In your modifications, try to make the revised program automatic and user-friendly. For example, in MEX8-9 you might read the data from BAD.DAT and numbers.dat in a loop to check if they contain enough data to fill the 3x5 array of interest.

You might want to read ahead in Chapter 13 about programming with matrices. You have seen some matrix commands in the demo programs included with True BASIC, and know they are very compact and efficient. See the Matrix Read and Matrix Print example. This program should be compared to a similar program where the information about Tutors and their subjects are read into a matrix and printed out without matrix commands. Interested in a horoscope program? You can expand it by educating the astrologer.

Quiz 7a solution

Self Test Question Answers Chapter 8 and Chapter 9. Study these in preparation for Quiz 10, (next week), along with a previous Quiz.

Lecture 14. MAE 5, Thursday, May 16, 2002

Chapter 9 is about Storing Information in Text Files

You need to know how to name and open text files from True Basic programs, write data to the files and read them back, and examine the contents of files.

Some of the topics covered are:

You must modify EX9-1 before it will run to give it a new place (PathName$) to write your new file. See MEX9-1 as an example.

Mouse commands can be quite powerful and interesting, but are not discussed in the textbook. A free-hand graphics program in several colors gives you a chance to experiment with GET MOUSE x,y,s. Some practice pictures using the KEEP and SHOW commands are rather pretty.

 

Practice Program 9.1 is interesting, but not required in your homework.

Quiz 7b solution

Self Test Question Answers Chapter 8 and Chapter 9. Study these in preparation for Quiz 11, (next week), along with a previous Quiz.

Experiment with method 1 and method 2 for including pictures in your programs using True BASIC Bronze.

Help