Task

PLEASE ONLY WORK ON Netbeans IDE8.0.1

Task 1 ( 60 marks)


University grading system maintains number of tables to store, retrieve and manipulate student marks. These tables reside in a centrally or locally located server known as ‘database server’. ‘Student_marks_ITC000’ is one of the tables which contains following information for all the students enrolled for ITC000: ‘Student ID’, ‘Student Name’, ‘Marks obtained in Assignment 1’, ‘Marks obtained in Assignment 2’, ‘Marks obtained in Assignment 3’ and ‘Marks obtained in Final’. A sample of the table may look like as follows:

Student ID / Name / Assignment1 / Assignment2 / Assignment3 / Final /
1001 / Janet / 80 / 100 / 90 / 85
1002 / Daniel / 60 / 70 / 75 / 90

Write a JAVA program that would perform following tasks:

·  Create Table:Create a table that is capable to store above information.

·  Insert Record:If the user of your program wants to insert a record, your program should ask for all the fields of the record and insert them in the table.

·  Search: The user of your program should be able to search a particular record by ID or any other field.

·  Calculate final score: Take a student’s ID as input and displays his/her score in each item. It also should calculate and display the final score where final score = 10%(Assignment 1) + 20%(Assignment 2) + 20%(Assignment 3) + 50%(Final exam).

PLEASE READ THIS carefully:

TASK1:

You must setup your program so that it connects to a MYSQL database named "grading_db", running on "localhost". The username must be "grader" and "abc" (user name/password). The first thing your program must do is to crate the tables in this database. You can either provide a button that I click on for this to happen (if you are building a GUI), a text-menu option, or to just do this on startup (my preferred option). Of course, if you choose the latter, you will get extra mark if your program first checks that the table(s) already exist so that you don't destroy existing data. Then, provide menu options for inserting records, and searching. The search results should show the student's marks, and also display the calculated total final score (the formula for this in the assignment description in the subject outline)


Task 2 (40 marks)

Write a JAVA program that would simulate a number of cars’ (e.g. 4) speed meter using the concept ofMultithreading. A car’s speed can be both increased and decreased using specified keys from the keyboard. The speed of all the cars should be displayed on the screen both in text format and graphically simultaneously.
here's some clarification on what is expected for Assessment 3, Task 2. * I imagine 4 cars, implemented a threaded classes (implementing Runnable), running in a pool. * Each contains a speed instance variable. * On the keyboard, I assign two keys for each car, one for acceleration and one for deceleration. For example, if I press "q", the speed of car 1 will go up by 1, and if I press "w", the speed of car 1 will go down by 1. * Each threaded car will listen for key presses independently. This can be done using a KeyListener to capture key events. * To graphically display the car speeds, I suppose something like a bar graph would be acceptable, with the text speed indicators somewhere in the same jPanel. There is no single way to do this. Think about your GUI skills (current and desired) and imagination, and create a graphical representation. This could be a simple bar graph, or a race course-style visualisation with animation and visual effects.

Rationale

This assignment is designed to asses following learning outcomes:

·  be able to create, connect to and update a relational database using the Java Database Connectivity (JDBC);

·  be able to design and implement multithreaded Java applications;

·  be able to demonstrate the use of the inheritance features of the Java language to design and implement complex object-oriented programs;

Presentation

Following items are to be submitted in the Turnitin(For each task):

·  Report:The report (in .doc or .pdf format) should explain how to run your program (1 or 2 page long) and any settings needed to run your program. Enough number of screenshots should be shown in the document. In case if the assignment marker fails to run your program, because of any inconvenience, these screenshots would show how the program worked on your machine/environment.

·  Source code and other files:All source codes, exe file and other relevant files must have to be zipped in a folder such that unzipping would keep the file/folder structure unaffected.

Marking criteria

The marking criteria are represented via the following marking guide.

Task 1

Items / Full Marks / PS / CR (PS+) / DI (CR+) / HD (DI+)
Presentation / 10 / Very basic presentation (no source code or screen shots were included) / Only report (with screen shots) is present but no source code was submitted / Report, screen shots and source code both are submitted as required / The presentation includes all requirements andis easy to read and understand
Program execution / 10 / Program is not running but the source code indicates the correctness / Program is running but not working properly / Program is running perfectly but cannot handle unexpected inputs/events / Program is running perfectly and not crashing because of unexpected inputs/events
Create table / 10 / A table is created but provides no error/warning message / Any error/warning is handled / Program checks the validation of the fields before sending the query to the MySQL / Some suggestions about fields and table creation confirmation message is displayed
Insert record / 10 / A record is inserted but provides no error/warning message / Any error/warning is handled / Program checks the validation of the fields before inserting a record in the table / Some suggestions about fields and insertion confirmation message is displayed
Search / 10 / A record is searched correctly but provides no error/warning message / Any error/warning is handled / Program checks the validation of the field to be searched before running search operation in the table / Some suggestions about fields and all search results are displayed
Calculate final score / 10 / There are some mistakes in calculating final score / Final score is perfectly calculated / All error/warning message is properly handled

Task 2

Items / Full Marks / PS / CR (PS+) / DI (CR+) / HD (DI+)
Presentation / 8 / Very basic presentation (no source code or screen shots were included) / Only report (with screen shots) is present but no source code was submitted / Report, screen shots and source code both are submitted as required / The presentation includes all requirements andis easy to read and understand
Program execution / 8 / Program is not running but the source code indicates the correctness / Program is running but not working properly / Program is running perfectly but cannot handle unexpected inputs/events / Program is running perfectly and not crashing because of unexpected inputs/events
Speed showing in text / 12 / There are some errors in showing the actual speed of all the cars / No error in showing the speed itself, however the interface is not fully clear to the user / The speed of corresponding cars, increase/decrease are perfectly working and displayed clearly to the user
Speed showing using graphics / 12 / There are some errors in showing the actual speed of all the cars / No error in showing the speed itself, however the interface is not fully clear to the user / The speed of corresponding cars, increase/decrease are perfectly working and displayed clearly to the user