Then write an algorithm for each of these two problems in pseudocode.(25
points each)
1) Ms. Ordonez passed around a bowl of candy to the students
in her class. Before class, she ate 2 pieces of candy and gave 3 pieces
to Ms. Ratsimor. Eight students arrived for class. The first student took 2
pieces of candy, the second student took 4 pieces, the third student took 6
pieces and so on. After the last student took his/her candy, the basket
was empty. How many pieces of candy were in the bowl at the beginning?
Tips about problem # 1 :
- The bowl will always be empty at the end.
- The user should specify the number of pieces Ms. Ordonez
eats, as well as the number she gives to Ms.Ratsimor.
- The algorithm should work with any number of students,
so the user should specify the number of students.
- The user should specify the number of pieces that
that one student eats "more" than the previous student.
2) Your grade in CMSC104 is based on the following:
5 Quizzes (200 pts. each) = 10%
3 Homeworks (400 pts. each) = 12%
4 Projects (700 pts. each) = 28%
2 Exams (1500 pts. each) = 30%
1 Final (2000 pts. each) = 20%
Total = 100% (10000 pts.)
If you have the following homework, project and exam grades at the end of
the semester, calculate your final grade for the course:
5 Quizzes => 88%,98%, 22%, 89%, 100%
3 Homeworks => 100%, 95%, 98%
4 Projects => 100%, 88%, 86%, 98%
2 Exams => 94%, 92%
1 Final => 89%
Total = 100% (10000 pts.)
Tips about problem # 2 :
- You should allow the user to enter in each of
the quiz, homework, project, exam and final grades.
Last Modified: