CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Threaded View

  1. #1
    Join Date
    Mar 2012
    Posts
    5

    java.lang.NullPointerException error confusion

    Hi all, first post here. I am in a college programming course and have hit a slight roadblock. Attached you will see StudentDriver, Student, and Course. StudentDriver was code that the professor wrote that we are not supposed to edit in any way. Student and Course were provided to us and they had many unimplemented methods that needed to be implemented. I can not figure out why I am getting this error:

    Exception in thread "main" java.lang.NullPointerException
    at Student.calculateGpa(Student.java:37)
    at Student.merge(Student.java:139)
    at StudentDriver.main(StudentDriver.java:18)

    Everything compiles fine. When I run the StudentDriver, it prompts me to "Please enter the file with the courses taken:", which works fine, and than "Please enter the file with the current courses.", which also seems to be work, but after I enter both files that error pops up.

    Thanks in advance.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured