Home CPSC 240

Lab 4: Writing a Class

 

Objective

To work on coding a class based off a UML diagram


 

Task

For this lab, you will be writing the Java code for the class that you made the UML diagram for last lab. Pull up your diagram and base the Java class off of that.

A few notes on the implementation of the methods:


 

Testing

You can use the Main.java file to test your program. You might have to change your method names slightly to work with this (but please do so, cause that's how I'll grade your lab).

Here is an example run:

$ java Main
Alice, Johnson	1	0.00	0
Bob, Williams	2	0.00	0
Claire, Smith	3	0.00	0

Alice, Johnson	1	2.28	124
Bob, Williams	2	2.36	122
Claire, Smith	3	2.16	117
Alice can graduate.
Bob can graduate.
Claire CAN'T graduate.

 

Submitting

When you are done, please email your Java code to ifinlay@umw.edu. You don't need to send the main file to me.

Copyright © 2019 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.