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

Electric Car Inheritance

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create an electric-car subclass that extends a base car class and prints the polymorphic vehicle 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
E1
30000.0
450
Model: E1
Price: 30000.00
Range: 450
Eco Fee: 600.00
Input: car model = "E1", base price = 30000.0, battery range = 450.
Key calculation(s): "Model: " + "E1" = "Model: E1" | "Price: " + String.format("%.2f", 30000.0) = "Price: 30000.00".
Output:
Model: E1
Price: 30000.00
Range: 450
Eco Fee: 600.00
Sample #2
Public sample
E2
42000.5
520
Model: E2
Price: 42000.50
Range: 520
Eco Fee: 840.01
Input: car model = "E2", base price = 42000.5, battery range = 520.
Key calculation(s): "Model: " + "E2" = "Model: E2" | "Price: " + String.format("%.2f", 42000.5) = "Price: 42000.50".
Output:
Model: E2
Price: 42000.50
Range: 520
Eco Fee: 840.01

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