Monthly Schedule

(AP Computer Science A, Period F)

W 9/5/012

First day of class.

 

Th 9/6/012

HW due:

1. Download a Java IDE (integrated development environment) for your computer. Mr. Hansen uses jGRASP, but you may use whatever you wish.

2. Send Mr. Hansen an e-mail message. Remember to put a double underscore ( __ ) at the start of your subject line.

3. Download the .PDF version of the Blue Pelican Java textbook. (Do a web search to find it.)

 

F 9/7/012

HW due:

1. Numerous people must have sent messages without a double underscore ( __ ) in the subject line, because I did not receive 7. Please check your “Sent Mail” folder, and re-send if necessary with the proper subject line.

2. If you have not already downloaded and installed an IDE, do that.

3. Write and execute a “Hello, world!” program in Java.

4. On a piece of paper, write down several random hex addition problems. Show your work (including the carries). Then check your answers for accuracy by using the Windows calculator in “programmer” mode.

 

M 9/10/012

HW due:

1. Quickly skim through Lesson 1 and Lesson 2 to make sure you already understand everything there. If there is anything that looks unclear or unfamiliar, then read the lessons word for word, and do the project on the lower half of p. 1-3, plus the following exercises on p. 2-3: #3, 5, 8, 10. If you skip over this portion of the HW assignment, that is OK, but note that in so doing, you are asserting that you already completely understand Lessons 1 and 2.

2. Read Lesson 3. As you read, perform all the examples given in the text. For example, when the text says that myPet.substring(4,12) returns ky the d, don’t simply take the author’s word for it. You need to actually write a line of code, add a println statement, and check to make sure that the example is correct as posed. Throughout the year, bonus points will be provided for students who spot errors in the examples.

3. Write out answers to the following exercises in Lesson 3: #1, 4, 5, 6, 7, 10.

Note 1: It is perfectly acceptable to use your computer to help you answer these exercises. That is not cheating. However, it is more educational if you make a guess first (if possible) and then use the computer to verify that you were correct.

Note 2: You may need to do some additional research, either online or in the appendices of your text, in order to answer some of the questions. Be resourceful! This is the 21st century, and you are expected to use the resources at your disposal.

 

T 9/11/012

HW due: Read Lesson 4; write #1, 6, 7, 10, 11, 13. Remember to write down a “GUESS” and label it as a guess before you run the code snippets.

 

W 9/12/012

HW due: Read Lesson 5; write #6, 7, 8. Be sure to write down your guess for #8 before you do it.

 

Th 9/13/012

HW due: Read Lessons 6 and 7; write #1-4 and 13 in Lesson 6. Then do the additional problems below.

A1. Let exp(x) denote the natural exponential function, namely exp(x) = ex, for any real number x. It is a mathematical fact that for any positive number q and any real number r, the expression qr can be rewritten as exp(r ln q). Prove this fact.

A2. Use the result of A1, regardless of whether or not you were able to prove it, to answer #4 in Lesson 6 a different way, without using Math.pow. You may have to do a little bit of research. (Not much, though.)

 

F 9/14/012

Form VI retreat (underclassmen report to class as usual).

 

M 9/17/012

HW due: Read Lessons 8 and 9, and write the following exercises.

Page 7-3, “Going in Circles” project, with the modification that we will use the ellipse area formula given in class last Thursday. You will need more than one prompt, obviously. The first prompt should ask for the area, as shown in boldface in your text. The second prompt should ask for one of the semiminor axis lengths. The output will be the other semiminor axis length.

Page 8-4 #6, 10, 11.

Page 9-3 #1-12 all. For #1-10, note the general code at the top of the page. Be sure to write down your guess for the result in each case! (Label it as “GUESS.”) Then, run the line of code to see if you were correct. This is a tremendous learning opportunity. Don’t “shortcut” your learning by omitting the guessing step.

 

T 9/18/012

HW due: Read Lessons 10 and 11, and write the following exercises:

Page 10-4 #4, 6, 7, 8.

Page 11-5 #9, 11, 13. (Note: Be sure to write a GUESS for #9 and #11 before you execute the code.)

 

W 9/19/012

HW due: Read Lessons 12 and 13, and write the following exercises:

Pages 12-3 and 12-4 #3, 4, 7, 8, 9.

Page 12-5 #1-5 all.

 

Th 9/20/012

HW due: Read Lesson 14 and write the following exercises:

