Computer Science 201


Pre-2006 Computer Science 201 Web Page


Today's files are BIG. Consider a flash drive.

JAVA
HIST

JAVA HISTORY

You'll find the history of Java to be fascinating. Did you know that the original designer of Java was James Gosling from Calgary, Alberta?

Pop on your earphones and watch and listen to the following flash presentation on the: History of Java from PublicStaticVoidMain.

CLICK HERE TO INSTALL JAVA & ECLIPSE

Vista Users Take Note: You may have to run Eclipse as an Administrator. Right Mouse Click on "eclipse.exe" → Run As Administrator → Run → Allow. There may be a better permanent solution as discussed on EclipseZone or tell the program to always run as an administrator as explained on Vista Forums.
TaskTopicResourcesAssignments

1

Create First Java Program

Horstmann Chap 1

Kjell Chaps 5 6 7

Sedgewick Chap 2.1

Litvin Chap 2-GUI

Deitel Chap 2

Horstmann 1

Deitel 2

Wu 2

King 2

HelloTester.java

Study Horstmann's Introduction: Chapter 1.

Code, Compile & Execute HelloTester.java p 17

Programming Exercises To Be Graded (pp 30-31): P1.2, P1.4, P1.6, P1.8.

Make a project for each chapter. Make a package for each exercise within the chapter's project. Place all classes related to the exercise within the package.

Initially, as in this chapter, an exercise may be solved using only one class; thus there would be only one class in a package. In later chapters,however, there are multiple classes in a program that solves an exercise problem. In that event, all classes in such a solution would be in the same package. Here is how to do it.

For each exercise, submit a printed copy of a wordprocessing document containing:

  1. Footer
  2. Java source code following Horstmann's Styling Guide
  3. Identification Header
  4. Screen Dump
  5. Print on both sides of a sheet of paper, two pages per side == four pages per sheet of paper. See Make Hard Copy of Source Code.

Follow these directions to place line numbers with source code in Eclipse and later in WORD.

Follow these directions on organizing assignments when working with Eclipse.

TaskTopicResourcesSlide ShowAssignments

2

Using Objects

Horstmann Chap 2

Kjell 25 26 27

Sedgewick Chap 3

Litvin Chap 3

Deitel Chaps 8 9

Horstmann 2

Wu 4

King 3

MoveTester.java

Study Horstmann's Using Objects: Chapter 2.

Learn about methods by studying the Methods Tutorial [csg] [web] retrieved from the web site of North Carolina teacher Ruth Hartsook. See two frames from her tutorial below.

A method's signature includes it's name and parameter list but not its return type.

The reason that the data type of a method is not part of its signature is because a method can be called without specifying the data type of its return value. Thus, given a situation whereby several methods are overloaded with the same method name and parameter list, the compiler would not know which method to call.

In the following example, if the return type were the only distinction between several methods of foo( ) which differed only in terms of the data type of the return value, then the compiler wouldn't know which method to call because the invoking line does not specify the data type of a return value.

The following method is legal but does not indicate the return data type.

foo( ) ;

Programming Exercises To Be Graded (pp 59-61): P2.2, P2.4, P2.6, P2.8, P2.10 For each exercise, submit a printed copy of a wordprocessing document.

TaskTopicResourcesSlide ShowAssignments

3

Implementing
Classes

Horstmann Chap 3

Kjell 25 26 27

Sedgewick Chap 3

Litvin Chap 3

Deitel Chaps 8 9

Horstmann 3

Wu 4

King 3

Litvin 4

BankAccount.java BankAccountTester.java
CashRegister.java CashRegisterTester.java

Study Horstmann's Implementing Classes: Chapter 3.

Learn about encapsulation by studying the Encapsulation Tutorial [csg] [web] retrieved from the web site of North Carolina teacher Ruth Hartsook. Links to source code for this tutorial follows.

Student.java TwoStudents.java MyStudents.java

