![]() |
![]() Spring Semester 2009 |
This page describes the five assignments for the Java part of the course A290/A590 and A202/A598 second eight weeks spring 2009.
Assignment One:
Assignment Two:
- Write a program that asks the user for some information, processes some of that information and reports the result to the user. (Some examples will be given in class, to choose from. Here's one such example.) Below, some help with the decision process also the basic outline of how to read and classify numbers:
3.1 3.85 F D C B A 0------------------1------------------2------------------3------------------4 1.3 1.7 2.3 2.7 3.3 3.7 D+ C- C+ B- B+ A- 1.15 1.5 1.85 2.15 2.5 2.85 3.15 3.5 3.85 import java.util.*; class One { public static void main(String[] args) { Scanner joe; joe = new Scanner(System.in); double num; System.out.print("Enter a number: "); num = joe.nextDouble(); if (num >= 2) System.out.println("Pass"); else System.out.println("Fail"); } }- Write a program that draws scalable letters: that is, given a size specified by the user the program draws a pattern that resembles the lettter of your choice on a size by size grid. In this example my program draws scalable Z's.
Assignment Three:
- Write a program that receives information from the command line and processes it. Here are the details.
- Write a program that generates magic squares. Here's a complete description of what it needs to do.
Gain practice in modeling abstract concepts with classes and objects.Assignment Four:
- Define a class to model a Point in plane (each point has only two coordinates).
- Define a class to model a Line in plane (made out of points as defined above).
- Define a class to model a Triangle in plane (third coordinate of points irrelevant).
Assignment Five:
- Gain practice in creating and manipulating objects: read the details.
- Repeat the problem above where the input and output are files specified on the command line.
Compare and contrast: Introduction to Java GUIs and server-side Java programming.
- Implement a standalone version of the flag quiz as described in this document.
- Implement a Java servlet (or Java server page, JSP) version of the flag quiz.
The following topics are negotiable and entirely optional:
- Using JDBC to access a database from a Java servlet.
- Simple chat system using Java RMI, or servlets, applets and HTTP.
- Regular expressions, WebStart deployment, any other topics of interest to you.