Previous Next
0 / 15
Module DEMO-33-69DEMO-OOP-33

Clinic Queue Simulator

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create two Java files: Main.java and ClinicVisit.java.

Read the required values, construct a ClinicVisit object, and print a multiline report.

The report must contain these lines in this order:

  1. Patient
  2. Estimated Slot
  3. Total Bill

Use a constructor and keep the object-oriented structure clear.

Input Format

Input is provided as separate whitespace-separated tokens in the same order described in the problem statement.

Output Format

Print the exact multiline report required by the question.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
P1
3
10.0
4.5
Patient: P1
Estimated Slot: 30
Total Bill: 14.50
Input: patient code = "P1", queue number = 3, consultation fee = 10.0, tests fee = 4.5.
Key calculation(s): "Patient: " + "P1" = "Patient: P1" | "Estimated Slot: " + 3 * 10 = "Estimated Slot: 30".
Output:
Patient: P1
Estimated Slot: 30
Total Bill: 14.50
Sample #2
Public sample
P2
1
8.0
0.0
Patient: P2
Estimated Slot: 10
Total Bill: 8.00
Input: patient code = "P2", queue number = 1, consultation fee = 8.0, tests fee = 0.0.
Key calculation(s): "Patient: " + "P2" = "Patient: P2" | "Estimated Slot: " + 1 * 10 = "Estimated Slot: 10".
Output:
Patient: P2
Estimated Slot: 10
Total Bill: 8.00

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings