Project 2 - Basic Algorithms

CMSC 104, Fall 2002

Due Date:

Start of class, Monday October 14, 2002.

Note that late projects will NOT be accepted.

Point Value:

This project is graded with a 100 point max score.

Objectives:

Assignment:

Determine the generic solutions to the problems. Write the generic solutions in pseudocode. The pseudocode should be represented as discussed in class. Turn this work in on paper, not by e-mail. Type in the solutions using any word processor of your choice. No handwritten submissions will be allowed.

Make sure that your pseudocoded solutions include, as discussed in class:

You can use your own psuedocode standard. However if you use functions other than that discussed in class make sure you define them. i.e. If you use Print instead of Display make sure to define it in words.

Problem 1:

Write an interactive program that will draw a hollow (the in-class problem was different) rectangle of asterisks (*). The program must also display the dimensions of the rectangle. Error checking must be done to be sure that the dimensions are greater than zero. Ask the user again if the dimensions are zero.

Example :-
for length = 3 and width = 7

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

Problem 2:

The grade in some course is based on the following:

 4 Projects                      =  40%
 3 Exams (20% each) =  60%

 Total                               = 100%

Note:- Each project is not worth 10%, only the total contribution due to the projects is 40%. Thus the maximum grade per project is to be considered when calculating the contribution of the project grades in the final grade.

If a student has the following project and exam grades at the end of the semester, calculate the final grade for the course:

     Project 1 = 20/20
     Project 2 = 90/100
     Project 3 = 70/75
     Project 4 = 19/25
     Exam 1 = 23/50
     Exam 2 = 40/00
     Exam 3 = 81/100

Give the specific solution to this problem.

Then give an interactive generic algorithm where you get the grade of each project and exam. The maximum grade per project or exam will be the same as in the above list i.e. maximum points for project1 are 20, for project2 are 100, exam1 are 100 and so on. Perform error checking to see that the grade entered is not greater than the maximum grade and not less than zero. Display all the grades as shown above and the final grade for the class.

You should do this project independently. The work you submit should be your own. Instances of cheating will not be tolerated. You will fail the class if found copying or discussing solutions with other students.