[MSOE Homepage]

Dr. Taylor's MSOE homepage

Unix is a Four
Letter Word

My Photo Album

My Personal Homepage

CS-182 Main page

CS-182 -- Lab 2: Income Calculation

Winter Quarter 1999-2000



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

CC-27C, 277-7339

www.msoe.edu/~taylor/

I did some math on my salary today, and it turns out I get a penny every six seconds. I'm kinda glad they save it all for the end of the week, though. --- Eryk Nielsen

Purpose

In this lab, you will write your first C++ program. When done, you should be able to declare objects as well as understand the functionality of the cin and cout objects.

Assignment

Write a program that computes the number of seconds between payments if the user was paid in one penny increments. Your program should prompt the user for his/her yearly salary and the number of vacation days he/she gets each year. You should assume that the user works 40 hours per week. Your program should then produce the following output (on the screen):

I did some math on your salary today, and it turns out
that you get a penny every XXX seconds.  I'm kind
of glad they save it all for the end of the week, though.

where XXX is replaced with the appropriate number of seconds.

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.

Questions

You should provide answers to the following questions in your report:

  • How would you modify your program to allow the user to enter the number of hours per week that the user works?
  • Assuming Mr. Nielsen receives 12 vacation days a year, what is his salary (to the nearest $1000)?

Lab report (due 11:00pm, the day prior to week 4 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 (the steps you used to design your program, reasons for your design decisions, etc.)
  • Documented source code (you may wish to include this at the end of your report)
  • Discussion (example program output (using salary: 41000 and vacation days: 25), answers to questions, problems you encountered, etc.)
  • A summary of your activity log indicating how much time you spent on each phase of the assignment. Please report the time in the following categories:
    • Design
    • Coding
    • Debug (before you think it's working)
    • Test (after you think it's working)
    • Documentation
    • Other
  • Conclusions (what you learned, suggestions of how the lab could have been better, 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.