0% found this document useful (1 vote)
81 views6 pages

Fall 2024 - CS506 - 2

Uploaded by

kayof53875
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 (1 vote)
81 views6 pages

Fall 2024 - CS506 - 2

Uploaded by

kayof53875
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/ 6

Assignment No.

02
Total Marks: 20
Semester: Fall 2024
Due Date: Dec 27, 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]

1
Assignment No. 02
Total Marks: 20
Semester: Fall 2024
Due Date: Dec 27, 2024
CS506 – Web Design and Development

Objectives:
The objective of this assignment is to provide hands-on experience of Java Programming concepts including:

 Refine Java Programming Skills


 Extend Existing Java Program Functionality
 Implementing a GUI with Java Swing
 Design a Table for Displaying Data
 Database Integration with MS Access
 Handling Database Transactions Efficiently
 Improve Error Handling and Exception Management

Covered Lectures:
This assignment covers Lectures # 10 to 22

GOOD LUCK

2
Assignment No. 02
Total Marks: 20
Semester: Fall 2024
Due Date: Dec 27, 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
Invention Expo. Although the basic functionality remains the same (i.e., taking name and score as input from
user and calculating the winner). However, in this assignment, you are required to store/fetch data to/from
a backend database (i.e., MS Access) 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 # 1.
 To add a new inventor, the user will provide the name and score in corresponding text fields
and click on the "Add Inventor" button to submit. If the input is valid (i.e., name and score are
not empty, the score is a positive number between 1 and 100, and the same inventor does not
exist in the database), the data should be added to the 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 inventors' data in ascending
order with respect to inventor name from the backend database and display it in a table as
shown in figure # 2.
 When clicking on the "Delete All" button, the program must remove all inventors' data from
the table as well as from the database. However, the user should be prompted first before
performing the delete process, as shown in figure # 3.
 The "View Winner" button should be responsible for fetching the top three inventors from
the database based on the highest score and displaying them in the table as shown in figure #
4.
 Further, the cross icon at the 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 # 5.

3
Assignment No. 02
Total Marks: 20
Semester: Fall 2024
Due Date: Dec 27, 2024
CS506 – Web Design and Development

Sample Output:

Fig. 1: A typical GUI for Invention Expo Fig. 2: Displaying Data in Table

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

4
Assignment No. 02
Total Marks: 20
Semester: Fall 2024
Due Date: Dec 27, 2024
CS506 – Web Design and Development

Fig. 5: Displaying Developer Info


Required Stuff:
Java Classes:
Inventor.java (id, name, score)
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. 6: Folder "assets" in the Project Directory

Setup Files & Video Tutorials:


 To download & install JDK and create a HelloWorld 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
 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

5
Assignment No. 02
Total Marks: 20
Semester: Fall 2024
Due Date: Dec 27, 2024
CS506 – Web Design and Development

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 the same Inventor 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 purposes only; you
must provide your own implementations. It is not required to be the same.

Good Luck

You might also like