CMSC 104, Spring 2009

Homework 2 - Basic Algorithms

Out: Monday, February 16th
Due: Before 11:59 PM on Monday, February 23rd
Note that late homeworks will NOT be accepted.

Objectives:

Assignment:

·  First solve each of the two problems shown below. (25 points each, so make sure you show your work, no matter how simple you think it is)

·  Then write an algorithm for each of these two problems in pseudocode.(25 points each)

1) Ms. Block passed around a bowl of candy to the students in her class. Before class, she ate 1 piece and gave 3 pieces to Mr. Frey. Eight students arrived for class. The first student took a piece of candy, the second student took 3 pieces, the third student took 5 pieces and so on. After the last student took his/her candy, the basket was empty. How many pieces of candy were in the bowl at the beginning?

Tips about problem # 1 :

2) Your grade in CMSC104 is based on the following:

 3 Homeworks (3% each) =  9%
 4 Projects  (9% each) = 36%
 3 Exams    (15% each) = 45%
 10 Quizzes  (1% each) = 10%
                 Total = 100%
 

If you have the following homework, project and exam grades at the end of the semester, calculate your final grade for the course:

     Homework 1 = 100/100  Project 1 =  75/100    Exam 1 = 92/100
     Homework 2 =  80/100  Project 2 =  90/100    Exam 2 = 80/100
     Homework 3 = 100/100  Project 3 =  99/100    Exam 3 = 81/100
                           Project 4 = 100/100     
 
     Quiz average = 90%

Tips about problem # 2 :