Lab Assignments

Lab 1

(30pts) Q1: Use a vector to solve the following problem. Read in an unspecified number of numbers. After reading all the values, display only the unique values that the user entered. That is to say, if a number is entered more than once, it should not be present in the output. All numbers should be individually validated at the time of submission. A number is valid if it is an integer. If a floating point value is entered, it should be ignored completely.

Sample Input:

1
2
4
2
5.1
3
^z

Sample Output

1
4
3

To solve this problem you should implement a class named InputValue. For each valid number entered by the user, you should create an InputValue object and store it in a vector. This object should maintain a value and frequency. Thus, if a number is entered in more than once by the user you should not have two InputValue objects with the same value in your vector. Instead, your vector should contain one InputValue object for each unique value entered, and your program should use this InputValue object to keep track of the frequency of it's represented value.

NOTE: 10pts extra credit for displaying the output in ascending order.

(30pts) Q2: Solve the problem in homework 1 using vectors. Your program should no longer require ISBN numbers to be grouped together. Also, the input and output should be separated, not intertwined.

Due by January 26, 2010 - 8:30am

Lab 0

Throughout the quarter I may need to contact you regarding assignment updates, class meetings, and other important subject matter. To do so I will send out e-mails as well as post updates to our Class Website. To facilitate the e-mail contact you are required to submit a valid e-mail address to the Class Roster Website. This should be an e-mail address that you check regularly.

The Class Roster Website also allows you to specify whether you would like to be included in a distributed class roster. If so, you have the option of including your e-mail address and/or telephone number. Note that only the students who opt to include their information on the list will receive a copy of the course roster. Students who do not wish to include their information will not receive a copy. The copy will not be available for download via the Course Website. Instead, it will be distributed via e-mail. You are not required to participate in the class roster, but you are required to completely fill out the form. All fields are required unless otherwise specified.


If you have not already done so, you must register on the Computer Science Network Services (CSNS) Website. Every assignment, including a portion of your midterm and final will be submitted online using this system.

Grading

(1% of overall grade) - Class Roster

Due by January 5, 2010 - 11:59pm

Announcements

CSNS All files must be submitted to CSNS prior to the due date/time.