
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Intro Computer Science; Subject: Computer Science; University: Loyola Marymount University; Term: Fall 2007;
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Fall 2007
This is the payoff — after slogging through how we think about algorithms, let’s finally feed them into a computer, so that they can perform these computations for us.
If you haven’t done so already, read Chapter 5 in the Brookshear book.
Convert the pseudocode algorithms from last week into working JavaScript programs. The templates given below are intended for use with the JavaScript scratch page that can be found on the course Web site, so that you can enter the values you want in the input fields then click Run to see the result:
You will receive extra credit if you also submit JavaScript versions of the following algorithms, based on the pseudocode given in Tuesday’s pseu- docode examples handout:
- makeChange(amount, denominationList)^ — The ver- sion that can handle any system of coin denomi- nations, expressed in denominationList. - russianPeasantMultiply(factor1, factor2)^ — The ver- sion on the right, which adds up the final product right away.