Write a JavaScript function multRPA(m,n) that accepts two positive integers and returns their product.
Your task: translate the logic shown in the the Pseudocode Russian Peasant Algorithm into a JavaScript function that can be used in the theoryMachine.
Add a multRPA radio button to theoryMachine.html. When the button is selected and Apply Function is clicked, the number entered into the form by the user is squared by multRPA().
When it is correct, upload theoryMachine.html to /111/p4/theoryMachine.html.
Note: since you already will have submitted Project 4-A in Blackboard, you do not have to re-submit this part of the project in Blackboard.
Extra Credit (3 XC points): Use a 2-D array to build a 2-D table of N powers of N.
Write a function NpowersN() that accepts a natural number n and returns a string representing a table of N powers of N. The following examples show the value returned by the function for n = 4, n = 5, and n = 6:
Guidelines & Constraints:
NpowersN() must use a local 2-D array to hold the table values. After buidling the table, traverse it to generate the string used to output the table; the function returns the output string as its value. The function does not prompt the user for n: that duty is handled outside the function, and n is passed to NpowersN() as an argument.
Remember that escape sequences (such as \n and \t) can be used in JavaScript strings to control formatting.
To receive XC points: Since you already submitted P4 in Blackboard, please send your GTF email stating "Extra Credit Option Completed" in the Subject section. Thanks.
Project 4 Grading Rubric. This document describes in detail how your lab instructor (GTF) will grade your project.
To get full credit for your work, evaluate your project carefully using the rubric before submitting it for grading.
On or before the Part-A due-date submit the project using Projects > Submit Project 3 in Blackboard. You must include your htaccess-enabled project URL in the Comments section. If you do not use this BB assignment turn-in feature, your project cannot be graded and your score will be zero (0).
Project 4 is in two parts, but you only have to submit it once in Blackboard, when you complete part A. You do not have to re-submit in Blackboard for part B-- just upload guessMyNumber.html to the server by the due-date for part B and you're done-- no second BB submit is required. No email is required. Done.
Pair Programming Teams
You may work alone on the projects or with one partner, in a programmer
team. Groups of three or more are not an option.
If you work as a team:
A. IMPORTANT information if you are working with a partner: You must notify the grader of both programmer names in the Comments section when submitting the project in Blackboard. Failure to do this may trigger an investigation of academic dishonesty.
B. Each partner must maintain copies of all project files, etc., in his or her 111 site on uroegon.edu
C. You must each understand the solution you
are turning in. Exams will cover much of the same material as the lab
exercises, so both partners on a team should understand the material.