Lecture 5. AMES 5, Tues. 25 Jan. 2000

From the course outline we see the reading assignment this week is Chapter 4 on Program Control Statements. You need to turn in modified versions of all the example programs in this chapter, and do Practice Programs 4.1,2,3,4.

You have already seen some examples of branching and looping operations in programming, which occur when decisions are made based on logical expressions, and when repeated actions are required. A computer program consists of sequential, loop, and branch structures in various combinations. Chapter 4 focuses on loops and branches. Some of the concepts introduced are:

All of these concepts are illustrated by the Example Programs MEX4 that you modify as part of your homework.

Projects: You should have begun thinking about your projects. As mentioned in the last class, you can pick any subject that interests you for Project 1. Write pseudo code statements at the beginning of the program to outline for yourself how you plan to proceed and to document for readers (and TAs) what its purpose is and how it is organized. Do this before you start putting in code, and revise as necessary if the code doesn't perform as you first expected. TAs are requested to give different grades for the projects turned into each Section so that they can be ranked. Top rankings will go to programs that are clearly written and demonstrate a high level of True BASIC programming skills. Project 1 is due Friday the 5th week. Use at least 15 different commands and a variety of programming structures. Project 2 (due week 10) should be related to your major field of study, showing how programming is useful to your planned career. The IQ-test program shown in class is here, with responses to as set of trivia questions.

Quiz 3a Solution (Last year)

Self Test Question Answers Chapter 4. Study these in preparation for Quiz 4, Winter 2000 (today)

Feedback Corner: Students returned 80 anonymous MAE/CAPE forms by Section numbers A01-A08. Results of the Course And Professor Evaluation are given here. The Scantron machine was keyed "no" (B,False) for all 20 questions returning "% wrong answers" on the Item Analysis to give percent non-negative as %"yes" (%nn). Hours/week reported were 90% 8+, for example. Student comments given on back of Scantron forms.

Lecture 6. AMES 5, Thurs. , Jan. 27, 2000

Work through and modify all the Example Programs of Chapter 4. Your modifications should illustrate an understanding of how the programs work and what they are attempting to illustrate. Bring your questions about particular Example Programs to class if you want to see how I did it in my version of the homework. For example, here is my version of MEX5-15, from next week's homework. From this week's homework, see MEX04-14 about the SELECT CASE structure. Work as many unassigned Practice Programs as you can find time for, for example Practice Program PP4.3. You can select the text of the program from this webpage version and paste it into True Basic, although you will need to edit out the extra lines before it will run.

If you are working ahead, you might be interested in Practice Program PP5.3, where dates are entered into the program of PP5.2 by means of a DATA statement.

Logical variables such as more data and end data have values true or false depending on whether more data exists for reading or not. These variables are useful as control variables in do-loops reading from data statements, as shown in the example. Logical operations in True BASIC are determined by logical conditions, which are set to "true" or "false" by logical expressions. Logical expressions use relational operators (=, <> or ><, <=, >=, >,<) as well as logical operators AND, OR, and NOT to evaluate conditions (t or f). Strings are compared based on the ASCII character set.

Use of select case, more data, end data, and graphical commands is illustrated in another example.

Quiz 3b, Winter 1999 (solution). Study this in preparation for Quiz 5, Winter 2000 (today)

Help