CO211: Modern Programming I

Calendar/Assignments

Number Title/Subject/Assignment Due
Date
Week
1 In Lab: write a program (Sample Answer) that displays the following:
your name
<blank line>
your email address
Aug. 30 1
  Labor Day / No Class Sept. 6 2
2 Before Class: write a program (Sample Answer) that displays your initials. The letters should be 6 lines high, and each letter drawn with the characters that comprise it.

In Lab: complete exercise 2.21 (Sample Answer) from the book, page 98.

Sept. 13 3
3 Before Class: complete exercises 2.33 (Sample Answer) and 2.34 (Sample Answer) from the book, pages 99-100. Sept. 20 4
4 Before Class: complete exercises 3.25 (Sample Answer), 3.27 (Sample Answer)and 3.29 (Sample Answer) from the book, pages 144-145 Sept. 27 5
5 Before Class: complete exercises 3.22 (Sample Answer) and 3.23 (Sample Answer) from the book, page 144, and write a program using the EZWin libraries (Sample Answer) that creates, in a 10×12cm window, a border of alternating red and blue 2×2cm squares, with the following text centered in the window:
name
e-mail address
Oct. 4 6
6 Before Class: complete exercises 4.27 (Sample Answer) and 4.28 (Sample Answer) from the book, page 211, and write a program (Sample Answer) that will accept a year and indicate whether the year is or is not a leap year. Any year prior to 1584 is, by definition, a non-leap year. See the Venn diagram and accompanying text on page 172 for the other rules used to determine leap years. Oct. 11 7
7 Before Class: complete exercises 4.57 (Sample Answer) and 4.58 (Sample Answer) from the book, page 215.
Mid-semester Exam: 1 hour exam covering information from lecture and in the book up to and including section 4.7
Oct. 18 8
8 Before Class: complete exercises 4.48 (Sample Answer) and 4.50 (Sample Answer) from the book, page 214–215. Oct. 25 9
9 Before Class: Using nested for loops, write a program (Sample Answer) that takes a height as input from the user to create a “right triangle” comprised of asterisks. It should be congruent with the following example:

*****
**** 
***  
**   
*    

Using nested for loops, write a program (Sample Answer) that takes a height as input from the user to create a “right triangle” comprised of asterisks. It should be congruent with the following example:

*****
 ****
  ***
   **
    *

Nov. 1 10
10 Before Class: complete exercise 5.43 (Sample Answer) from the book, page 264. Write a program (Sample Answer) that reads a series of floating-point numbers from a text file named “numbers.txt” and display on the screen the largest number, the smallest number, and average of the series. Write a program (Sample Answer) that reads integers from the keyboard. The program should keep track of the count of entries equalling 1, 2, 3, 4 & 5, respectively, as well as the count of entries that don’t equal any of the above. After the user finishes entering data, the program should output a histogram of the results to a file.

Example input:

2 44 5 6 6 2 7 4 2 2 8 9 9 15 0 1 1 8 3 5 2 0

Example output, written to a file:

Results:
1 **
2 *****
3 *
4 *
5 **
o ***********
Nov. 8 11
11 Before Class: Write a single program (Sample Answer) that combines the requirements of exercises 6.29 and 6.30 from the book, page 307. Complete exercise 6.44 (Sample Answer) from the book, page 308. Complete exercise 6.52 (Sample Answer) from the book, page 309. Nov. 15 12
12 Before Class: Write a program (Sample Answer) that extracts 3 values as input and prints the largest. The program must use two functions in addition to main(), one which prompts for and reads the input, and another which determines the largest value. Complete exercise 7.14 (Sample Answer) on page 358 (the referred program is on page 324), and exercise 7.26 (Sample Answer) on page 361. Nov. 22 13
13 Before Class: write a test program and the implementation (Sample Answer) for a class called date with the following definition:
/*
    date.h
*/

#ifndef DATE_H_
#define DATE_H_

class date {
    public:
        date();
        date(int d, int m, int y);
        void print();
        void tomorrow();
    private:
        int day;    // 1-31
        int month;  // 1-12
        int year;  
};

#endif

Complete exercise 8.14 (Sample Answer) on pages 398-399.

Nov. 29 14
14 Before Class: Write a program (Sample Answer) that will read up to 100 integers from keyboard input and store it in an array. Print out the largest and the smallest value; the values should be the result of two distinct and separate functions—one to find the largest, one to find the smallest.
Write a program (Sample Answer) that reads a string from the keyboard and stores it in a “c-style” string. Print out the length of the c-style string; the length should be the result of a separate function that finds the length of a c-style string based on the NUL ('\0') character.
Write a program (Sample Answer) that randomly initializes an array of 20 integers, then receives user input from the keyboard. The program then searches the array to see if the user input matches an initialized value. If the value is matched, the program displays the location of the matching value in the array; if the value is not matched, the program indicates this as well.
Dec. 6 15
  Final Exam, 6–8pm Dec. 13 16

Comments? Email jim3@millard.org Last updated October 20, 2001