0% found this document useful (0 votes)
3 views14 pages

24csu205 Srishti JavaAssignment

Uploaded by

24csu205
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views14 pages

24csu205 Srishti JavaAssignment

Uploaded by

24csu205
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Name: Srishti

Roll No.:24csu205

Q1. Hospital Room Allocation (Variables, Data Types,


Conditionals)
Output:
Explanation:

This program helps allocating hospital rooms (wards) to patients based on their age and
availability of ward in the hospital room.
It keeps track of how many patients are already admitted in General Ward, Private Ward,
and Icu, and checks if a new patient can be admitted or has to wait if there is no room
available.

Q2. Movie Theatre Ticket Counter (Looping, Arrays)


Output:
Explanation:

This program helps a movie theatre keep track of ticket sales for 7 days.
It records the number of tickets sold each day,calculates the total tickets sold in the
week,the average tickets sold per day and finds which day had the maximum ticket sales.

Q3. Cricket Scoreboard (2D Arrays + Loops)


Output:
Explanation:

This program keeps a record of runs scored by 2 teams for 5 overs each.
It calculates the total runs for both teams individually and which team won (or if it’s a tie).
Finds the over with the highest runs for the winning team.

Q4. Online Shopping Cart (Literals + Arrays + Looping)


Output:
This is simple shopping cart system.The user enters how many items they want to buy for
each product.It calculates the total bill and applies a 10% discount if the total is above
rupees 1000.It also adds rupees 100 delivery charge if the final bill is less than rupees
1500. Finally prints out the detailed bill.

Q5. Student Marks Analysis (2D Arrays, Loops, Conditionals)


Output:
Explanation:
This program takes marks of 4 students in 3 subjects (Java, PFDS,
DBMS). It then calculates the average marks of each student and
also checks if any student has failed in a subject condition is
already define din the code above (if marks<35 the student is fail).It
then finds the topper .it finally calculates the average marks in each
subject among all the students.

You might also like