Create and automatically generate an ID template. You only need one ID template per program. Do not attach an ID Template to every class. Attach the ID Template only to the class containing the public static void main(String[] args) method, since it is the first line of this method where the program begins to execute. But do indeed attach a Javadoc comment to every other class describing the purpose of the class.

Click here to see how a method can return multiple values by returning an object containing values of multiple instance variables!!

Click here to see pros and cons about whether instance variables (aka "fields of a class") should be declared at the top or bottom of a class.

Programming Exercises To Be Graded (pp 98-100): P3.2, P3.4, P3.6, P3.8, P3.10, P3.12, P3.14 For each exercise, submit a printed copy of a wordprocessing document.

TaskTopicResourcesSlide ShowAssignments

4

Fundamental
Data
Types

Horstmann Chap 4

Kjell 8 9A 9B 10

Sedgewick Chap 2.2

Litvin Chap 6

Deitel Chap 2 3

Horstmann 4

Wu 3

King 3

Litvin 4

CashRegister.java CashRegisterTester.java InputTester.java

Study Horstmann's Fundamental Data Types: Chapter 4.

Learn about reading input and writing output using Java's Scanner class by reading the following Java's Scanner Class Overview [csg] [web] retrieved from the web site of North Carolina teacher Ruth Hartsook. Note that the overview is done in Flash. You may copy and paste code from the examples after clicking the capital "I" at the top of the screen, just to the right of the hand icon.

For more more explanation of Primitive Data Types and special "escape characters", read Kjell's Tutorial 8.

For more more explanation of the Scanner class, read Kjell's Tutorial 10.

Read about understanding the problem with double arithmetic in Java, solving the double problem with the BigDecimal class, creating BigDecimal objects and doing arithmetic with BigDecimal objects in a bonus chapter, Using the BigDecimal Class [csg] [web], from Java All-in-One Desk Reference For Dummies (2nd Ed) ISBN: 0470124512 by Doug Lowe and Barry Burd (Wiley Publishing, Inc, 2007). Here is the source code of the examples:   BigDecimal Examples.

Javadoc Comments

  1. Give a Javadoc comment describing the purpose of every class.

  2. Give a Javadoc comment describing the purpose of every constructor.

  3. Give a Javadoc comment describing the purpose of every method.

  4. Give the Javadoc tag @param for every paramenter of all constructors and methods.

  5. Give the Javadoc tag @return for all methods. Note that constructors do not have return statements.

Though you do not need to know how to create Javadoc files at this point, you may learn how to do so by studying the tutorials in Learn Javadoc.

Programming Exercises To Be Graded (pp 144-148): P4.2, P4.4, P4.6, P4.8, P4.10, P4.12, P4.14, P4.16, P4.18. For each exercise, submit a printed copy of a wordprocessing document.

TaskTopicResourcesAssignments

*

Eclipse
Workbench

Follow and implement the lessons and activities of Mark Dexter's six 15-minute tutorials of Using the Eclipse Workbench [csg] [web]

Refer to this Tutorial Companion Guide [pdf].
Refer to this Eclipse Project For Lesson 1.
  1. Workbench Layout, Views & Perspectives
  2. How to Arrange Views & Views Options
  3. Use & Customize Eclipse Perspectives
  4. Help Features & Navigation Tips & Tricks
  5. Key Assist & Keyboard Shortcuts
  6. Compare Editor, Restore Deleted Files
TaskTopicResourcesAssignments

*

Number
Systems

FILLER FILLER FILLER
TaskTopicResourcesSlide ShowAssignments

5

Programming
Graphics

Horstmann Chap 5

Kjell 36 37 38

Litvin Chap 15

Deitel Chap 11

Horstmann 5;

King 6

Litvin 14

RectangleApplet.html RectangleApplet.java RectangleAppletExplained.html
Car.java CarComponent.java CarViewer.java
ColoredSquareComponent.java ColorViewer.java
EmptyFrameViewer.java
IntersectionComponent.java IntersectionViewer.java LabeledPoint.java
RectangleComponent.java RectangleViewer.java

Study Horstmann's Programming Graphics: Chapter 5.

