Lecture 10. MAE 5, Tuesday (cancelled by fires).

From the course outline we see the reading assignment this week is Chapter 6 on Finding and Correcting Errors. Laboratory Quiz 2 will be given in Sections, and will involve solving programming problems similar to those you have been doing as Practice Programs for homework. The lab quiz is open book and open notes, but you can't discuss what you are doing with your fellow students...only your TA. Project 1 is assigned this week, so it is due by Friday afternoon of next week. The minimum number of commands for the first project is 15. You are free to use more than 15 commands if they will improve your project. Give it a title. See guidelines.

You need to turn in modified versions of all the example programs in this chapter, and do Practice Programs 6.1 and 6.2. The "do trace" debugging routine for True Basic is discussed, along with other techniques for finding errors, but you are not responsible for knowing how it works since we are using TB Bronze. For PP6.1, test using temporary print statements. The TRACE command doesn't work for TB Bronze, only 2.72.

Some of the methods presented include:

Quiz 5a Solution

Self Test Question Answers Chapter 6. Study these in preparation for Quiz8 (next week....see version given previously)

 

Advanced techniques: Have a look at the use of arrays and modules in these programs. Copy and try deal, which deals a bridge hand, using module cards. You can cut and paste to produce card game projects (sort the hand, count honor points, etc.).

The program for dice throwing shown in class last week (adapted from one in TBRef by Prof. Herz) demonstrates the functions RND and INT, and the commands RANDOMIZE, SOUND and PAUSE.

Lecture 11. MAE 5, Thurs.

All due dates this week are extended a week to give time to adjust for the cancelled sections and lecture.

In solving Practice Program 6.2 it is necessary to break the program down into smaller pieces to trap the various possible date entry problems. Dates entered with more than thirty days in September, April, June and November should be detected, and the user asked to enter a correct date. Dates entered with more than 29 days in February should also not be accepted. Months larger than 12 (eg.: 13.25.98) are obviously in error, and should be trapped. More than 31 days in Jan., Mar., July, Aug. and Oct. is incorrect. Since it was requested that the date should not have leading zeros in the month and day (eg.: 01-06-98), this should also be detected in your program.

A variety of programs were presented illustrating graphical methods that might be useful in your projects.

Quiz 5b Solution

Self Test Question Answers Chapter 6. Study these in preparation for Quiz 9 (next week....see version given previously)

Help