[go: up one dir, main page]

0% found this document useful (0 votes)
42 views4 pages

COSC102 HW1-version1-1

1. This document provides instructions for a group project assignment to create a basic Learning Management System (LMS) in Java. Students will create Course and Student classes to represent courses and students. 2. The Course class is to have attributes like name, ID, instructor, and methods like adding/changing attributes and calculating average scores. The Student class is to have attributes like name, ID, year, and methods like changing attributes, advancing years, and describing years as "Freshman", etc. 3. Students will design UML diagrams for the classes, implement the classes in Java, then test them by creating class instances and using class methods. The project is submitted as Java files and a UML diagram in a

Uploaded by

malakalsaleh05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views4 pages

COSC102 HW1-version1-1

1. This document provides instructions for a group project assignment to create a basic Learning Management System (LMS) in Java. Students will create Course and Student classes to represent courses and students. 2. The Course class is to have attributes like name, ID, instructor, and methods like adding/changing attributes and calculating average scores. The Student class is to have attributes like name, ID, year, and methods like changing attributes, advancing years, and describing years as "Freshman", etc. 3. Students will design UML diagrams for the classes, implement the classes in Java, then test them by creating class instances and using class methods. The project is submitted as Java files and a UML diagram in a

Uploaded by

malakalsaleh05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

COSC 102 Object Oriented Programming

Group Project Part 1


40 points
Due Thursday, March 7, 2024

Overview:
In this first part of your project, you will get experience with basic programming concepts by
creating a small part of a Learning Management System (LMS). This system is what schools and
universities use to manage courses, teachers, and students. You will writw Java code to represent
courses and students.

What You'll Practice:

Creating Classes and Objects: You'll learn how to design templates for courses and students,
using classes, and then create instances of these classes, which are objects. This is like making a
blueprint and then building something based on that blueprint.

Flow-Control: You'll use if-statements and/or switch-statements to make decisions in your code.

Using Basic Mathematical Functions: You'll calculate the average score of students in a course.

Methods: You'll write functions within your classes to perform actions, like assigning a score.
Classes to Implement:

1. Course Class

Attributes:
- courseName: The name of the course (e.g., "Object Oriented Programming").
- courseID: The unique identifier of the course (e.g., "COSC102").
- instructor: The name of the instructor teaching the course.
- add at least two more attributes as you see fit.

Methods:
- Create the accessor and mutator methods for all your data fields. When called, the
mutator methods should print a message indicating the change. For example, the
mutator for the instructor field would print "The instructor with name
<instructor_name> has been assigned to teach this course” (Note that <
instructor_name > should be the name of the instructor which is passed as argument
to this method).
- Add a static method named calculateAverageScore, which takes three scores as
arguments, and returns their average.
- Add a method named printCourseDetails which prints the course attributes in a
formatted string. For example,
o Course code: COSC102
o Course name: Object-Oriented Programming
o Course instructor: Dr. Fatema Akbar

2. Student Class

Attributes:
- studentName: The full name of the student (e.g., Isaac Newton).
- studentId: The unique identifier of the student (e.g., A01029).
- year: An integer representing the student’s year (1, 2, 3 or 4).
- Add 2-3 additional data fields as you see appropriate (e.g. college, major, date enrolled,
advisor, etc.)

Methods:
- Create the accessor and mutator methods for all your data fields. When called, the
mutator methods should print a message indicating the change. For example, the student
name mutator would print "The student's name has been updated to <new_name>." (Note
that <new_name> should be replaced with the name of the argument passed to this
method).
- Create a method named advanceToNexYear which increments the student’s year by one.
- Create a method named yearString which prints the student's year in words. Use a switch
statement to print “Freshman” for year 1, “Sophomore” for year 2, “Junior” for year 3,
“Senior” for year 4, and “unknown” for any other year.
Task 1: Design and Model

For this task, you will create a Unified Modeling Language (UML) diagram for the classes you
plan to create. UML diagrams are tools that help developers visualize a program and outline its
classes, attributes, methods, and the relationships between classes. For this exercise, you'll focus
on a Class Diagram, which is a type of UML diagram.

For each class, list its attributes and methods. Include visibility indicators before each attribute
and method to indicate their access level. For instance, +studentName: String indicates a public
attribute named studentName of type String.
Remember to include data types for attributes and return types for methods.

Task 2: Implementation

1. Create a Java class called Student. The Student class should have the attributes and
methods as described in the Student Class.

2. Create a Java class called Course. The Course class should have the attributes and
methods as described in the Course Class.

Task 3: Create Instances and Test Your Code

Now that you've designed classes and their methods, it's time to test your classes. In this task,
you will create instances of your Course and Student classes and use these instances to test the
functionality of your code.

Instantiate Your Classes:


In a new class named TestClass, Create at least one instance of each class (Course and Student).
Think of these instances as actual courses and students in a school or university.
For example, you might create a Course instance representing a "Java Programming" course, and
a Student instance for "Adel Hasan".

Test Class Methods:


Use the instances you've created to test the methods in each class. This involves calling the
methods you've implemented and passing appropriate arguments to see if the expected actions
are carried out.

Submission Guidelines:
Submit your three Java files (Course class, Student class and TestClass) and your UML diagram
in a word document in a zip file on Canvas. Email submissions are not accepted.
Start the submission process early to avoid delays and technical issues.

Grading rubric:
Correct UML(6 pt, CLO B1)

Coding logic, quality and design (e.g. following assignment requirements, avoiding unnecessary
repetition of code, appropriate data types, correct implementation and use of classes) (10 pt,
CLO A2, B2)

Code runs without errors/exceptions (6 pt, CLO A2, B2)

Code generates expected output (6 pts, CLO A2, B2)

Code follows naming conventions for classes, methods and variables (4 pt, CLO A2, B2)

Code uses proper indentation and spacing (4 pt, CLO A2)

Code is properly commented (4 pt, CLO A2)

You might also like