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

Premium Ticket Inheritance

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Model premium tickets using inheritance and overriding, then print the final payable amount.

Input Format

Input is given as whitespace-separated tokens for the base-class fields first, followed by the child-class fields.

Output Format

Print the exact multiline report required by the problem.

Sample Testcases

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

Sample #1
Public sample
Hero
5.0
1.0
Movie: Hero
Base Price: 5.00
Total: 6.00
Input: movie title = "Hero", base price = 5.0, service fee = 1.0.
Key calculation(s): "Movie: " + "Hero" = "Movie: Hero" | "Base Price: " + String.format("%.2f", 5.0) = "Base Price: 5.00".
Output:
Movie: Hero
Base Price: 5.00
Total: 6.00
Sample #2
Public sample
Drama
7.5
0.5
Movie: Drama
Base Price: 7.50
Total: 8.00
Input: movie title = "Drama", base price = 7.5, service fee = 0.5.
Key calculation(s): "Movie: " + "Drama" = "Movie: Drama" | "Base Price: " + String.format("%.2f", 7.5) = "Base Price: 7.50".
Output:
Movie: Drama
Base Price: 7.50
Total: 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