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

CMSC 104, Spring 2002

Project 3 - Algorithms Using Control Structures

Due Date:

Midnight, Tuesday, March 12

Note that late projects will NOT be accepted.

Point Value:

This project is worth 50 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 in to a single text file using the xemacs editor. Send the file as an e-mail attachment to Zhipeng (zhipeng1@cs.umbc.edu). Make the subject of your e-mail "Project 3 - Algorithms Using Control Structures".

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

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 (25 points)

A manufacturer sells a certain article to dealers at a rate of $10.00 each if less than 20 are ordered. If 20 to 49 items are ordered, the price of each and every article is reduced by 50 cents. If 50 or more items are ordered, the price of each and every article is reduced by 75 cents. What is the total cost of 100 units?

The algorithm should be as generic as possible. The number of units ordered and the total price should be displayed.

Problem 2 (25 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.



Friday, 01-Mar-2002 14:26:38 EST