|
-
Oct 20th, 2001, 11:42 PM
#1
convert Java Class to VB Class
Please help me convert the following Java code into a VB class. All the functionality of the Java code must be incorporated within the VB class. Thank you very much!
class Student
{
private String Name; // Name of the student
private String Nationality; // Nationality of the Student
private double GPA; // Overall GPA owned by the Student
private boolean inAGroup=False; // Records whether a student is in a group or not
private String Group; // Group the student is assigned to
// Constructor to create a Student object
public Student (String aName, String aNationality, double aGPA)
{
Name = aName; // Set the Name for the Student
Nationality = aNationality; // Set the Nationality for the Student
GPA = aGPA; // Set the GPA for the Student
}
// Method to assign a Student to a Group
public void putInAGroup()
{
inAGroup=True; // Record Student's status in a Group as True
}
// Method to take student out of a Group
public void takeOutOfGroup()
{
inAGroup=False; // Record Student's status in a Group as False
}
// Method to change the Group a student belongs to
public void changeGroup(String newGroup)
{
Group = newGroup; // Set the Group the Student belongs to
}
// Method to get the GPA for a Student
public double getGPA()
{
return GPA; // Return the GPA for a Student
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|