Netprog-Java
Spring 2001

Homework 1
Due Date: Monday, Jan 15th (by 11:59PM)

Submit to javanetprog-submit@cs.rpi.edu with the subject line "1"
Complete Submission instructions are here


This homework involves the development of some relatively simple Java programs and classes. The main reason for this homework is to make sure that everyone is able to get a Java compiler running and to write some simple programs. Please contact us at javanetprog@cs.rpi.edu if you have problems!

Question 1: Simple Java Program

Write a program (a Java class with a public static void main method) named "repeater" which takes which takes a number and a word on the command line, and then prints out the given word that number of times. Here is an example of what it should look like when we run your program:
 
      $> java repeater 5 hi
      hi
      hi
      hi
      hi
      hi
 
      $> java repeater hi 5
      Error: Usage: java repeater number word
You should be using the classes: java.lang.String, java.lang.Integer, and java.lang.NumberFormatException


Question 2: Simple Java Classes and Interfaces