[MSOE Homepage]

Dr. Taylor's MSOE homepage

Courses

Unix is a Four
Letter Word

My Photo Album

My Personal Homepage

CS-100 Main page

CS-100 -- Lab 4: Generic Calculator

Fall Quarter 1999



Electrical Engineering and Computer Science Department
Dr. Christopher C. Taylor

S-331, 277-7339

www.msoe.edu/~taylor/

Purpose

The lab is designed to further your programming skills and become more familiar with control constructs.

Assignment

In this lab you are to design a simple calculator program. Your program should:

  • Accept input in the form of:
          32 + 17
          72.3 / 4
          18.1 - 342.842
          18.1 * 342.842
          
  • Output the equation to be evaluated and the calculated result. The input above should produce output of the form:
          32 + 17 = 49
          72.3 / 4 = 18.0750
          18.1 - 342.842 = -324.742
          18.1 * 342.842 = 6205.4402
          
  • After each equation evaluation your program should ask the user whether or not he/she wishes to continue.
  • If the user indicates that he/she does not wish to continue, your program should indicate the total number of equations evaluated and then exit.

Programming consideration: It is always good in program design to consider potential modifications that may be required a some later date. Be sure to keep this in mind when designing your program.

Lab report (due 4:30pm Tuesday, October 12, 1999)

This lab report should be self-contained. That is, it should be possible for someone to understand what you did and why without seeing anything other than your report. Your report should include:

  • Purpose
  • Problem Statement
  • Procedure (include the steps in your design procedure, reasons for your design decisions, etc.)
  • Documented source code (you may wish to include this at the end of your report)
  • Sample program output
  • Conclusions (problems you encountered, what you learned, suggestions of how the lab could be improved, things you would have done differently, etc.)

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic Submission Guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well.

If you have any questions, consult the instructor.


This page was created by Dr. Christopher C. Taylor copyright 1999.