We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>


Looking For Something at vustudents.ning.com? Click Here to Search

CS506 Assignment No 02 Spring 2019 Solution & Discussion

Share This With Friends......

+ Click Here To Join also Our facebook study Group.

This Content Originally Published by a member of VU Students.

+ Prohibited Content On Site + Report a violation + Report an Issue


..How to Join Subject Study Groups & Get Helping Material?..


Views: 3236

See Your Saved Posts Timeline

Replies to This Discussion

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions. Read More>>

Discussed & be touched with this discussion. After discussion a perfect solution will come in a result at the end.

 

“How to Join Subject Study Groups & Get Helping Material”

 

P.S:    Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”

 

Share below link with friends for solution & Discussion. A Single link for help in your education.

http://bit.ly/vucodes

CS506 2nd, part 1

Please upload 2nd part?

CS506 2nd Assignment, Part 2

SohaiL Qureshi  thanks for sharing 

why you depend on net beans and eclipse when you can do all without any IDE. Good effort but you need more practice...Good Luck_Sami Zain.

sir main function coding part show karn wo to ap ne show he nai kia or na explain kia?????? 

why

Assignment

 

 

Problem Statement:                                                        

 

You are required to develop a Java program, named Hospital Management System for a typical medical treatment center; in which you will fetch doctors and patients detail from database and schedule appointments. Further, user can search an appointment for a particular patient as well; all data will be shown to user via GUI.

 

Detailed Description:

 

For this purpose, you have to create one MS Access Database file(the name of file must be same as your own VU ID i.e. BS00000000.accdb)and two Java classes (i.e. Appointment and MainClass). Database fileshould contain two tables (i.e. Doctors and Patients);

 

 

Fig. 1: Doctors Table in Database

 

 

Fig. 2: Patients Table in Database

 

Appointment class should have the following data members and member functions;

 

•                     no: int

•                     patient: String

•                     doctor: String

•                     disease: String

•                     scheduledDay: String

•                     Constructors: default, parameterized and copy constructor

•                     Standard Setters: setNo(…), setPatient(…), setDoctor(…),

setDisease(…), setScheduledDay (…)

•                     Standard Getters: getNo(), getPatient(), getDoctor(),

getDisease(), getScheduledDay()

MainClass must contain the main() method which should initialize all GUI components and display following two buttons;

 

1.      Appointments

2.      Search

 

1. Appointments:

 

The program will schedule the appointments by matching patient’s diseases with doctor’s specializationsby using SQL selection query* and will display the result on GUI; needed to use Swing table component (i.e.javax.swing.JTable).

 

*Sample SQL query:       

 

SELECT ... FROM Patients, Doctors

WHERE Patients.Disease = Doctors.Specialization

 

Fig. 3: Appointments Detail on GUI

 

2. Search:

 

And, when user clicks on "Search" button then ask user to enter CNIC of a patient (using JOptionPane.showInputDialog). If input is correct (i.e. found no empty/null value) and corresponding patient is found in database then schedule an appointment by matching his/her disease with doctor’s specialization, otherwise a message should be displayed "Found no Patient".

 

*Sample SQL query:       

 

SELECT ... FROM Patients, Doctors

WHERE Patients.Disease = Doctors.Specialization

AND Patients.Cnic = ‘proivdedCnic’

 

 

Fig. 4: Search Result

 

Note:

The abovegiven images are just for reference purpose only; you will be making your own GUIs. It is not required to be exactly the same.

 

Doctors

 

Id

Name

Specialization

Visiting_Day

101

Dr. Ali

Heart

Monday

102

Dr. Anas

Malaria

Tuesday

103

Dr. Hammad

Dengue Fever

Wednesday

104

Dr. Shazia

Stroke

Thursday

105

Dr. Raza

Diabetes

Friday

106

Dr. Saba

Hepatitis

Saturday

 

Table. 1: Sample Data for Doctors Table in Database

 

Patients

 

CNIC

Name

Gender

Age

Disease

373061

Umar

male

27

Heart

396730

Usama

male

33

Malaria

415422

Bushra

female

22

Stroke

501765

Tariq

male

18

Dengue Fever

523170

Batool

female

38

Diarrhea

562227

Azhar

male

35

Heart

593491

Ahmad

male

33

Stroke

600877

Ayesha

female

28

Hepatitis

611598

Hasan

male

32

Typhoid Fever

639082

Iqra

female

33

Malaria

 

Table. 2: Sample Data for Patients Table in Database

 

Important Regarding Development:

 

If you are using JDK1.8 or above then you’ll have to use ucanaccess driver to connect to MS Access database. In this case, I'll suggest you to view the following tutorial.

 

https://vulms.vu.edu.pk/Courses/CS506/Downloads/UCanAccess.mp4

 

Following links will be helpful in creating new database in MS Access.

 

https://support.office.com/en-us/article/Create-a-new-database-32a1...

http://www.dummies.com/software/microsoft-office/access/how-to-buil...

https://www.wikihow.com/Make-a-Database-Using-MS-Access

 

 

Important Things to Implement:

Ø  Java Classes must have proper Data Members and Member Functions along with Constructor/s, Setters and Getters etc.

Ø  Data will be fetched from database in the form of Java class object/s.

Ø  For GUI, relevant components (i.e. JFrame, JPanel, JScrollPane, JTable, JButton, and JLable etc.) from AWT and Swing packagesshould be used.

Ø  For fetching data from database, you need to use proper SQL queries.

Ø  Need to make sure that exceptions are managed properly throughout the program.

 

 

GOOD LUCK

CS506-Assignment-2-Solution-Spring-2019discussVU

Attachments:

RSS

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service