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

Streaming Subscription Inheritance

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create a streaming-subscription subclass that extends a base subscription class and prints the discounted 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
Basic
3
5.0
Plan: Basic
Months: 3
Payable: 31.00
Input: plan name = "Basic", months = 3, discount amount = 5.0.
Key calculation(s): "Plan: " + "Basic" = "Plan: Basic" | "Months: " + 3 = "Months: 3".
Output:
Plan: Basic
Months: 3
Payable: 31.00
Sample #2
Public sample
Pro
6
12.0
Plan: Pro
Months: 6
Payable: 60.00
Input: plan name = "Pro", months = 6, discount amount = 12.0.
Key calculation(s): "Plan: " + "Pro" = "Plan: Pro" | "Months: " + 6 = "Months: 6".
Output:
Plan: Pro
Months: 6
Payable: 60.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