CS3101-3: Programming Languages: Java
Homework 2
Reading: Java in a Nutshell, chapters 2 & 3
DUE: Tuesday, Sept 23, 11PM
Goal:
1. Define a Class to represent a physical computer. The Class should be called Computer.java
include the folowing fields for representing the following characterisics of a computer:
Remember to choose the most logical class to reperesent the data.
Field Name | Values |
Name | Unique Name of this computer. |
Model | Laptop|Desktop|Server|Unknown |
Speed | This is in MHZ, example 200, 1000, etc |
Operating_System | Windows98|Window2000|Linux|OpenBSD|MAcOS|Amiga|XBox |
Memory | Amount of RAM on Machine |
Make | Dell|Sony|Hp|Gateway|SUN|OTHER |
Screen_Size | size of screen |
Hard_Drive_Size | size of hard drive in gig |
2. Write a small program called Network.java which creates a few computer objects,
sets up information on each of them, tests if any of the machines are equal, then prints out the information about them.
3. Compile and run the program (Step 2), and submit proof of its
functioning. You can do this either by submitting a
screenshot or a "journal", "script", or "typescript"
log (on Unix):
$ journal
Log started
$ <run your program here>
<program output>
$ exit
Journal ended
(If "journal" doesn't work on your system, try script or
typescript insteaad -- they all work roughly the same way.)
4. Follow the homework submission instructions on the class
homepage!
Good Luck.