Home CPSC 240

Lab 3: 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	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 submit the Java code under the assignment in Canvas.

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

Copyright © 2022 Ian Finlayson | Licensed under a Attribution-NonCommercial 4.0 International License.