Tuesday, December 20, 2011

Exam #3 results

The final exams are graded. Due to time constraints, I counted the best three of four programs towards your final score. Also, there was one question on the sorts and searches page that I tossed since everyone missed it.

I will likely post final grades tomorrow night, after the last call deadline.

Grade distribution follows:

Last call

Comp 137 officially ended with the end of last night's exam. In the best interest of certain students, I am willing to accept lab submissions up until 6pm tomorrow (Wednesday) evening.

Any materials not in my Brookdale inbox by six o'clock tomorrow will be recorded as not completed. If you have not yet sent all of the minimum required lab assignments (labs 1-10), I strongly urge you to do so immediately.

Any student who does not successfully complete these minimum assignments will fail this course, regardless of test grades.

Tuesday, December 13, 2011

Lab 10 - counting digits

This assignment requires that you generate 100 pseudo-random numbers, between 0 and 9, inclusive. You need to use an array to keep track of how many times each digit is generated. The most efficient way to do this is to create one ten-integer array, named counts, and to increment the contents of the appropriate array location each time its value is randomly generated. That is, each time your code generates a 0, you increment the contents of counts[0]; each time your code generates a 1, you increment the contents of counts[1]; and so on.

Remember to seed your rand by calling srand first.

Monday, December 12, 2011

Homework 5 - average scores

Write a program that reads in an unknown number of integer values from a text file and stores them in a vector. Display the unsorted values then sort and sum the values. Display the sorted values, the average value, and total count to the user. Make sure to use an iterator to process the vector.

   string getFilename(string prompt)
   void readValuesFromFile(string filename,
      vector<int> &values)
   void displayValues(string leader,
      vector<int> &values,
      vector<int>::iterator pos)
   int sumValues(vector<int> &values,
      vector<int>::iterator pos)

Registration reminder

Register for the spring term before the end of the fall semester! You will have a better selection of classes and sections if you do. Also, you should be aware that if you wait too long, there is the possibility that a section you want could be cancelled due to insufficient enrollment.

Tuition payments are not due until January 5th.

Sorting

Sorting algorithms can be implemented in almost any programming language but have you ever considered that they could be implemented in folk dance?

Reading assignment - chapter 10

Read chapter 10, Applications of Arrays (Searching and Sorting) and the vector Type.

Due Date
Monday, December 12th, 6:00pm