CSC120-S: Computer Programming I
Prof. B. Rosenberg
Spring 2004 (042)
TR 3:05-4:20
Memorial Building, Room 300
Lab instructors:
Tushhim Bhattacharyya tushnim@mail.cs.miami.edu
Avishek Ghosal gavishek@lycos.com
Yuri Puzis lepota@bellsouth.net`
DX M 11:00-1:00, HX M 3:00-5:00, JY W 5:00-7:40 all in CC 426
Announcements
Administrivia
Class Notes
Example Programs
- Introduction to Java
- Assertions, Loop Invariants
- Introduction to Recursion
- Introduction to Objects
- Using Strings
- Arrays and Input
- Inheritance, Overriding Methods, Interfaces
- Graphical User Interfaces
- Review
- Prof. Duncan will review imperative programming and introductory
OOP the 20 and 22 of April.
- Threads
Assignments
- Due by the end of your first lab section:
- Read either chapters 1 and 2 in Pohl, or chapter 1 in Gosling.
- Install the software on your computer.
- Write, compile and run the HelloWorld program.
- Due 48 hours after the end of your second lab section:
- Write a SumOfOddIntegers.java
program that adds the first N odd integers
and prints the result. The variable N does not need to
be input.
- Write a program Fibonacci.java
that prints out the first N Fibonacci
numbers. Again, N does not need to be input
- Submit programs by leaving in your special directory.
- Additional information
- Write a program BaseConvert.java
that given an number converts it to binary and
to octal (base 8).
- Due at lab time - the lab instructor will be grading your projects during the lab..
- It is ok if the number in base 2 or 8 is written in the wrong
direction, least significant bit first ...
- The way it works is, if we are talking base given by the static
final int BASE, then:
digit = n % BASE ;
n = (n - digit)/BASE ;
until n is zero.
- Write the class PascalTriangle as discussed in class. See notes
- Write the class ReverseString which have the method reverseString which
takes one argument, a String, and returns a String with the letters in
reverse order. So reverseString("abc") will return the string "cba".
- Improve the class ArraySwap to do Insertion Sort. (To do at the first lab after the break.)
- Improve the class LinkedListNode and LinkedListIntNode to do
search. Due by Wed 31.
- Improve the interface example of LinkedList to do selection sort.
(You will have to write a findMax method in LinkedList, then use
this, with delete from the original list and inserAtHead on a new
list, to implement the selection sort.)
Due W April 7.
- Write the number guessing program, problem two on the
sample midterm.
- Write a GUI program like MySecondButton
- extra credit, or whatever If you want more practice
with GUI programming, try to write a program like
TurtleOneStep
Resources