cs1ch6sec4.htm
 
CHAPTER 6

Giving Olympia A Better Interface
or
User Interface Design - Some Preliminary Techniques and Implications


Section IV : Putting It All Together Section I: User Interface Analysis - Giving Olympia Choices Section II: Functional Decomposition of 'main' Section III: C++ Code


  


Table of Contents

Learning C++:
An Index of Entry Points


2. The

of C++

A reference document on the basic elements of C++.



3. The Patterns





A. Completing the Program
The design and coding of the rest of this problem is relatively straightforward. If you are unsure of what remains to be done, make a copy of the structure chart and put a mark next to each module we have discussed. The unmarked modules represent the functions you still need to design and code. In your own programs you are encouraged to use a similar process. As you design a module, put a 'D' next to the corresponding box in the structure chart. Later, as you write the code for a module, you can put a 'C' next to the corresponding box.

Once you have finished designing and coding this program yourself, you are encouraged to read carefully the code provided here. If you discover differences, do not automatically assume that your design or code needs to be changed. There is more than one way to write a program. Analyze the differences you find and ask the following questions:

    Do your design and code accomplish the same goal, only in a different way?
    Is one way more efficient or are they equally good?

    Do your design and code represent a different way of interfacing with the user?
    Which way is better or are they equally good?

    Do your design and code handle the same situations or possible problems? Do they handle more situations or less? For example, which design does a better job of handling incorrect user entries?


B. Final Thoughts
Note that we have not made any changes to the contract class. This chapter focused strictly on the c ode that used this class. We could write many 'main' programs that used this same Contract class. In fact, one goal of the object-oriented approach is to promote code re-use.

Whatever 'main' you write, in the end, of course, you still need to put it all together, just as we did in chapter five. You should follow the same instructions to get this program to work that you used to get the program from chapter five running. (Borland C++ users, review the document "BorlandProject.htm".) Remember that the only way to really make sure a program works is to run it and carefully examine its outputs given different inputs. If you want to run the code found in this chapter, here are the necessary files:

Top of Section Main Menu Next Chapter