CS150 -- Lab 4: Generic Calculator



->Courses
->CS150
-->Homework
-->Lab 1
-->Lab 2
-->Lab 3
->Lab 4
-->Lab 5
-->Lab 6
-->Lab 7
->Electronic Submission
->Old Exams
->C++ Examples
->MSVC Info
->Software
->Tentative Schedule
->Course Policies

[Courses]
[Rich][Home][Rich]
[Author]

Fall Quarter 2000

Overview

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

Procedure

Your program should:

  • Accept input in the form of:
          32 + 17
          72.3 / 4
          18.1 - 342.842
          18.1 * 342.842
          
  • Display the equation to be evaluated along with 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 beginning of week 6 lab)

The 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 output from your program
  • Conclusions (problems you encountered, what you learned, suggestions of how the lab could have been better, things you would have done differently, etc.)

Your report should be typed, and as with any report you submit, correct spelling and grammar are required. 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.

Your grade will depend on quality of design and clarity of the code and documentation, as well as whether your program produces the correct results. If you have any questions, consult the instructor.

Office: CC-27C, Phone: 277-7339
Last Updated: July 20, 2000
© 2000 Dr. Christopher C. Taylor