CS 107 - Summer 2015

Lab Assignment 3

Due: Friday 7/3/2015 by 11:59 pm (i.e. midnight)

Write a C++ Program (using only the C+ subset as defined in lecture) that will:

  1. Print out your name
  2. Print out your net-id
  3. Print out CS 107 and Semester information (Summer 2015)
  4. Print our the Assignment Name and Number (Lab Assignment 3)
  5. Print out your lab time (Wednesday at 10am)
  6. Print out the additional information as described below:
Create a Histogram

For this assignment, you are to create a histogram based on the values entered by the user. A histogram is a simple was to show the frequency of data that falls into a certain range. A C/C++ historgram is often drawn on its side as shown below:

80-61: **

60-41: *****

40-21: ********

20-01: ***

The above histogram shows that there were 4 values in the range from 80 to 61, 7 values in the range from 60 to 41, 10 values in the range from 40 to 21 and 5 values in the range from 20 to 1. Each asterik represents one value in the specified range. The above histogram appears to have extra blank lines between bars this is due to the way this web page shows textual data. Your program should not have these black lines.

For our histogram, you are to have 11 "buckets" that will keep track of values from 0 and greater.

  • The first bucket will show the frequencies of values in the range from 0 to 9.
  • The second bucket will show the frequencies of values in the range from 10 to 19.
  • The third bucket will show the frequencies of values in the range from 20 to 29.
  • ...
  • The tenth bucket will show the frequencies of values in the range from 90 to 99.
  • The eleventh bucket will show the frequencies of values in the range from 100 and greater.
You are to first prompt the user to enter integer values that will be used to create the histogram. The user is to enter a negative number when he/she has entered all values needed for the histogram.

After the negative number has been entered, the program show create/display the histogram.

Submission of the Lab

The lab must be submitted electronically to the Assignment Link for Lab 3 inside of Blackboard. You will only need to submit the C++ source code file (just the ".cpp" file, not the "a.out" file).

You are to name your program file using both your NET-ID and the Lab Number. Thus for Lab 3, if you NET-ID was ptroy4, your program should be named: ptroy4Lab3.cpp

-- Main.troy - 2015-06-30

Topic revision: r1 - 2015-06-30 - 20:14:24 - Main.troy
 
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF