CMSC 104, Fall 2009
Project 1: Supplemental Pseudocode
The following is sample pseudocode for HW2, part 2, which you can use as the template for your Javascript program for Project 1. I am providing this to the class so that those who didn't do so well on HW2 can have a fresh start for this project, instead of getting penalized twice. For those who received a good grade on HW2, it would probably be easier for you to use your own pseudocode as the base for Project 1, but that is entirely up to you: you're welcome to still use the provided pseudocode, if you want.
The sample pseudocode solution to HW2, question 2:
Display "Enter the grade for homework 1" Read <hw1> Display "Enter the grade for homework 2" Read <hw2> Display "Enter the grade for homework 3" Read <hw3> Display "Enter the grade for project 1" Read <proj1> Display "Enter the grade for project 2" Read <proj2> Display "Enter the grade for project 3" Read <proj3> Display "Enter the grade for project 4" Read <proj4> Display "Enter the grade for exam 1" Read <exam1> Display "Enter the grade for exam 2" Read <exam2> Display "Enter the grade for exam 3" Read <exam3> <hw points> = (<hw1> + <hw2> + <hw3>) * .04 <proj points> = (<proj1> + <proj2> + <proj> + <proj4>) * .07 <exam points> = (<exam1> + <exam2> + <exam3>) * .20 <final percentage> = <hw points> + <proj points> + <exam points> Display "The grade for the course is", <final percentage>
Note: neither the provided pseudocode, nor your own HW2 solution, cover the final part of Project 1: converting the numerical grade to a letter grade. That is left to you as an exercise: don't forget to do that part! It should be pretty straightforward: a simple "if/else-if/.../else" sequence like we covered in lecture should work perfectly.
Good luck!