0% found this document useful (0 votes)
7 views2 pages

Java Assignment1 1

The document outlines an assignment set for programming in Java, consisting of five questions that cover various concepts such as variables, conditionals, arrays, and loops. Each question includes specific tasks, such as hospital room allocation, movie ticket sales analysis, cricket scoreboard management, online shopping cart calculations, and student marks analysis. Students are instructed to provide proper coding practices, explanations, and submit their work by the deadline without using AI-generated code.

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)
7 views2 pages

Java Assignment1 1

The document outlines an assignment set for programming in Java, consisting of five questions that cover various concepts such as variables, conditionals, arrays, and loops. Each question includes specific tasks, such as hospital room allocation, movie ticket sales analysis, cricket scoreboard management, online shopping cart calculations, and student marks analysis. Students are instructed to provide proper coding practices, explanations, and submit their work by the deadline without using AI-generated code.

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/ 2

Programming in Java - Assignment Set

Instructions:

1. Attempt all questions. Each question has multiple sub-parts. Ensure you provide proper variable
declarations, comments, and output screenshots wherever applicable.
2. Do not submit code directly generated from AI tools. Your explanation, thought process, and
structured coding approach will be graded.
3. Deadline: Submit your assignment by the announced date in LMS.

Q1. Hospital Room Allocation (Variables, Data Types, Conditionals)

- Define proper variables and literals to represent a patient’s details (name, age, ward type).

- Write logic using conditionals to allocate the ward.

- Extend your code: if the hospital is full (ward capacity reached), print 'Waitlisted'. Hint: Use
constants for capacity.

Q2. Movie Theatre Ticket Counter (Looping, Arrays)

- Use a 1D array to store the number of tickets sold each day for 7 days.

- At the end of the week, calculate: Total tickets sold, Day with maximum tickets, Average
per day.

- Twist: If total tickets ≥ 500, print 'Profitable week', else 'Needs Improvement'.

Q3. Cricket Scoreboard (2D Arrays + Loops)

- Use a 2D array to store runs scored by 2 teams across 5 overs.

- Display: Total runs of each team, Which team won, Over number with highest runs for the
winning team.

- Extra: Handle the case of a tie.

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

- Store prices of 5 items in an array and quantities in another.

- Calculate the bill for each item and grand total.

- If grand total > ■2000, print '10% discount'. Otherwise, 'No discount'.

- Twist: Add a flat ■100 delivery charge if discounted bill < ■1500.

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

- Store marks of 4 students in 3 subjects in a 2D array.


- Print each student’s average and find the topper.

- Print subject-wise averages.

- Twist: If any student scores < 35 in a subject, print 'Student X has failed in Subject Y'.

Submission Rubric:

- Correctness of logic and implementation - 40%

- Proper use of Java syntax, variables, and control structures - 20%

- Code readability (indentation, comments, meaningful variable names) - 20%

- Handling of extra twists/challenges in questions - 10%

- Neat submission and explanation - 10%

You might also like