Post-7
- Review Modules 8 and 9. Include in
your review the parts we did not cover in class.
- Complete all in-class exercises in Modules 8 (from
10 onwards) and up through exercise 5 in Module 9.
Don't forget to upload these in BB.
- Suppose that x is any real number.
Define the sequence Yn as
follows, with Y5 as an example:
Here, the above example has n=5 terms.
Write a program called
YnSequence.java
to print out the value of Yn
when given fixed values of of n and x. Here is
a code template where n=5 and x=1.57:
In this case the resulting value should be approximately
(but not exactly) 1.0.
-
Write a program called
YnSequencePlot.java
that plots the value of Yn as
x varies between 1 and 7
in increments of 0.1.
Set the range to be
DrawTool.setXYRange (0,7, -2,2);
Don't forget that you need to have
DrawTool.java in
the same directory.
Do you recognize the function (one of the most
useful in science and engineering) depicted?
- Art project.
The screenshot below is the result of a simple
program written to use
DrawTool.java:
It uses three rather simple for-loops to draw the
above picture.
Write a program called
GeometricArtwork.java
to draw the above pattern.
Then, write a program called
BetterGeometricArtwork.java
that uses for-loops to draw your own artwork.
We'll impose the following rule: all your drawing
(of lines, ovals, whatever) must occur inside for-loops.
- Don't forget your reflection exercise!
Submission: For this assignment, we'll use Blackboard (BB)
for submission. Go to assignments and then
to post-7.
Upload all your Java programs in a single zip file.
Recommended, but not required:
This week we'll explore
computer security - the intersection of
computer science and, er, crime.
- Start by idly listening to
this video lecture entitled How cybercriminals steal money.
- Find some websites that explain cryptography. What is
a Caesar cipher?
- What is the Enigma machine and what was its role in
world history? What does this have to do with Alan Turing,
the person we read about a few weeks ago?