Assigned on Monday, 22 May 2017; due by end of day 29 May 2017:
Do 3x3 Grid Games Exercises 7a-d.
Send your answers in an email addressed to jspurgeon@vcstudent.org with the subject "Tic-tac-T".
Assigned on Monday, 15 May 2017; due by end of day 5 June 2017:
MODIFIED ON 5/16 and 5/22: Do 3x3 Grid Games Exercises 1-5 and 6a-c.
For extra credit, do exercises 6e. For fun, do exercise 6d.
Send your written responses to the exercises that pose questions in or attached to an email addressed to jspurgeon@vcstudent.org with the subject "Grid Games Written Responses".
Send the html and JavaScript code for a single web program in the body of a separate email to jspurgeon@vcstudent.org with the subject "Grid Games Program".
Your program code will be copied, pasted into the Grid Games "Editor", and evaluated based on what your program does after the "Render That" button is pressed.
Test your program before submitting it for grading!
Assigned on Thursday, 4 May 2017; due by end of day 5 June 2017:
Do exercises 1-10 on the Page Maker page. Submit your answers
via email to jspurgeon@vcstudent.org with the subject "Page Maker".
Assigned on Thursday, 27 April 2017; due by the end of day Friday, 5 May 2017 (yes, the same due date as the previous assignment!):
Submit the code for the entire EchoArgs class in the body of an email message sent to jspurgeon@vcstudent.org with the subject EchoArgs.
Assigned on Thursday, 20 April 2017; due by the end of day Friday, 5 May 2017 (extended 1 week due to AP exam practice):
Create a public Java class called SquareMatrix that has a main method. When the main method is executed, output should be produced as described below.
Let N be the number of arguments (of type String) passed to the main method.
If N is a perfect square (e.g. 4, 9, 16, etc.) and each argument can be converted to a floating point number, then the arguments should be interpreted as elements of a two-dimensional matrix M with n rows and n columns of floating point numbers, where n times n equals N, the first n arguments represent the elements of the first row of M, the second n elements represent the elements of the second row of M, and so on. In this case, the output should be n rows of n floating point numbers (adjacent numbers should be separated by a single space) representing the n by n matrix P, which is the product of multiplying matrix M by itself. Use two-dimensional arrays to represent the matrices M and P. Here is a Java 2D-array tutorial.
If N is not a perfect square or if any argument cannot be converted to a floating point number, then the output should be the string "Invalid arguments".
CHALLENGE (bonus points): Create a public class called SquareRootMatrix that outputs a message (e.g. "Invalid arguments" or "M does not exist") or a matrix M which, when multiplied by itself, produces the matrix P represented by the arguments passed to the main method of SquareRootMatrix.
Assigned on Monday, 10 April 2017; due by the end of day Tuesday, 18 April 2017:
Go to the post titled “Algorithm 1.1E” and do Exercises 1-7 (listed at the bottom of the post). Send your answers to jspurgeon@vcstudent.org as an attachment to or in the body of an email message with subject “Algorithm 1.1E”. Clearly label your work with the exercise number followed by your answer for that exercise. To assist with this assignment and in preparation for the AP exam, review the following sections in Barron's AP Computer Science A.
From Chapter 1: Introductory Java Language Features
Send your code to jspurgeon@vcstudent.org in the body of an email message. Use "Java Quicksort" as the subject.
Due by end of day Thursday, 5 April 2017.
[bonus points] Offered on 3 April 2017:
Watch the first ten Donald Knuth Web of Stories videos beginning with Family history.
Watch at least ten additional Donald Knuth videos of your choosing.
Send an email to jspurgeon@vcstudent.org with a list of the titles of all of the Web of Stories videos you watched.
Write a letter to Donald Knuth. Proof read your letter very carefully. Treat your writing with the same care and thoughtfulness you would give to a job or college application.
Print your letter or very neatly write it by hand and sign it. Carefully deliver the signed letter to Mr. Spurgeon to be sent to Donald Knuth along with Mr. Spurgeon's own letter and letters from other students.
The number of bonus points awarded will depend on the quality and thoughtfulness of your letter.
Due by end of day Thursday, 5 April 2017.
[20 points] Assigned (to you individually) on 16 March 2017:
Due by the end of day, Monday, 20 March 2017...
Modify Sorter.pickySelectionSort
so that it swaps only when necessary. Send your modified version of the method to jspurgeon@vcstudent.org in the body of an email message with the subject “Selection Sort Exercise”.
Also include an answer to the following question:
Is your modified version of the method an improvement over simpleSelectionSort? Why or why not?
[at most 40 (+5 bonus) points] Assigned (to you individually and to your group) on 9 March 2017:
Due by the end of day, Tuesday, 14 March 2017...
[at most 5 points] As in previous exercises, review the questions about sorting and searching in your Barron's textbook. Make a list of the questions (identified by question number) that are related, directly or indirectly, to Bubble Sort.
[at most 5 points] What do the period (.) and s characters in the program's output correspond to?
[at most 10 points] Describe the main distinguishing feature of each implementation/algorithm.
[at most 10 points] Discuss the number of comparisons and swaps made by each implementation of Bubble Sort. Consider and discuss the best-, worst-, and average-case performance of each implementation/algorithm.
[at least -5 points] Send one email message per group containing your list of question numbers and the answers to the above questions to jspurgeon@vcstudent.org. The subject of your message should be "Bubble Sort Assignment". List the names of each team member in the body of your email message. Failure to follow these instructions exactly will result in a penalty of up to 5 points.
[at most 10 points] Each individual must meet with Mr. Spurgeon during class or at another prearranged time (prior to the due date) and demonstrate the ability to implement one of the variations of Bubble Sort studied in this assignment.
[5 bonus points (all or nothing)] Demonstrate the ability to implement all four variations of Bubble Sort studied in this assignment.
Assigned (to your group!) on 21 Feb 2017: Exercise[35].
Due by the end of day, Monday, 27 Feb 2017 (2 points).
Submit your work for the “Questions” and “Create Activity” sections of the exercise as follows: one member of your two- or three-person team should email the work for the entire team to: smeghashyam@vcstudent.org and sgonzalez@vcstudent.org, and copy: jspurgeon@vcstudent.org. The subject of the email message should be “Exercise[35]” (1 point). The names of the team members should be specified in the body of the email message (1 point).
If smeghashyam@vcstudent.org or sgonzalez@vcstudent.org is your email address, then Exercise[35] is optional for your team. You may choose to perform the exercise for a grade (which you will give yourself), or you may opt out of performing Exercise[34] itself. Instead of or in addition to performing the exercise, you must evaluate the work that other teams email to you. Meet with Mr. Spurgeon to discuss how to score the work of other teams and relay the scores to him.
Assigned (to your group!) on 13 Feb 2017: Exercise[34].
Due by the end of day, Thursday, 16 Feb 2017 (2 points).
Submit your work for the “Questions” and “Create Activity” sections of the exercise as follows: one member of your two- or three-person team should email the work for the entire team to: nkencke@vcstudent.org and jvxiong@vcstudent.org, and copy: jspurgeon@vcstudent.org. The subject of the email message should be “Exercise[34]” (1 point). The names of the team members should be specified in the body of the email message (1 point).
If nkencke@vcstudent.org or jvxiong@vcstudent.org is your email address, then Exercise[34] is optional for your team. You may choose to perform the exercise for a grade (which you will give yourself), or you may opt out of performing Exercise[34] itself. Instead of or in addition to performing the exercise, you must evaluate the work that other teams email to you. Meet with Mr. Spurgeon to discuss how to score the work of other teams and relay the scores to him.
Assigned (to your group!) on 2 Feb 2017: Exercise[33].
Due by the end of day, Wednesday, 8 Feb 2017 (2 points).
Submit your work for the “Questions” and “Create Activity” sections of the exercise as follows: one member of your two- or three-person team should email the work for the entire team to: mpande@vcstudent.org and jgodshalk@vcstudent.org, and copy: jspurgeon@vcstudent.org. The subject of the email message should be “Exercise[33]” (1 point). The names of the team members should be specified in the body of the email message (1 point).
If mpande@vcstudent.org or jgodshalk@vcstudent.org is your email address, then Exercise[33] is optional for your team. You may choose to perform the exercise for a grade (which you will give yourself), or you may opt out of performing Exercise[33] itself. Instead of or in addition to performing the exercise, you must evaluate the work that other teams email to you. Meet with Mr. Spurgeon to discuss how to score the work of other teams and relay the scores to him.
Assigned on Friday, 20 Jan 2016—Review the following topics in preparation for next week's final exam. Come to class on Monday prepared to ask any questions you may have about any of these topics. ALSO: IF YOU MISSED CLASS, FIND OUT FROM SOMEONE WHO WAS PAYING ATTENTION IN CLASS WHY THE GCD ALGORITHM MIGHT BE IMPORTANT TO YOU!
Donald E. Knuth and The Art of Computer Programming; tracing code by hand; problems, algorithms, and implementations; functions and methods, variables, parameters and arguments; objects, constructors, properties; while loops, for loops, and recursion; logical operators (&&, ||, !), bitwise operators (&, |, ~, ^, >>>, >>, <<), and mathematical operators (+, -, /, %), increment (++) and decrement (--) operators; arrays; the Math.random() method; output methods such as System.out.print and System.out.println; decimal to binary, binary to decimal, and binary to hex conversions.
Assigned on Monday, 12 Dec 2016—Study for test (moved to 4 Jan 2017 due to snow):
swap, flip, recursion, Josephus Problem, cycle-shift, tracing code by hand, logical and bitwise operators,
shift operators, while and for loops, arrays and ArrayLists, increment/decrement operators,
Math.random method, modulus operator, ...
Note the possible number of points for Exercise[27], which are broken down by category here.
Also note that the weighted contribution to your quarter grade of the points earned for Exercise[27] will be 0.3 times the number of points you earn out of a maximum of 320.)
Finally, note that quarter 1 ends next Wednesday, 9 Nov 2016. All work contributing to your quarter 1 grade must be submitted before then!
Use the Java or JavaScript "grader" code to preview the score your code will receive for Exercise[27].
When you are satisfied with your score, paste all of your Java or JavaScript code into the body of an email message with the subject "Exercise[27]" and send the message to jspurgeon@vcstudent.org.
Note that points will only be awarded for code that is sent to Mr. Spurgeon via email as described above. You may publish your code on a blog or save your code in a Google document, but only code sent to Mr. Spurgeon in the body of your email message will be graded! Furthermore, the code will be graded exactly as it is sent in the body of the message:
JavaScript code will be copied directly from the message, pasted into a Chrome command prompt, and then graded using the JavaScript grade function.
Java code will be copied directly from the message and pasted into a single file. The code will then be compiled and graded via the main method of the Java Grader class.
Assigned on Wed, 12 Oct 2016: Do Exercise[24] as follows: by the end of day Sunday, 16 Oct 2016, email the following information (or a link to a blog post containing the information) to jspurgeon@vcstudent.org with the text "Exercise[24]" in the subject of the message:
1 pt for following the above instructions exactly.
2 pts (bonus) for posting your answers on a blog.
40 points (total) for correct implementations of the methods that are missing code (Exercise[24].0).
10 points for a good answer to the question posed in Exercise[24].1.
30 points for a complete list of test cases. (Exercise[24].2).
In class on Tue, 11 Oct 2016: QUIZ (See Mr. Spurgeon if you want to retake the quiz!)
Assigned on Mon, 10 Oct 2016: Complete Exercise[22] by end of day Thrusday, 13 Oct 2016:
2 points: Email what you wrote, including your citation(s) to jspurgeon@vcstudent.org or (for 2 additional bonus points) publish them on a blog and email a reference to the blog post instead.
20 points for what you wrote.
10 points for following the citation instructions in the exercise and following MLA citation guidelines.
ALSO assigned on Mon, 10 Oct 2016: Do Exercise[23]. (QUIZ Tomorrow!) ALSO...
NEW: Read about the Java final keyword...
Pages 63 and 94 of your textbook (Barron's AP Computer Science A, 7th Edition by Roselyn Teukolsky)
REVIEW (and possibly NEW): read about recursion...
Pages 290-295 of your textbook
REVIEW (and possibly NEW): read about inheritance...
Pages 131-136
Assigned on Fri, 7 Oct 2016: Start working on Exercise[22]. (More details and an assignment to turn in will follow.)
Assigned on Thu, 6 Oct 2016: Compile and run the Java code presented in Ten Second Sketch: Then modify the code to make "Twenty Second Sketch!"
If you are having trouble figuring out how to complete the coding assignment associated with Exercise[20] that was assigned this past Tuesday and is due by end of day Saturday, 8 Oct 2016, then by reading the Java source code shown in the post you can see what one complete solution that satisfies all of the requirements of the coding assignment looks like! Your solution can be much simpler than this one, of course. I've intentionally provided an example that is a little more complicated than necessary to make peeking at an answer without first trying to solve the problem on your own a bit of work in and of itself.
If you think you completed the aforementioned coding assignment correctly, you can compare your work to mine to see how close or far off you might be to the type of solution that I had in mind when I issued the assignment. This not to say that your solution is wrong or won't receive full credit if it looks significantly different than the code used to implement Ten Second Sketch But if your code seems to be completely different in ways that are material to the requirements of the assignment, then you might want to verify that your work is acceptable before the due date.
Reading source code IS GOOD PRACTICE! The ability to read code, whether it is code you wrote yesterday, code you wrote a year ago, or code someone else wrote is a skill that every programmer needs to have, and you can't develop that skill without practicing.
Making a small change to code that someone else wrote and getting the code do something different IS GOOD PRACTICE, even if you don't completely understand all of the code that makes up the entire program.
Test yourself to see if you can identify the following types of coding constructs in the example, and try to answer the questions. You should do this because all of the items listed below and the questions associated with them are good candidates for a quiz or test, one of which will certainly be coming soon!
A method that is NOT intended to be used as a constructor function: Give an example of one and say something about the coding conventions associated with the identifier used to name the method. For example: Is the first letter of the method in uppercase or lowercase? What does "camel case" mean? Is there a difference between "camel case" and "Pascal case"? (According to whom?) What other names for different styles of capitalization do you know or can you discover? Does it matter whether JavaScript identifiers are written in lowercase, uppercase, or some combination of the two? Why? What's the difference between a function and a method?
Instances of Java keywords that specify primitive data types: How many distinct primitive data types can you find in the code? How many primitive data types does Java have? What are they?
A constructor function: How many constructor functions can you find? List them. What can you say about coding convension(s) that apply to the names of the constructors you listed?
An instance of an object created using a constructor function: How many objects can you find that were created using constructor functions and the keyword new? List them. What are some methods associated with these objects?
Two different styles of Java comments: Provide examples of instances of each type of comment. Are there additional ways you can write comments in Java? (What is a Java comment?)
An instance of a class that extends another class. What is the name of the superclass? What is the name of the subclass that extends the superclass? How do you define a method in a subclass in order to override a method in a superclass?
An instance of a parameter: What is the name of the parameter? What's the name of the method that is defined in terms of the parameter you identified? What's the difference between a parameter and an argument? What's the difference between a parameter and a variable? Are all parameters variables? Are all arguments variables?
An instance of an object that contains the value returned by the Java code System.currentTimeMillis(): What is the name one such object? If the variables x and y are both referring to objects returned by executing System.currentTimeMillis() at two different points in time, then what value is returned when JavaScript evaluates the expression x - y? Is the value positive or negative? Is the value a whole number or a floating point number? What primitive JavaScript data type is the value of the variable z if we set z equal to the value x - y, where x and y refer to values returned by System.currentTimeMillis()?
A keyword used to implement a loop (We haven't discussed this particular keyword in much detail yet, but you should be able to spot it and figure out what it does.): What is the keyword?
Review the work that you submitted for the two assignments assigned on Monday, 26 Sep 2016. You have until the end of day Saturday, 8 Oct 2016 to revise your submissions, which in addition to the original grading criteria will also be evaluated as follows:
First, if you submitted anything for the coding assignment assigned on 26 Sep 2016 on or before the original due date, you will be warded 5 bonus points for submitting something on time.
Second, if you published your work on a blog and did not also send me a copy of your work via email, you will receive no credit (other than the bonus points mentioned in the previous bullet) if I cannot access the URL you sent me. If I cannot access your blog, I will will let you know by replying to the email message you sent me. It is your responsibility to make sure that I can access your blog! (Note that you will not receive bonus points for publishing your answers on a blog if I cannot access the blog.)
Third, I will copy and paste code that you sent me or referred me to and test the code to make sure it runs without errors exactly as you have written it. If the code does not run, then you will receive no credit for the assignment other than the aforementioned bonus points.
Fourth, your code must be reasonably easy for me to read. (I reserve the right to define what is reasonable.) If you post your code on a blog and do not enclose the code in opening and closing pre tags (i.e. <pre> your code </pre>) then the code might be completely unreadable when displayed in a web browser; if that is the case, then you will get no credit for the assignment, even if the code runs without errors.
1 point: Submit the program you produced for step three (Exercise[20].3) of the exercise by emailing your code or a URL referencing your code to jspurgeon@vcstudent.org with the string Exercise[20] in the subject of the email. (Your submission must conform to these instructions exactly to receive the associated point.)
20 points will be awarded if and only if I can access and easily read your code, it runs without errors, and it does what the exercise says it should do.
2 bonus points will be awarded if you post your solution on a blogspot blog.
This assignment is due by the end of day, Saturday, 8 October 2016. (Do not expect to receive an extension this time! You have plenty of time to complete this assignment, especially if you to not procrastinate. See me early if you need help.)
Assigned and published on Mon, 3 Oct 2016:
Read Exercise[19] and consider heeding the advice going forward.
Read the Wikipedia article titled Retrospective. Note the relevance of retrospectives to software development.
By the end of Tuesday, 4 Oct 2016, send an email message to jspurgeon@vcstudent.org with the string Exercise[19] in the subject of the email. Include the following information in your message:
5 points: Tell me whether you feel like you are keeping up with the material presented in class or whether you feel like you are falling behind.
5 points: If you feel like you are falling behind, then tell me what you plan to do next as a result. If you feel like you are keeping up, then tell me what you would say to someone who feels like they are falling behind.
5 points: Tell me at least one thing that you would like me to stat doing that I'm not doing now, one thing that you want me to continue doing, or one thing that you think I should stop doing.
Exercise[18] - assigned on Fri, 30 Sep 2016 (more practice but nothing to turn in)
Exercise[17] - assigned on Thu, 29 Sep 2016 (something to practice but nothing to turn in)
Optional but recommended and assigned on Wed, 28 Sep 2016:
For an unspecified number of bonus points: Demonstrate mastery of some or all of the items under the sections Compose and Learn of Exercise[16].
Once you are satisfied with your answers, email them to jspurgeon@vcstudent@org with the string Exercise[16] in the subject of the email message. Only answers submitted to this email address with this information in the subject will be accepted.
DUE DATE: Bonus points will be awarded for answers submitted any time before the end of day on 31 October 2016.
Assignment assigned and published on Mon, 26 Sep 2016:
10 points (max) for your response to the prompt: Might someone someday owe their life to an algorithm that a) prevented a car crash and b) was influenced by GTA? How does this intriguing possibility affect your view of GTA?
One bonus point (up to at most 3 bonus points) for each good example provided in response to the prompt: What other examples of apparently “bad” technologies or uses of technology (computer-related technologies or otherwise) can you identify that have yielded or might yield “good” results?
One bonus point (up to at most 3 bonus points) for each good example provided in response to the prompt: What about the other way around? Do apparently good technologies sometimes go bad? Try to provide some examples.
2 points (max) for citing at least one source: one point for citing a source as part of your answer to the aforementioned prompts and one point for doing so per MLA (Modern Language Association) guidelines.
1 point if you submit your answer to jspurgeon@vcstudent.org by the due date with the phrase Exercise[14] in the subject of your email message, or
1 point plus 2 bonus points if you post your answer on a blogspot blog and send a URL referencing the post to jspurgeon@vcstudent.org with the phrase Exercise[14] in the subject of your email message.
DUE DATE: End of day (PST) Thrusday, 29 September 2016.
You are strongly encouraged to perform the numbered exercises in the Code Analysis section; however, you do not have to turn in your work for this particular portion of the assignment.
Do the required reading! Ask questions if you do not understand anything you read!
40 points: Complete the coding project. Ten (10) points will be awarded for each requirement specified in the unordered (bulleted) list at the end of the Coding Project section.
1 point if you submit your answer to jspurgeon@vcstudent.org by the due date with the phrase Exercise[15] in the subject of your email message, or
1 point plus 2 bonus points if you post your answer on a blogspot blog and send a URL referencing the post to jspurgeon@vcstudent.org with the phrase Exercise[15] in the subject of your email message.
DUE DATE: End of day (PST) Saturday, 1 October 2016.
Exercise[14] - assigned on Fri, 23 Sep 2016 (something to do but nothing to turn in)
Exercise[13] - assigned on Thu, 22 Sep 2016 (something to do but nothing to turn in)
IMPORTANT NOTE: An objective of this assignment is to practice following instructions. Continue reading carefully! . . .
Answers are due by the end of day, Thursday, 22 Sep 2016 (PST). Work submitted after the due date will be penalized one point per day the assignment is late. Corrected answers re-submitted after this assignment has been graded will not receive any additional credit, since this assignment is neither tricky nor difficult.
1 point: Email your answers to jspurgeon@vcstudent.org. Answers sent to any other email address will be penalized one point!
1 point: The subject of your email address must include the string "Exercise[12]". (I request but do not demand that this be the only string in the subject of the email: 1 bonus point if you satisfy this request!) Any submissions that do not include the string "Exercise[12]" in the heading will be penalized one point.
1 point: All answers must be submitted in the body of the email message, not as attachments to the message. Any submissions that do not follow these instructions will be penalized one point.
1 point: Regarding Exercise[12].2, tell me whether you were able to find any argument values that caused either the Java or the JavaScript version of pow to return a wrong answer. If you were, provide a list of the argument values that produced incorrect results. (1 bonus point for each distinct type of wrong return value you are able to produce using a pair of argument values. 10 bonus points max.)
1 point: What error did you find when you performed Exercise[12].3?
Answers are due by the end of day, Thursday, 15 Sep 2016, Pacific Standard Time (PST).
UPDATED on 15 Sep 2016 c. 9 AM: Work submitted after the due date will be penalized at the rate of ONE point per day the assignment is late. Corrected answers re-submitted after the assignment has been graded will receive half credit.
Please email your answers to jspurgeon@vcstudent.org with your name and the string Exercise[7] included in the subject of the email.
Answers are due by the end of day, Friday, 9 Sep 2016, Pacific Standard Time (PST). Answers must be submitted per the instructions in step 4:1 point for parts 1 and 2; 1 bonus point for part 3. No points will be awarded for work submitted after the due date.
Part 0 is due on Fri, 9 Sep 2016 at the start of class: 1 point for completion; 1 point for completion by the due date; 1 bonus point for completion on or before Thu, 8 Sep 2016 (start of class).
Parts 1 and 2 will not be scored but should be completed at your earliest convenience.