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

Cargo Truck Inheritance

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create a cargo-truck subclass that extends a vehicle base class and prints the remaining capacity report.

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
T1
1000
300
Plate: T1
Capacity: 1000
Remaining Capacity: 700
Input: plate code = "T1", capacity = 1000, current load = 300.
Key calculation(s): "Plate: " + "T1" = "Plate: T1" | "Capacity: " + 1000 = "Capacity: 1000".
Output:
Plate: T1
Capacity: 1000
Remaining Capacity: 700
Sample #2
Public sample
T2
800
800
Plate: T2
Capacity: 800
Remaining Capacity: 0
Input: plate code = "T2", capacity = 800, current load = 800.
Key calculation(s): "Plate: " + "T2" = "Plate: T2" | "Capacity: " + 800 = "Capacity: 800".
Output:
Plate: T2
Capacity: 800
Remaining Capacity: 0

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