CS 1014: Assignment 1

Due: Tuesday, February 2, 1999

Developing Algorithms for Programming Problems


 


In this assignment you will have the opportunity to learn how to develop algorithms before writing actual code for programming problems. You must not receive any solution from anyone else in the class or outside of the class. Also you must not share your solution with anyone else.

1.Calculation of Grades:

Write an algorithm to compute final grades for a course. For each student, the midterm exam score and the final exam score are known. The final grade of a student is calculated by adding 40% of the midterm score and 60% of the final exam score. For each student, the algorithm should inform or display the final grade of the student. At the end, the algorithm should inform or display the average midterm exam score, the average final exam score, and the average final grade. Your algorithm must process an indefinite number of students.

2. Payroll Processing:

Write an algorithm to calculate the weekly payroll of a store. The employees of the store are paid hourly. For each employee, the number of hours the employee works in one week and the employee's hourly pay rate are known. An employee's gross pay includes his or her regular pay and overtime pay, if any. Regular pay is the number of hours the employee worked up to 40 hours times the hourly pay rate. For hours over 40, an employee is paid at a rate of 50% over the regular hourly rate. That is, the overtime hourly pay rate is 1.5 times the regular pay rate. Your algorithm should calculate weekly gross pay for all employees of the store, the total pay, and the number of employees. You should not assume any fixed number of employees for the algorithm. Also notice that not all employees work over 40 hours per week.

Turning In Your Assignment:

You should type your assignment with a word processor or text editor (ex: PFE editor). Your printed copy must include your name and ID, the assignment number ("Assignment 1") and the course number ("CS 1014") on it. Before submitting the assignment, write your name with a pen or pencil on the upper-left corner of the backside of the last sheet of paper and then fold it lengthwise at the middle. The assignment is due at the beginning of the class.