/** * The Course class represents one course * * @author Hallgeir * @version 01 2014 */ public class Course { private String courseCode; private String courseName; private int credits; private Book reading; /** * Constructor for objects of class Course */ public Course(String courseCode, String courseName, int credits) { this.courseCode = courseCode; this.courseName = courseName; this.credits = credits; } /** * This method will set the readings for a course. The reading will be a Book object * @param readings */ public void setReading(Book reading) { this.reading = reading; } /** * This methos will set the readings for a course. The reading will be a Book object * @param author, title, price * 1: create book object * 2: assign book to course */ public void setReadingNewBook(String author, String title, int price) { //Book newBook = null; //newBook =new Book(author,title,price); //reading = newBook; reading = new Book(author, title, price); } /** * Method to print all information about a course */ public void writeCourse() { System.out.println("Coursecode : " + courseCode); System.out.println("Coursename : " + courseName); System.out.println("Credits : " + credits); System.out.println("=====READINGS ========="); //if (reading != null) reading.writeBook(); //else // System.out.println("Reading not decided yet"); } }