- Details
- Parent Category: Programming Assignments' Solutions
We Helped With This Statistics with R Programming Assignment: Have A Similar One?
SOLVED

Short Assignment Requirements
You are NOT allowed to use any ofthe following functions in your code: apply( ), lapply( ), sapply( ), rep( ), mapply( ), or replicate( ). Youare NOT allowed to define or use anonymous functions. Your code should work correctly without theneed for installing special non-default R packages or libraries.
Assignment Image
![R | R Studio Assignment Description Image [Solution]](/images_solved/5250017/1/im.webp)
Homework Code
After a student "correctly" answers all of the questions for a homework assignment at a particular web
site, an email is sent to the student containing a nine digit "authorization code to give to their teacher to
prove that the assignment was completed. The first three digits of the authorization code are random
letters A-Z. The next four digits consist of the final "seed" number to be explained later. And finally, the
last two digits consist of the assignment number which is an integer value contained in the interval
[1,99]. How to compute the final seed number: (1) Extract the last four digits of the student' s social
security number and call this the "seed". (2) Square the "seed" and if the answer has less than eight
digits, add enough leading zeros to the answer to make it have eight digits. (3) Extract the middle four
digits and call this the "seed". (4) Repeat steps 2-3, four more times to arrive at the final "seed" value.
Part A
Create a user defined function AuthCode(). The arguments for AuthCode() should consist of the
student's social security number (string that includes hyphens) and the assignment number (integer
1-99). The function should return a nine digit authorization code. For example, Auth-
Code("610-74-2222",1) might generate something like the following: "KJN576001"
Part B
Generate a list containing the authorization codes for the first assignment, social security numbers
"510-92-1111" through "510-92-9999".