Question: Java code edit/correction: I need someone to correct the code below so it compiles correctly into Jgrasp exactly as typed, ( I am a beginner
Java code edit/correction: I need someone to correct the code below so it compiles correctly into Jgrasp exactly as typed, ( I am a beginner and trying to learn). I will put the sample output of what it should display directly below this description. I have additional information on program requirements if needed (simply comment for additional information). In addition, if it's not too much trouble, please comment throughout the code, so I can better learn what each part is doing. Thank you for your time!

Sample Code
Main.java
-----------------------------------------
package com.school;
import java.io.IOException; import java.io.PrintWriter; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.List;
import javax.swing.JFrame; import javax.swing.JOptionPane;
public class Main { public static void main(String[] args) { StudentLogic studentLogic = new StudentLogic(); JFrame frame = new JFrame("Student Details"); Student student = new Student(); while(student.getFirstName()==null || student.getFirstName().equals("")){ student.setFirstName(JOptionPane.showInputDialog( frame, "Enter the first name ", JOptionPane.WARNING_MESSAGE )); } student.setFirstName(JOptionPane.showInputDialog( frame, "Enter the last name ", JOptionPane.WARNING_MESSAGE )); student.setTermAndYear(JOptionPane.showInputDialog( frame, "Enter the term/year ", JOptionPane.WARNING_MESSAGE )); student.setNoOfClasses((Integer.parseInt(JOptionPane.showInputDialog( frame, "Enter the no of courses", JOptionPane.WARNING_MESSAGE )))); Course course; ArrayList } catch (IOException e) { // do something } } } ---------------------------------------------- Student.java ------------------------------------------------- package com.school; import java.util.ArrayList; public class Student { private String firstName; private String lastName; private String termAndYear; private int noOfClasses; private ArrayList public Student(String firstName, String lastName, String termAndYear, int noOfClasses, ArrayList public double getGpa() { return gpa; } public void setGpa(double gpa) { this.gpa = gpa; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getTermAndYear() { return termAndYear; } public void setTermAndYear(String termAndYear) { this.termAndYear = termAndYear; } public int getNoOfClasses() { return noOfClasses; } public void setNoOfClasses(int noOfClasses) { this.noOfClasses = noOfClasses; } public ArrayList ------------------------------------------------------------ Course.java -------------------------------------------------------------- package com.school; public class Course { private String courseDesc; private double credit; private double grade; public String getCourseDesc() { return courseDesc; } public void setCourseDesc(String courseDesc) { this.courseDesc = courseDesc; } public double getCredit() { return credit; } public void setCredit(double credit) { this.credit = credit; } public double getGrade() { return grade; } public void setGrade(double grade) { this.grade = grade; } public Course(String courseDesc, double credit, double grade) { super(); this.courseDesc = courseDesc; this.credit = credit; this.grade = grade; } public Course() { } } -------------------------------------------------------------- StudentLogic.java -------------------------------------------- package com.school; import java.text.DecimalFormat; import java.util.ArrayList; public class StudentLogic { public double gpaCalculator(ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
