Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I need help with constructors and methods.  RSS feed

 
Adam Classified
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am learning Java for my job. It is my first programming experience.
The program I am to write will store course and grade information for a student. Information for up to 10 courses will be input and stored for a single student. The GPA will be calculated based on the course information stored for the student.
The program will consist of three class files: Course.java, Student.java, and StudentCourses.java

Here is the UML for class Course.java
Course
-crsID : String
-crsNum :Integer
-crsSection :Integer
-crsHours :Float
-crsGrade : String
<<Course>>
+getCrsId () :String
+getCrsNum () : Integer
+getCrsSection () :Integer
+getCrsHours () :Float
+getCrsGrade () :String
+calcGradePoints () : Float
+inputCourseInfo ()
+toString() :String

And the UML for class file Student.java
Student
-MAX_COURSES : Integer (FINAL) = 10
-studLast : String
-studFirst : String
-studNumber : Integer
-courseCount : Integer
- courses [] : Course (array)
<<Student>>
+inputStudentInfo ()
+calcGPA ()
+printStudent()


I need to stick with these UMLs however inefficient it may seem. My problem isn't understanding what the then methods and constructors do, it is the actual format when writing them. Particularly what commands go where?
Thanks for any feedback. Dont be too harsh, I am new to this.
 
Knute Snortum
Sheriff
Posts: 4070
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you need a style guide or a tutorial?
 
Adam Classified
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tutorial. If you have recommendations, I'd appreciate it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!