Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

CS506 Web Design and Development Assignment No.1 Solution & Discussion Due date: 16 may 2019

    CS506 Assignment No.1

Web Design And Development:

Uploading instructions:


  • Your assignment should be in .zip /.rar format. Other file formats will not be accepted.
  • Save your assignment with your ID (e.g.
  • No assignment will be accepted through email.


Rules for Marking:


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


·         The assignment is submitted after due date.

·         The submitted assignment does not open, execute or file is corrupted.

·         Your assignment is copied from internet, handouts or from any other student

      (Strict disciplinary action will be taken in this case).

·            Do not put any query on MDB about this assignment, if you have any query then email at





Problem Statement:                                                        


You are required to write a Java program, named Patients History, for a typical hospital management system. In which user will be asked to provide patients details as input, which will be saved in a simple text file. Further, user can search a particular patient and as well as can view all patients’ history via GUI.


Detailed Description:


For this purpose, you have to create a text file (i.e. data.txt) and three java classes (i.e. Person, Patient and MainClass). Data members and member functions of these classes are given below;


Note: There should be three different Java files which contain theses classes.


Person class must have the following data members & member functions:

•                     cnic: long

•                     name: String

•                     age: int

•                     Constructors: default, parameterized and copy constructor

•                     Standard Setters: setCnic(…), setName(…), setAge(…)

•                     Standard Getters getCnic(), getName(), getAge()

Patient class will inherit from Person class and should have the following data members & member functions:

•                     disease: String

•                     appointmentDate: String

•                     Constructors: default, parameterized and copy constructor

•                     Standard Setters: setDisease(…), setAppointmentDate(…)

•                     Standard Getters getDisease(), getAppointmentDate()


          Fig. 1: Classes Hierarchy


MainClass should contain the main() method. At first, it should load data from text file (i.e. data.txt) and save in ArrayList. After that, the interface should display following options;


1.      Add a new Patient  

2.      Search a Patient

3.      View all Patients

4.      Exit

          Fig. 2: First GUI


1. Add a new Patient:


Each time, user selects this option, s/he will be prompted to enter new patient information (i.e. cnic, name, age, disease and appointment date). If inputs are correct (i.e. found no empty value) then new patient information will be added in ArrayList, otherwise a message should be displayed "Invalid input".

          Fig. 3: User Inputs



2. Search a Patient:


In order to search a patient, user will be asked to provide a CNIC. The program will search corresponding patient in ArrayList. If patient is found, history will be displayed to user. Otherwise, a message should be displayed "Patient not found".

Fig. 4: Search a Patient

3. View all Patients:


The program should first check if ArrayList contains any data; if not, it means no patient is added yet so ask user to add a new patient first. Otherwise, a GUI will be opened, displaying all patients’ history.

Fig. 5: Patients’ History

4. Exit:


            Exit option will terminate the program by saving all ArrayList data back to text file (i.e. data.txt) and showing the developer information (i.e. Student Id and name) via GUI.


Fig. 6: Developer Info.

Fig. 7: Sample data file (i.e. data.txt)


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 stored to / fetched from ArrayList in the form of Java class object/s.

Ø  For GUI, relevant Java Swing Dialogs (by using JOptionPane) should be used for taking input and displaying any information to user throughout the program.

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


What and How to Submit:


Ø  It must be complete NetBeans IDE project folder (which should contain complete source code, text files, and builds etc.). After finalizing, compress it with Zip or RAR format and submit it at VU-LMS within due date.






Deadline: Your assignment must be uploaded/submitted on or before 16th May 2019.



Views: 5606


Replies to This Discussion py ap mujay email kar dain




kindly mujhy b koe email kr dy pe 

i am waiting

1 hour left kindlyyyy koe share kr do plsss


ye kia?

do u have solution yasir?


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

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