Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1: Identify Classes and design UML Class diagram for the following case studies. a) A medical institution wishes to computerize its patient records system. They

Q1: Identify Classes and design UML Class diagram for the following case studies. a) A medical institution wishes to computerize its patient records system. They have asked you to create a desktop-based solution. Only the receptionist would use the system. Every patients detail will be registered in the system, such as their name, address, and contact telephone numbers. Similarly, every doctors detail will also be saved. Every doctor will have a different number of appointments per day and cost of appointment. These number of appointments can be changed at any time upon doctors request. System will display the available appointments of a doctor and an appointment can be booked for a patient. Patient can call receptionist or visit physically for appointment booking. Patient can cancel the appointment 1 day before the appointment date. A file will be provided by pharmacy department with all the medicine information like shown in the following sample data: Medicine ID Name Type Conflicting Medicine ID 1 Paracetamol Tablet None 2 Disprol Tablet None 3 BP Tablet Tablet None 4 Covid-Vac Injection 3 During the appointment, the doctor may prescribe some medicine. Patient will show the prescription report to the receptionist. System should allow him to ensure that the chosen medicine does not conflict with any other medicines already prescribed (in any previous appointments). Some patients need to receive a regular supply of medicine, for which they need a repeat prescription. In that case Patient will ask receptionist to print a repeat prescription and will update the patients notes. System should also allow user to produce different reports. i. Number of patients registered in current month. ii. Number of Appointments handled in current month. iii. All appointment records of a patient. iv. All medicines prescribed to a patient in different appointments. System should save all the information to the files, so no information is lost when the user exits and relaunches the application. b) You as a developer are requested to create a simple desktop application for teachers to create quizzes for the students. Teacher just want to manage his/her quizzes and questions, i.e., to add new quiz and then add some questions to that quiz from a question bank, to view the quizzes, to modify a quiz, to delete a quiz, print a quiz to file with or without the correct answers. System should also provide a functionality to compute result of an attempt by matching answers with a provided quiz attempt file. (to simplify it further, consider every student will answer the questions in the same sequence as in quiz and store them in a file, in specific format, then you can simply match the answers of a students attempt with the quiz answers to compute the result for that attempt). The system should allow the user to create multiple question banks. Each question bank can have a title and it will contain multiple questions. System should provide the functionality to manage the questions in a question-bank, i.e., to view the questions, to modify a question, to delete a question. In addition, system should allow to load questions from a file and add them to a question bank. Questions can be of different types, i.e., MCQ, filling blanks and short-text-answer. For each question, the user will store the question number, question details, options of the question according to question type and the correct option/answer. Viewing a quiz means, view quiz details i.e., quiz created date, and number of questions. User should also be able to view the questions in the quiz. Modifying a quiz means, modify quiz details i.e., quiz title, quiz date, etc., It also means that user can add or delete questions in the quiz. Deleting a quiz means, the quiz along with all the question inside it will be deleted. System should also allow user to produce different reports. i. Get the total number of questions in all question banks ii. Get the average number of questions in all question banks. iii. Get the number of questions of a type (MCQ, short answer etc) in question bank.

Q2: Create UML diagram and Implement the following case study in Java. A University offers different diploma programs. Principal of the university wants to create a Desktop-based application to manage the records related to their diploma programs and students. A diploma has eight semesters. A student must take two courses in each semester to pass that semester. If a student gets fail in one subject, he must repeat that semester again (enroll again. repeat all the courses of semester). Just for further clarification, each course can have only one section. A teacher can be assigned to that course in each semester, but teacher assignment module is not currently being focused in the current solution, still we will provide a base for that in future. Following is an Object-Oriented solution designed for the case study, you are required to implement it (only skeleton), you can add other details if you think are necessary. A class named Person having A protected attribute name as string. A protected attribute cnic as int. A private attribute address as string A private attribute fatherName as string. A parametrized constructor that assigns provided values to all the attributes. A Teacher class that is-a Person as well, has A private attribute Id. A parametrized constructor that assigns Id, name, cnic, address, fatherName. (You should call super constructor to assign values for Person). A class named Course has A private attribute String courseName A private attribute Teacher teacher A private attribute double marks. (min: 0 and max 100) A private attribute int creditHours A private attribute char grade A private attribute double GPA A parameterized constructor to initialize attributes courseName, creditHours and marks, this constructor should also calculate grade and GPA, according to the grading policy defined in table below: Letter Grade Percentage GPA A 80-100 4 B 70-79 3 C 60-69 2 D 50-59 1 F <50 0 a getter getcoursename() function that will return coursename of the course. getgpa() gpa getcredithours() credithours name semester private attribute semesternumer as int (1 to 8, according students progress, he may repeat same many times) double sgpa semestercredithours string result (pass or fail) arraylist courses (2 courses) A parameterized constructor that gets semesterNumber and two courses as parameters of that semester and it will set the value of result as Pass or Fail. If one of the courses has F grade the semester result is set to Fail. It will also set semesterCreditHours by adding creditHours of both courses. It will also calculate the SGPA using the formula given below and save it to SGPA attribute of class. SGPA=((GPA_(Course 1) creditHourse_(Course 1) )+(GPA_(Course 2) creditHourse_(Course 2) ))/semesterCreditHours A getter getSGPA() that will return the value of SGPA. A getter getSemesterCreditHours() that will return the value of semesterCreditHours. A Student class that is-a Person as well, has A Private attribute sapid as int A Private totalcreditHours as int A private double attribute CGPA A Private ArrayList semesters, containing information of all the semesters. A default constructor that assigns default values. A parameterized constructor that takes only sapid, name, cnic, address, fatherName sets the value of respective attributes and initializes semesters with a new empty ArrayList. A public method addSemester(semester Semester), that adds a semester in semesters ArrayList. A public method calculateCGPA(), to calculate the overall CGPA of all the semesters that are passed so far. it is calculated by getting average of all the semester's CGPA. Formula is given below: CGPA=((SGPA_(Semester 1) semesterCreditHourse_(Semester 1) )+@(SGPA_(Semester 2) semesterCreditHourse_(Semester 2) )+@(SGPA_(Semester 3) semesterCreditHourse_(Semester 3) )+@(SGPA_(Semester 4) semesterCreditHourse_(Semester 4) )+@.@.@.)/totalCreditHours Override toString () method that will return the result of all the semesters as a String in the following format: Result of Ahmad Khan: CGPA = 3.5, Credits Earned = 14 Semester 1: Computer Fundamentals: GPA{ 3 }, Grade { B }, CreditHours{ 3 } Calculus: GPA { 3 }, Grade { B }, CreditHours { 3 } SGPA: 3.00 Semester 2: OOP: GPA{ 4 }, Grade { A }, CreditHours{ 4 } Software Engineering: GPA { 4 }, Grade { A }, CreditHours { 4 } SGPA: 4 A public method printTranscript() that will simply store the string returned by toString() method to a file. Write a main() method to test your code. Sample testing code is provided below. You should test other possible cases too.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions