61b_hw1 - 01/23/09 04:29:03 CS 61B Homework 1 Due 5pm...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
01/23/09 04:29:03 1 readme CS 61B Homework 1 Due 5pm Wednesday, January 28, 2009 This homework assignment is meant to make sure you can write, compile, and run simple Java programs. This is an individual assignment; you may not share code with other students. You will need to know how to compile and run Java programs, as described in Lab 1. Copy the Homework 1 directory by starting from your home directory and typing the following: cp -r $master/hw/hw1 . cd hw1 Problem 1 --------- Write a program that reads a String from the keyboard. The program should then construct a URL for http://www.X.com/, replacing X with the String read in, and print the first five lines of the Web page at that URL in REVERSE ORDER; i.e., the fifth, fourth, third, second, and first lines. We’ve already created a skeleton for you in the file OpenCommercial.java; you just need to fill it in. Use the println method to print each of the five lines, so that there’s a carriage return at the end of each line. To receive credit for this problem, you must follow these directions exactly:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online