0% found this document useful (0 votes)
23 views

Spring 2024 - CS506 - 2

Uploaded by

Haris khan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Spring 2024 - CS506 - 2

Uploaded by

Haris khan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Assignment No.

02
Total Marks: 20
Semester: Spring 2024
Due Date: June 24 2024
CS506 – Web Design and Development

Please read the following instructions carefully before solving & submitting assignment:

Uploading Instructions:
 You are allowed to use any IDE (like NetBeans IDE/IntelliJ IDEA) for this assignment development.
 The submission must be a complete project folder (which should contain complete source code, Java
files, database file and builds etc.). After finalizing, compress it with Zip or RAR format, save with your
own Student ID (e.g., bc000000000.zip) and submit it at VU-LMS within the due date.
 Your assignment should be in .zip /.rar format. Other file formats will not be accepted.
 No assignment will be accepted through email.

Rules for Marking:


It should be clear that your assignment will not get any credit if:

o The assignment is submitted after the due date.


o The assignment is not submitted in .zip /.rar format.
o The submitted assignment does not open or the file is corrupted.
o The assignment is fully or partially copied from other students or ditto copy from handouts or the
Internet; strict disciplinary action will be taken in this case.

Note:
o No assignment will be accepted after the due date via email in any case (whether it is the case of load
shedding or internet malfunctioning etc.). Hence refrain from uploading the assignment in the last hour of
deadline.
o It is recommended to upload the solution at least one day before its closing date.
o Do not put any query on MDB regarding this assignment, if you have any query then email at
[email protected]

Lectures Covered: This assignment covers Lectures # 10 to 22

GOOD LUCK

1
Assignment No. 02
Total Marks: 20
Semester: Spring 2024
Due Date: June 24 2024
CS506 – Web Design and Development

Problem Statement:
This assignment is a continuation of assignment # 1. Where, you have developed a basic Java program for an
ABC Marathon. Although the basic functionality remains the same (i.e., taking name and time as input from
user and calculating the winner). However, in this assignment, you are required to store/fetch data to/from
a backend database and display it in a table using Java Swing based GUI (i.e., Graphical User Interface)
components.

Requirements:
 The program should display a GUI (i.e., Graphical User Interface) which should contain
appropriate labels, text fields, buttons and a table as shown in figure # 01.
 To add a new runner, the user will provide the name and finishing time of the runner in
corresponding text fields and click on "Add Runner" button to submit. If input is valid (i.e.,
name and time are not empty, the finishing time is a positive number and same runner does
not exist in database), the data should be added in backend database. However, in case of
invalid input, the user should be prompted accordingly.
 By clicking on the "Load Data" button, the program should fetch runners’ data, in ascending
order with respect to runner name, from backend database and display it in a table as shown
in figure # 02.
 While clicking on the "Delete All" button, the program must remove all runners' data from
database and as well as from the table. However, the user should be prompted first before
performing the delete process as shown in figure # 03.
 The button "View Winner" should be responsible for fetching the fastest three runners from
database based on the best finishing time (i.e., taking smaller number of minutes to finish the
race) and display it in the table as shown in figure # 04.
 Further, cross icon at top right corner of the interface should terminate the program and
show the developer information (i.e. Student Id and name) through a message dialog as
shown in figure # 05.

2
Assignment No. 02
Total Marks: 20
Semester: Spring 2024
Due Date: June 24 2024
CS506 – Web Design and Development

Sample Output:

Fig. 1: A typical GUI for ABC Marathon Fig. 2: Displaying Data in Table

Fig. 3: Confirming before Delete Fig. 4: Displaying Winners in Table

3
Assignment No. 02
Total Marks: 20
Semester: Spring 2024
Due Date: June 24 2024
CS506 – Web Design and Development

Fig. 5: Displaying Developer Info


Required Stuff:
Java Classes:
Runner.java (id, name, time)
DbHelper.java (should contain all database related code)
MainClass.java (should contain GUI code)

Database file:
BSxxxxxxxx.db (must be same as your own VU student id)

Note: Need to put database file in assets folder in NetBeans/IntelliJ Idea project directory; as shown below.

Fig. 7: Folder "assets" in the Project Directory

Setup Files & Video Tutorials:


 To download & install JDK and create a HellowWorld program in Java, please watch.
https://vulms.vu.edu.pk/Courses/CS506/Downloads/JDK_Installation.mp4
 To download JDK setup file for Windows x64 from VU-LMS, please visit.
https://vulms.vu.edu.pk/Courses/CS506/Downloads/JDK_13.0.2_Windows_x64.zip

4
Assignment No. 02
Total Marks: 20
Semester: Spring 2024
Due Date: June 24 2024
CS506 – Web Design and Development

 To download JDK setup file for Windows x32 from VU-LMS, please visit.
https://vulms.vu.edu.pk/Courses/CS506/Downloads/JDK_8.251_Windows_x32.zip

 To install & create a HelloWorld Java program in NetBeans IDE, please watch;
https://vulms.vu.edu.pk/Courses/CS506/Downloads/NetBeansIDE_Installation.mp4
 To use UCanAccess driver to connect with MS Access database, please watch;
https://vulms.vu.edu.pk/Courses/CS506/Downloads/UCanAccess_Driver_Installation.mp4

Important Things to Implement:


 For GUI, relevant components (i.e., JFrame, JPanel, JButton, JLabel, JTextField and JTable etc.) from
AWT and Swing packages should be used.
 You will have to use UCanAccess driver to connect to MS Access database. In this case, you are
suggested to view the video tutorial shared above.
 For storing/fetching data to/from database, you will need to use proper SQL queries.
 Data must be stored/fetched to/from database in the form of Java class object/s.
 You can use same Runner Java class as provided in assignment # 1 and can make changes as
required.
 Java classes must have proper Data Members and Member Functions along with Constructors,
Standard Setters, and Getters etc.
 Need to make sure that exceptions are managed properly throughout the program; especially
NullPointerException, NumberFormatException, ClassNotFoundException and SQLException etc.
 All images, sample output, and data, given in this document, are just for reference purpose only; you
must provide your own implementations. It is not required to be the same.

Good Luck

You might also like