× Limited Time Offer ! FLAT 20-40% off - Grab Deal Before It’s Gone. Order Now
Connect With Us
Order Now

COIT20245 Introduction To Programming Assignment Sample

Assignment Brief

For this assignment, you are required to develop a Menu Driven Console Java Program to demonstrate you can use Java constructs including input/output via the console, Java primitive and built-in types, Java defined objects, arrays, selection and looping statements and various other Java commands. Your program must produce the correct results.

The code for the menu and option selection is supplied: GradingSystemMenu.java and is available on the unit website, you must write the underlying code to implement the program. The menu selections are linked to appropriate methods in the given code. Please spend a bit of time looking at the given code to familiarize yourself with it and where you have to complete the code. You will need to write comments in the supplied code as well as your own additions.

Assignment Specification

You have completed the console program for processing grade of students for COIT20245. We are going to extend this application so the students name, student number, marks and grades can be stored in an array of objects, do not use ArrayList.

The program will run via a menu of options, the file GradingSystemMenu.java has been supplied (via the Moodle web site) which supplies the basic functionality of the menu system.


Look at the code supplied and trace the execution and you will see the menu is linked to blank methods (stubs) which you will implement the various choices in the menu.

Student class

First step is to create a class called Student (Student.java).

The Student class will be very simple it will contain seven private instance variables:

o studentName as a String o studentID as a String
o assignmentOneMarks as double o assignmentTwoMarks as double o projectMark as double
o individualTotalMarks as double
o grade as a String

The numeric literal values, like P=50.00, HD=85.00 must be represented as constants.

The following public methods will have to be implemented:

o A default constructor

o A parameterised constructor o Five set methods (mutators) o Five get methods (accessors)

o A method to calculate total marks and return student’s total marks as double – calculateIndividualTotalMarks(). This calculation will be the same as in assignment one.

o A method to calculate grade and return the grade as String – calculateGrade(). This calculation will be the same as in assignment one. Use constants for all numeric literals.

Note: Following basic database principles, calculated values are not usually stored, so in this case we will not store the grade as a instance variable, but use the calculateGrade() method when we want to determine the grade.

GradingSystemMenu class

Once the Student class is implemented and fully tested we can now start to implement the functionality of the menu system.

Data structures

For this assignment we are going to store the student’s name, student number and assessment marks an array of Student objects.

Declare an array of Student objects as an instance variable of GradingSystemMenu class the array should hold ten students.

You will need another instance variable (integer) to keep track of the number of the students being entered and use this for the index into the array of Student objects.


Menu options

1. Enter students name, student number and assessment marks: enterStudentRcord()
You will read in the student’s name, student number and assessment marks as you did in assignment one.


Data validation (you can implement this after you have got the basic functionality implemented) You will need to validate the user input using a validation loop.

The student’s name and student number cannot be blank i.e. not null and the assessments marks needs to be within the range of (0-assessment weighting), the same as assignment one.


When entering record of student’s name, student number and assessments marks, the student have been entered successfully into five local variables you will need to add these values into the student object array, you will also need to increment a counter to keep track of the number of students you have entered and the position in the array of the next student to be entered.

When the maximum number of students record is reached do not attempt to add any more student’s record and give the following error message:

When the student details have been successfully entered, display the details of the student and the charge as follows

Note: For the next two options, display all and statistics you should ensure at least one student’s record has been entered and give an appropriate error message if it there are no students record entered.

Display all student’s name, student number, assessment marks and grade:

displayAllRecordsWithGrade()

When this option is selected display all the records with grade which have been entered so far.

3. Display statistics: display Statistics()

When this option is selected you will display the statistics as per detailed in assignment one document. You can loop through your array of objects to calculate this information.

Remember the welcome and exit messages as per assignment one.

Solution


Menu class Interfaces

GradingSystemMenu app = new GradingSystemMenu();

This line in the main method is used to create an object of the GradingSystemMenu class. Then this class object is used to call the processingGradeingSystem() method. This method is responsible to handle the menu display and menu choice entry from the users for assignment help
int choice = getMenuItem();

This line inside the processingGradeingSystem() method is used to get the user entered menu choice. Also, inside getMenuItem(), the menu is displayed to the user and input is taken using Scanner class object. This choice input is returned to the processingGradeingSystem() method. This repeats in a loop till user enters choice for EXIT. The flowchart below better defines the flow of actions in this context.

Student and GradingSystemMenu class

GradingSystemMenu class uses the enterStudentRcord() method to take entry of all student records and then create a Student object after validation. In order to create the object, the student class constructor is called with user entered values. These objects are then saved inside the students[] array of type Student Class. This array is then used all across the program for various purposes.

Class Diagram



Reflection Report

It took me about 4 to 5 hours in order to complete the programming assignment as a whole. In the first few minutes of this time, I carefully studied the assignment requirements and then downloaded and read through the documented code on the GradingSystemMenu,java file. This helped me to get started with the assignment.

I did not face any noticeable problem with this assignment as the functions were very clearly documented using the todo comments.

Testing Screenshots

Test Invalid menu input



Test Option 2 with no records



Test Option 3 with no records

Test Blank Name and ID



Test Assignment marks range validation



Test Data Record Entry and display



Test Option 2

Test Option 3



Test Option 4

Fill the form to continue reading

Download Samples PDF

Assignment Services