1. Write code that determines the ASCII codes for each of the letters of your 3 initials.

Pages 13-4 and 13-5 #6, 8-19 all, 24.

 

F 9/21/012

HW due: Read Lesson 15 and write the following exercises:

Pages 14-5 and 14-6 #4, 5, 9, 26, 29.

Page 15-5 #1-5 all, 7, 8, 10.

 

M 9/24/012

HW due: Start working on the following review problems. All you have to show for today is evidence that you made a solid start. These problems are due in full on Tuesday.

1. Write a short paragraph explaining the difference between a 2GL and a 3GL.

2. How many bytes are in the following data? How many words? How many dwords? How many qwords?

0x419085398390599F98A98934320000A00C984329B90BACF0039E09341E31987FD913BE2401030ABA

3. Explain briefly why the letter T means “trillion” when used with Hz (as in THz) or bps (as in terabits per second) but generally means something different when used in the abbreviation TB. What does T mean in that context?

4. Write a short “headline bio” (just a few words) for each of the following famous computer scientists: Grace Hopper, Alan Turing, Claude Shannon.

5. Write (in pencil) a “Hello, World” class from memory, with all syntax and semicolons correct. Then type it in and see if it compiles and runs correctly on the first try.

6.(a) What is produced?

     System.out.println(8 – 5*6/3 + (5 –6)*3);

  (b) Explain briefly why the 5 and –6 in part (a) are not multiplied together.

7. Explain what is meant by the symbol %= (percent sign followed by equal sign), and use that symbol in a meaningful way in a short code segment. Comments are required!

8.(a) Write a short program that uses a boolean variable b to determine whether 7.0/2 equals 3.5.
    (b) Explain why logic of the sort used in part (a) is dangerous and should generally be avoided.

9.(a) Explain what is meant by overflow.
    (b) Underflow is a condition that affects floating-point representations of numbers. Explain briefly how underflow can manifest itself as “division by zero” errors.

10.(a) Using pencil and paper only, add the following numbers in hex, showing all work and giving answer in hex. When finished, convert the answer to decimal (base 10).

 0x78
+0x3F


    (b) Repeat the problem using Java code only. Your program should work with the addends in hex, and then it should give answers in both hex and base 10.

11. Write a short code example that illustrates a division answer that is “wrong” until a typecast is used. Comment your code.

12. Do the “Compute This” project on p. 6-4.

13. Write p. 8-4 #8.

14.(a) What is the meaning of p. 8-4 #17?
    (b) Rewrite p. 8-4 #17 in an equivalent but more readable form by adding redundant parentheses.
    (c) Is p. 8-4 #17 a tautology? Why or why not?

15. On p. 10-5 do the “Weight on Other Planets” project two ways: once with a switch as requested, then a second time using if statements only.

16. Do the “What’s That Diameter?” project on p. 15-4.

17.(a) Using a for loop, compute the square roots of the first 15 nonnegative integer powers of 2.
    (b) Repeat part (a), using a while loop.
    (c) Use any loop logic you wish to create an ASCII table for character values 65 through 122. Your program output should begin as follows, and the single quotes should be included in the output:

'A' = character #65
'B' = character #66
. . .

18. Write code that stores the string "Computer science is educational and moderately fun" into a String variable and then uses appropriate indices to concatenate the second, fifth, and seventh words with hyphens between them.

 

T 9/25/012

HW due: Finish your review problems.

In class: review.

 

W 9/26/012

Test (100 points) on all material covered so far. This test will be pencil-and-paper only (no calculator, no computer, no notes), not for reasons that make a great deal of sense, but merely to get you in the groove for the AP exam.

 

Th 9/27/012

HW due: Finish your mini-project from yesterday’s test. Please compile and run your code so that you can be sure that it works correctly. A hard copy is not required, but please have your revised and debugged code ready for inspection.

Also, if you wish, you may “revise and extend” your unfinished problems from yesterday’s test. Mr. Hansen will look at whatever you produce and will apply a murky, proprietary, essentially unfathomable procedure to arrive at a composite grade based on what you did in class and what you did at home.

 

F 9/28/012

HW due: Read Lesson 16; on p. 16-6, write out thoughtful answers to #6, 7, 8, 9, 10, 11, 13.

In class: Ask-Backward Bingo.

 

 


Return to the CSA Zone

Return to Mr. Hansen’s home page

Return to Mathematics Department home page

Return to St. Albans home page

Last updated: 12 Feb 2013