From f41920bcbf704dab14b11cceda355940e0ea0ae9 Mon Sep 17 00:00:00 2001 From: fdai7921 Date: Tue, 6 Feb 2024 22:41:51 +0100 Subject: [PATCH] Docuentation in Course class --- src/main/java/org/example/Course.java | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/main/java/org/example/Course.java b/src/main/java/org/example/Course.java index 2b97004..e32b098 100644 --- a/src/main/java/org/example/Course.java +++ b/src/main/java/org/example/Course.java @@ -1,46 +1,96 @@ package org.example; +/** + * The Course class represents a course in a curriculum. + * Each course has a name, code, and credit value. + */ public class Course { + /** The name of the course. */ private String courseName; + /** The code of the course. */ private String courseCode; + /** The credit value of the course. */ private int courseCredit; + /** + * Constructs a new Course object with default values. + */ public Course() { } + /** + * Constructs a new Course object with specified values. + * + * @param courseName The name of the course. + * @param courseCode The code of the course. + * @param courseCredit The credit value of the course. + */ public Course(String courseName, String courseCode, int courseCredit) { this.courseName = courseName; this.courseCode = courseCode; this.courseCredit = courseCredit; } + /** + * Retrieves the name of the course. + * + * @return The name of the course. + */ public String getCourseName() { return courseName; } + /** + * Sets the name of the course. + * + * @param courseName The name of the course. + */ public void setCourseName(String courseName) { this.courseName = courseName; } + /** + * Retrieves the code of the course. + * + * @return The code of the course. + */ public String getCourseCode() { return courseCode; } + /** + * Sets the code of the course. + * + * @param courseCode The code of the course. + */ public void setCourseCode(String courseCode) { this.courseCode = courseCode; } + /** + * Retrieves the credit value of the course. + * + * @return The credit value of the course. + */ public int getCourseCredit() { return courseCredit; } + /** + * Sets the credit value of the course. + * + * @param courseCredit The credit value of the course. + */ public void setCourseCredit(int courseCredit) { this.courseCredit = courseCredit; } + /** + * Prints the information of the course to the console. + */ public void printCourseInfo() { System.out.println("Course Name: " + courseName); System.out.println("Course Code: " + courseCode);