Lab 2 - I/O and Basic Computation

Due - February 16/17, 2003

In this lab, you will write a program to calculate your course grade. Your program should prompt the user for her current set of percentages in the course (up to the final project) and her desired final percetange. Based on the grade distribution, your program will calculate the percentage the user must get on her final project in order to receive the desired final percentage.

As an example, suppose your grade was based only on homework (75%) and a final exam (25%). The algorithm for your program might look as follows:

//ask user for homework score
//ask the user for desired final percentage (i.e., 90 for an A, 80 for a B...)
//calculate final project percentage -- (desired_final_percentage-(homeworkscore*.75))/.25
//display results for user

Your program will be slightly more complex. Your grade is based on six scores. Following is the distribution you will use for your calculation:
Homework - 10%
Quizes - 20%
Lab Assignments - 30%
Project 1 - 10%
Project 2 - 15%
Final Project - 15%

You should prompt the user for the homework percentage, quiz percentage, lab percentage, project 1 percentage, project 2 percentage, and desired final percentage. You should use printf to print each prompt for the user and scanf to read in each response and store the response in a variable. Make sure you do this one item at a time. Once you have all of the information, use the above distribution to calculate the required final project percentage. Once you have completed the calculation, use printf to print the result for the user.
  1. Make sure you have completely documented your program including your name, date, filename, and a description of the program. See the worksheet you received in your first lab for an example of this documentation.
  2. Make sure a lab assistant (Dianne or I) has seen your program run.
  3. Copy and paste the output of your program to the bottom of your program itself. Make sure the output is a comment. That means, put a /* before the output and a */ after the output.

Sami Rollins