Programming Exercises To Be Graded (pp 186-187): P5.2, P5.4, P5.6, P5.8, P5.10, P5.12, P5.14, P5.16. For each exercise, submit a printed copy of a wordprocessing document.

TaskTopicResourcesAssignments

*

LISP

FILLER FILLER FILLER
TaskTopicResourcesAssignments

6

Decisions

Horstmann Chap 6

Kjell 12 13 14

Sedgewick Chap 2.3

Litvin Chap 7

Deitel Chap 4

Horstmann 6

Wu 5

King 4

Litvin 7

Earthquake.java EarthquakeTester.java
TaxReturn.java TaxReturnTester.java

Study Horstmann's Decisions: Chapter 6.

Pay particular attention to the use of Boolean expressions, pp 213-219, noting that using two Boolean operators such as && or | | short circuits the evaluation whereas using a single Boolean operator such as & or | always evaluates both operands.

Peruse interesting presentations of Boolean Expressions and Short-circuit Operators and Truth Tables and De Morgan's Rules by Bradley Kjell.

Programming Exercises To Be Graded (pp 225-229): P6.2, P6.4, P6.6, P6.8, P6.10, P6.12, P6.14 and P6.16 but not P6.18. For each exercise, submit a printed copy of a wordprocessing document.

TaskTopicResourcesAssignments

*

Mathematical
Recursion

FILLER FILLER FILLER
TaskTopicResourcesAssignments

7

Iteration

while Loops

for Loops

Nested Loops

Sentinel Values

Random Numbers
& Simulations

Horstmann Chap 7

Kjell 15 16 17 18 19 20 39 40 41 42 43 44

Sedgewick Chap 2.3

Litvin Chap 8

Deitel Chap 5

Horstmann 7

Wu 6

King 4

Litvin 11

DataSet.java InputTester.java
Investment.java InvestmentTester.java
Investment2.java InvestmentTester2.java
Die.java DieTester.java
Needle.java NeedleTester.java
Triangle.java TriangleTester.java

Learn about using the traditional "for loop" in Java by studying the following For Loop Tutorial [csg] [web] retrieved from the web site of North Carolina teacher Ruth Hartsook.

Learn about for loops by studying the For Loops Tutorial [csg] [web] retrieved from the web site of North Carolina teacher Ruth Hartsook.

Observe an example of the sequence of changes in values with nested loops in the following Nested Loops Demonstration [csg] [web] retrieved from the web site of North Carolina teacher Ruth Hartsook.

Learn to follow and trace the flow of execution through the following Nested Loop Demonstration [csg] [web] retrieved from the web site of North Carolina teacher Ruth Hartsook.

Study Horstmann's Iteration: Chapter 7.

Study Eck's Programming in the Small II Control for a traditional, easy to understand, treatment of loops and branching statements.

Programming Exercises To Be Graded (pp 270-275): P7.2, P7.4, P7.6, P7.8, P7.10, P7.12, P7.14 and P7.16 but not P7.18. For each exercise, submit a printed copy of a wordprocessing document.

Why Study Arrays Independently Before Studying Java's Array List Class?

*

Arrays
and
Array
Lists

Kjell 46 47 48 49A 49B 49C 49D

Sedgewick Chap 2.5

Litvin Chap 12

Deitel Chap 7

Horstmann 8

Wu 10

King 5

Litvin 12 12½

Study the Kjell chapters: 46 47 48 49A 49B 49C 49D

Do all the exercises and quizzes associated with the Kjell chapters on arrays.

Programming Exercises To Be Graded: 46 [1-5], 47 [1-5 ], 48 [1-3], 49B [1-3]. 49C [1-9] and 49D [1-3]. For each exercise, submit a printed copy of a wordprocessing document.


[Counter On Strike [Home of Gerry Donaldson's Com Sci Gate]
[Gerry Donaldson's Email Address]
gerry@comscigate.com
[EFC Blue Ribbon - Free Speech Online]

On the Internet Since March 9, 1996    URL:   http://www.comscigate.com    Last Revised:   February 17, 2006.