Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Chapter 3 
Lab 4 
Exercise 12 – Page 174  
 
Instructions: 
 
Part a 
 
Make sure that when you create your variables the first letter of the variable name is in 
lowercase.  For example: “int studentID”.   
 
Name your mutator methods set plus the name of the variable.  The first letter of the variable 
should be upper case.  For example: “public void setStudentID(int id)”.   
 
Name your accessor methods get plus the name of the variable.  The first letter of the 
variable should be upper case.  For example: “public int getStudentID()”.   
 
This will make it much easier later when you learn how to use the IDE to create these 
methods automatically.   
 
Part b 
 
Follow the instructions in the book. 
 
Part c 
 
In this class you should only need to create the object, call the gpa calculation routine and 
then display the variables.  There is no need to specifically assign each variable a value as 
that should be done in the class constructor.   
 
For this program I want you to turn in three files 
 Student.java with the constructor created in part c 
 ShowStudent.java 
 ShowStudent2.java 
 
Sample Output: 
 
Part b 
 
 
 
 
Part c 
 
 
 
Grading: 
 
2 – General, compiles, comments, proper indentation, etc 
2 – Class fields 
2 – Mutator Methods 
2 – Accessor Methods 
2 – GPA Method 
2 – ShowStudent class 
2 – Student Constructor