Lecture 12. AMES 5, Tues. Feb. 16, 1999
From the course outline we see the reading assignment this week skips Chapter 8 on Arrays for Lists and Tables and includes Chapter 9 on Storing Information in Text Files. You may wish to go over Chapter 8 anyway, since it includes some interesting material. You don't need to turn in modified versions of all the example programs in this chapter (such as MEX8-1 on array modification), and do Practice Programs 8.1. 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 Final Project, which should be underway by this time. If you have not started, or can't think of a topic that interests you, consider working on a FlashCard program that you can use to study True Basic by answering the Self Test questions in the text, or other questions you might devise. Be sure to 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 a class witnessing your demonstration).
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
Lecture 13. AMES 5, Thurs. Feb. 18, 1999
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 required in your homework.
Quiz 7b solution
Take-home Quiz 8 problems PP2.4, PP2.5, PP3.7, PP3.9, and PP3.12 are re-assigned, to be turned in for grading in section next week.