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

Nullable Discount Engine

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read a raw price and raw discount percentage, then print the final price. Handle missing data and invalid numbers explicitly.

Input Format

Input is given as whitespace-separated raw tokens exactly in the order described by the problem statement.

Output Format

Print the exact success report or exact error message 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
100.0
10.0
Final Price: 90.00
Input: raw price = "100.0", raw discount = "10.0".
Derivation: finalPrice = 100.00 * (1 - (10.00 / 100)) = 90.00 | "Final Price: " + "90.00" = "Final Price: 90.00".
Output:
Final Price: 90.00
Sample #2
Public sample
50
5
Final Price: 47.50
Input: raw price = "50", raw discount = "5".
Derivation: finalPrice = 50.00 * (1 - (5.00 / 100)) = 47.50 | "Final Price: " + "47.50" = "Final Price: 47.50".
Output:
Final Price: 47.50

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