Q1. Grade Processing System
University grading system maintains a database called “GradeProcessing” that
contains number of tables to store, retrieve and manipulate student
marks. ‘Java2’ is one of the tables which contains following attributes for all the
students enrolled in “Java2”: “ID”, “Name”, “Quiz”, “A1”, “A2”, “Exam”,
“CumulativeMark” and “Grade”. A sample of the table may look like as follows:
ID Name Quiz A1 A2 Exam CumulativeMark Grade
11111111 X 100 85 100 88 90.55 HD
22222222 Y 100 60 80 75 75.00 DI
Write a JAVA Graphical User Interface (GUI) 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.
Update: The user of your program should be able to update any field/s of
a particular record. The record for update operation will be selected by ID.
Calculate Results: The Cumulative Mark of a student would be calculated
using the following formula: CumulativeMark = (Quiz * 0.05)+(A1* 0.15)
+(A2* 0.2) + (Exam * 0.6)
Calculate Grade:
HD: CumulativeMark>=85
DI: 75<=CumulativeMark<85
CR: 65<=CumulativeMark<75
PS: 50<=CumulativeMark<65
FL: CumulativeMark<50
Note that, ID must be an 8-digit number, A1, A2, and Exam marks must be between
0 and 100 (inclusive), and CumulativeMark must be floating-point numbers with
two decimal places.
Q2. Assume the participant table is created using the following query,
CREATE TABLE PARTICIPANT (PARTICIPANT_NM VARCHAR(255),
PARTICIPANT_ID INT,MEETING_NM VARCHAR(20),MEETING_DAY
VARCHAR(15))
Write SQL Statements to accomplish the following in a Java Program
1. Determine the names of the columns in the MEETING table, and display
the column names on the console.
2. Write a query to find the names of all participants for the meeting with ID
1144. Display the names on the console, preceded by the message, “Names
of participants in meeting 1144”.
3. Insert a new participant with your name as the participant’s name.
4. Count the number of people participating in the meeting with ID 1105.
5. Display a message on the console that gives both the meeting name and the
number of participants.
6. Determine the names of all people who participate in meetings that meet
on Tuesdays. Display the names, preceded by the message, “Participants
attending Tuesday meetings”.
What I have tried:
I am stuck with Q1 Database creation itself