In: Computer Science
Java: Translate the Student class from the code provided to UML, e.g.,
-----------------------------_
| Student |
------------------------------
| -lastName: String |
| -firstName: String |
-----------------------------
Java Code:
public class Student {
private String lName;
private String fName;
private int age;
private double gpa;
public Student(String lname, String fname, int age, double gpa);
public String lname();
public String fname();
public int age();
public double gpa();
public String toString()
{
return lName+ " " + fName+ " " + toString(age) + " " + toString(gpa);
}
public static void main(String[] args) {
}
{
UML Diagram of that program your are given
public class Student {
private String lName;
private String fName;
private int age;
private double gpa;
public Student(String lname, String fname, int age, double gpa);
public String lname();
public String fname();
public int age();
public double gpa();
public String toString()
{
return lName+ " " + fName+ " " + toString(age) + " " + toString(gpa);
}
public static void main(String[] args) {
}
{
convert UML Daigram
Explanation:-This is a class diagram consists of class and interface have a class student contain 4 variable(lname,fname,age,gpa)all variable contain Public class to all variable and last column contain method lanname,fname,age,gps,string to string to call all the value of variable.