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:

  1. 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");     
      } 
    } 
  2. 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 Two:
  1. Write a program that receives information from the command line and processes it. Here are the details.
  2. Write a program that generates magic squares. Here's a complete description of what it needs to do.
Assignment Three:
Gain practice in modeling abstract concepts with classes and objects.
  1. Define a class to model a Point in plane (each point has only two coordinates).
  2. Define a class to model a Line in plane (made out of points as defined above).
  3. Define a class to model a Triangle in plane (third coordinate of points irrelevant).
Assignment Four:
  1. Gain practice in creating and manipulating objects: read the details.
  2. Repeat the problem above where the input and output are files specified on the command line.
Assignment Five:
Compare and contrast: Introduction to Java GUIs and server-side Java programming.
  1. Implement a standalone version of the flag quiz as described in this document.
  2. Implement a Java servlet (or Java server page, JSP) version of the flag quiz.

The following topics are negotiable and entirely optional:


Updated by Adrian German for A202/A598