)1 Write aJavaprogramwhich reverses alinked list linked list. It takes input N dan ceates alink list having N nodes (as per the givenclass defintion) definition) havingcharacterdata. Create a C
class Re~r~rse~ , and define amethod re~rerse which takes the starting node sa
the input parameter and returns the starting node inthe reversed lst.
Note: Don’t use array tohod the node objects node objects
Class Node
{
char data;
Nodenext;
}
Sample Inpu/output Enter thenumber fo nodes: Enter thedatainNode :a Enter thedatainNode :b Enter thedatainNode :c Enter thedatainNode :d Enter thedatainNode :e The reversed list is: e->d->c->b->a
2) Implement an invoice item mnagement system which stores a list fo invoice items
and calculates the total amount. Each invoice item stores the inventory item details and the quantity fo that partcular inventory item purchased item purchased.
Each inventory item has an id, name and unit price which should eb stored prior. Implement a menu driven program which iteratively reads the invoice details, and up on completion it generates an invoice which lists the invoice details along with the total amount. While entering invoice details, only the inventory id and quantity purchased is ne eded
Sampleinput andoutput: output:
Enter the available inventory tems line yb line, line by line, typeOKA Y ta theend fo the list: 01 i Bscuit 20
201 Chocolate 30
601Icecream 01 091RiceInKg 45 OKAY
1Add Invoice 2.Exit
Choice: 1
Add Invoice Item(Y/N)
Y
Enter Inventory ID and Quantiy line yb line, type line by line, type OKAY ta theend fo the list
01 1 0912 OKAY
****INVOICE****
10 i Bscuit,20,1
109 RiceInKg,45,2
Total:1 010
********
1Add Invoice 2.Exit
Choice:
2
3) Create aclass DepartmentMeetingScheduler , which schedules the meetings
hapening inthedepartment, and lists themeetng the meeting details scheduledon aparticuar
day. Eachmeetinghas the characteristics:- meetingT itle, meetingdate(indd/MM/yyyy
format), meetingStartT ime(in 24hr format), meetingEndT ime(in 24hr format)
meetingDescription.
Note: Use an an ArrayList tostore all meeting objects objects
DepartmentMeetingScheduler have thefollowing specification: specification:
- There is amethod schedule , which loks if if yan meeting whch s already
scheduled is colliding with thenewmeeting (based (based ontiming) and ceates the meeting i oncollisionoccurs. occurs.
- There is amethoddisplayMeetings which takes an nput an input parameter date and
lists all themeetings scheduled on the given date date
Sample Inpu/Output
1 Schedule Meeting 2. List Meetings
Enter your choice: 1
Title – CDMeeting Date – 23/08/021 23/0 Start tme – 530:1 End tme – 630:1
Des cription- first CDmeeting fo Manjusha
Scheduled successfully
Enter your choice: 1 I
Title – Class Committee Meet
Date – 23/08/021 23/0 Start tme – 60:1 End tme – 630:1 Des cription- first classcommitee meeting fofirst of first year students
Collision! Already another meeting is schedued
Enter your choice: 2 : 2
On 23/08021, from 15.30 to 16.30 : CD Meeting :15.30 to 16.30: DC Meeting : first CD meeting fo Manjusha
4) Create a class Employee(id, name, department, salary) and define a subclass
Mnager fo Employee with additional data member bonus. Now create some(n) objects
fo mnager class and display the details fo mnager’s having a maximum
salary(including bonus). Input is given as the number fo mnagers followed yb their id,
nam e, department, salary and bonus.
Input: 4 4
1Jadeja HR 3030 2Rishabdesign40450 3Virat SW 2504 4Rohit HW 380350 3
Output: 2Rishabdesign40450
3V irat SW 420 250
5) At the government hospitaltreating patients for patients for Covid, themnagement is preparing i
a token system that givespriority tosenior citizens citizens whowant to get tested over other
pati ents. Le Patientis asubclassa foPerson. of Person. A personhas apersoname anda
patient hasapatientID patient—ID. A patientIDhave thefollowing following format: <xxxx-yyy>wherexxxx is the entrycode and yyy is thepatents age. W age. rite ajavaprogramtoread detailsfo N details o nu mber fo patents, and showtheir names inthe order in the order fo age. That is,is,display the Name fo thepersonwhoneedstoeb tested first and thenfirst and then secondpersonand soon.
Sampleinput andoutput: outr Enter thenumber fo patients: 3
Enter thedetails fo patent :1 Name: DanielDaniel
Patient ID: 1SDX-041SDX-04
Enter thedetails fo patent 2: Name: Garima
Patient ID: 2SMG-029
Enter thedetails fo student 3: Name: Jaya
Patient ID: 1SNF071 ISNF-071
List fo Patients to eb ested are:
1SNF-071Jaya Java 1S DX-04Daniel D
2SMG-029Garima
6 ) Define a class StudentData that holds the following information of a student: id – a String that stores that unique ID o f each student
name – a String indicating the name o f the student.
Note that these fields should b e declared private.
Create another class StudentD a ta Extended with a private attribute named location ( a String that stores the location of the student). In this class, define a method addDetails that stores the details of students; and a method printDetails that outputs the details o f students in the sorted order o f their id. (Both the classes should b e in different packages).
Sample Input/output
Enter the number o f students : 2
Enter the details of Student 1 (id, name, location): B 2 0 0 Aja y Hyderabad
Enter the details of Student 2 (id, name, location): B 1 0 0 Ramesh Hyderabad
The Student Details are:
B 1 0 0 Ramesh Hyderabad
B 2 0 0 Aja y Hyderabad3






