# EE102 Homework Assignments

### Assignment 1

#### Problem set 1 (12pts.)

Chapter 2, exercise 2.2: 13-16, 29-32, 37-40, page 48-49.

• If no, explain briefly

#### Problem set 2 (8pts.)

Chapter 2, program 4, page 65.   DO NOT write the program, write the formula only.

### Assignment 2

#### Program 1 (20pts.)

Chapter 3, program 6, page 131.   This problem deals with formatting your printout. Nicely formatted, alligned and correct output is the significant part of the grade. Do remember to attach the copy of the program output when submitting your source code.

#### Program 2 (10pts.)

Chapter 3, program 7, page 131.   Do remember to attach the copy of the program output when submitting your source code.

### Assignment 3

#### Program 1 (10pts.)

Chapter 4, program 8, page 207.   That expands exercise 12 from page 153. You must use a function as described to get any credit.

#### Program 2 (10pts.)

Chapter 4, program 10, page 207.   That expands exercise 17 from page 153. You must use a function as described to get any credit.

#### Program 3 (10pts.)

Chapter 4, program 11, page 207.   That expands exercise 18 from page 153. You must use a function as described to get any credit.

### Assignment 4

#### Program 1 (10pts.)

Chapter 4, program 14, page 207.   That expands exercise 11 from page 165.

#### Program 2 (10pts.)

Chapter 4, program 18, page 207.   That expands exercise 14 from page 165.

#### Program 3 (10pts.)

Chapter 4, program 25, page 208.

### Assignment 5

#### Program 1 (10pts.)

Chapter 4, program that expands exercise 14 from page 178.   Do not perfrom the same calculation twice.

#### Program 2 (10pts.)

Chapter 4, program 26, page 208.

#### Program 3 (10pts.)

Chapter 4, program 28, page 209.

### Midterm Exam on October 9, 2002

#### Where is the homework assignment?

Just study for the exam. We have still plenty of time to write more programs before the semester ends.

### Assignment 6

#### Program 1 (30pts.)

Chapter 5, program 17, page 274.   Some extra credit opportunity will be posted here later.

#### Programs 2 and 3 (0pts.)

There is only 40% of regular homework load due to the fact that the fall break takes 40% of the week. Do the homework before the break and travel safely.

### Assignment 7

#### Program 1 (10pts.)

Chapter 6, program 6, page 334.

#### Program 2 (10pts.)

Chapter 6, program 9, page 335 that expands exercise 3 from page 312.

#### Program 3 (10pts.)

Chapter 6, program 11, page 335 that expands exercise 5 from page 312.

### Assignment 8

#### Program 1 (10pts.)

Chapter 7, Exercise 7.4,7 & 7.4.10, page 373-374.

#### Program 2 (10pts.)

Chapter 7, program 6, page 414   You must ask the user for the size of the table to print. Do not set it permamently to 9 by 9!

#### Program 3 (10pts.)

Chapter 7, program 14, page 415

### Assignment 9

#### Program 1 (20pts.)

Chapter 7, program 7, page 414.   That expands exercise 25 from page 376.   You can but do not have to write it as a separate function.

### Assignment 10

#### Program 1 (15pts.)

Chapter 8, program 4, page 492.

#### Program 2 (15pts.)

Chapter 8, program 6, page 493.

### Assignment 11

#### Program 1 (15pts.)

Chapter 8, Exercises 15,16,17, 19, 21, page 475-476.

#### Program 2 (15pts.)

Chapter 8, program 13, page 494.   (Like the base converter but the base is 1000. print leading 0s in numbers <100 or <10 or ==0 so that there are three digit groups.)

#### Program 3 (15pts.)

Chapter 9, program 3, page 559.   (One for loop to read the file line by line, another for loop inside to search and count the word occurences.)

### Assignment 12

#### Program 1 (20pts.)

Chapter 9, program 7, page 559.

#### Program 2 (20pts.)

Chapter 10.2, program 3, page 637.   That expands exercise 22 from page 589.

### Assignment 13

#### Program 1 (30pts.)

Chapter 13.2, program 6, page 813.   Read the number of models and the number of salespersons from cin. Read the sale data to the 2D array either from cin or from a file.

See a supporting example posted on the Web.