UMBC CS 104
UMBC CMSC 104 CSEE | 104 | current 104

CMSC 104, Spring 2003

Project 2 - Algorithms

Due Date:

Midnight, Tuesday, March 11

Note that late projects will NOT be accepted.

Point Value:

This project is worth 45 points.

Objectives:

Assignment:

Solve each of the problems below for their specific solutions. Just do this on a piece of paper (do not hand it in). Then determine the generic solutions to the problems. Write the generic solutions in pseudocode. Type the pseudocoded solutions into a single text file using the emacs editor. Send the file as an e-mail attachment to Gaurav (jolly1@umbc.edu). Make the subject of your e-mail "Project 2 - Algorithms".

Make sure that you indent your selection and repetition control structures in a clear, consistent style. Also,

Remember that any control structure may be embedded inside of any other control structure. For example, an If-Else may be inside of a While. Or an If-Else may be inside of another If-Else.

Problem 1 (10 points)

Ellen went on a shopping spree with her Visa credit card and lost the receipts. She remembers the prices of the items relative to the price of the pair of shoes that she bought. She now needs to compute the total amount that she spent. These are the relative prices of the items:

A pair of shoes for $72 Sunglasses for half the price of the shoes A CD for one-third the price of the sunglasses In addition, there was a 6% sales tax on all items.

Note: You may assume that the shopper always purchases exactly three items and that the relative amounts of the second and third amounts are always the same (i.e., one-half and one-third).

Problem 2 (15 points)

Bob went to the school book fair and purchased three books. Their prices were $15.00, $20.00, and $35.00. The book fair discounted a person's total purchase (before tax) as follows:

purchase < $50.00 , 5% discount $50.00 <= purchase < $75.00, 10% discount purchase >= $75.00, 15% discount After the discount, a 5% tax was applied to the purchase. What was the final cost to Bob for his books?

Note: You may make the following assumptions:

Problem 3 (20 points)

Samantha's grades on her CMSC 104 projects so far are 94%, 82%, 75%, and 96%. She wants to compute the average of her projects so far and then determine the corresponding letter grade based on the following scale:

90.0 <= average <= 100.0 A 80.0 <= average < 90.0 B 70.0 <= average < 80.0 C 60.0 <= average < 70.0 D 0.0 <= average < 60.0 F

What is Samantha's letter grade for the average of her projects so far?

The generic algorithm must allow for any number of projects. You can accomplish this by asking the user how many project grades he/she will be entering before reading the grades. The number of projects, their numeric average, and corresponding letter grade should be displayed.

Note: You may assume that the end points in the grading scale (i.e., 100.0, 90.0, etc.) will never change, so they do not need to be variables.



Wednesday, 26-Feb-2003 18:28:50 EST