CS183 -- Lab 2: Class Implementation



->Courses
->CS183
-->Objectives
-->Quiz 1
-->Lab 1
->Lab 2
-->Project 1
-->Project 2
->Electronic Submission
->Old Exams
->C++ Examples
->MSVC++ Info
->STL Info
->MFC/GUI Info
->Software
->Tentative Schedule
->Support Forum
->Course Policies

[Courses]
[Rich][Home][Rich]
[PHome]

Spring Quarter 2003

Course Objectives Addressed

  • Understand the rationale for object-oriented design and programming.
  • Understand data abstraction and abstract data types.
  • Be able to design and implement simple C++ classes and class libraries.
  • Be able to document the design and implementation of small software systems.

Overview

The purpose of this lab is to implement a Histogram class for which the public interface has already been designed.

Acknowledgement

This lab was developed by Dr. Chris Taylor.

Problem Statement

Implement the Histogram class (refer to the Histogram.h header file) and write a program that will use the Histogram and LogEntry classes to generate histograms of the:

  • Number of requests per hour
  • Number of requests per day
  • Number of requests by filesize

The histogram should look something like this:

       Request by Day of Week
         |          *
         |          *           
         |          *           
         |       *  *           
Requests |    *  *  *     *     
         |    *  *  *  *  *     
         |    *  *  *  *  *  *  
         | *  *  *  *  *  *  *  
         ----------------------
           A  B  C  D  E  F  G
A:  20 - Sunday
B: 210 - Monday
C: 276 - Tuesday
D: 422 - Wednesday
E: 180 - Thursday
F: 227 - Friday
G: 109 - Saturday

or

 Requests by Filesize
         |     *
         |     *
         |     *
         |     *
Requests |     *
         |     *
         | * * *
         | * * * * *
         ------------
           A B C D E
A:  48 - 0-5000
B:  59 - 5000-10000
C: 301 - 10000-50000
D:  24 - 50000-100000
E:   7 - 100000-500000

Notes:

  • You should implement all of the member functions given in the Histogram class definition.
  • You may not modify the public portion of the Histogram.h header file.
  • You may modify the LogEntry if you wish.

Lab report

The lab report should consist of the following:

  • Your design documentation. (One or two paragraphs describing your approach to solving the problem. This section should convince me that you were thinking when you made the decisions that you did about how to design your program.)
  • A brief description of any problems you encountered or questions you have regarding the lab.
  • An activity log indicating how much time you spent on each phase of the assignment. You should use the format found in the template XML file and report the time in the following categories:
    • Design
    • Coding
    • Debug (before you think it's working)
    • Test (after you think it's working)
    • Writing Report
    • Other
  • Any suggestions you have for how the lab could be improved.
  • The required histograms for the log file used in Lab 1 and the same histograms for this much larger log file.
  • The documented source code for your program. Include any files that you have modified since your last submission.

Lab report template

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.

Your lab grade will be determined by the following factors:

  • Meeting specifications
  • Technical quality
  • Design documentation
  • Internal documentation (comments)
  • Program clarity (formatting, etc.)
  • Narrative report
  • Activity log (similar to the last lab)
  • Correct program output
  • Spelling and grammar
  • Timeliness of submission

If you have any questions, consult your instructor.

© 2003 Dr. Christopher C. Taylor Office: CC-27C Phone: 277-7339 Last Updated: Mon Mar 17 06:00:36 2003
I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to.