Home CPSC 240

Lab 5: Student Class

 

Objective

Implement a class containing static methods.


 

Task

For this lab, you will write a class called "Student". It should have the following instance variables:

It should also have one static class variable. Remember these are shared amongst all instances of a class:

It should also have the following methods:


 

Testing

You can use the StudentMain.java file to test your program.

Here is an example run:

Alice, Johnson	1000	0.00	0
Bob, Williams	1001	0.00	0
Claire, Smith	1002	0.00	0

Alice, Johnson	1000	2.03	107
Bob, Williams	1001	1.96	120
Claire, Smith	1002	2.46	130

Alice CAN'T graduate.
Bob CAN'T graduate.
Claire can graduate.

 

Submitting

When you are done, please submit the Java code under the assignment in Canvas.

You only need to submit the Student.java file, not the Main.java one.


 

Solution

A solution to this lab can be found in Student.java.

Copyright © 2024 Ian Finlayson | Licensed under a Creative Commons BY-NC-SA 4.0 License.