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

Student Discount Panel

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create a Swing panel with a price field, checkbox, button, and label. Clicking the button must apply the student discount when the checkbox is selected.

Input Format

Input is given as whitespace-separated values and is used by Main.java to simulate the GUI interaction.

Output Format

Print the final label text returned by the simulation.

Sample Testcases

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

Sample #1
Public sample
100.0
1
Total: 90.00
Input: base price = 100.0, student checkbox state = 1.
Derivation: total = 100.00 * 0.90 = 90.00 | "Total: " + "90.00" = "Total: 90.00".
Final label text:
Total: 90.00
Sample #2
Public sample
50.0
0
Total: 50.00
Input: base price = 50.0, student checkbox state = 0.
Derivation: total = 50.00 because the checkbox is not selected | "Total: " + "50.00" = "Total: 50.00".
Final label text:
Total: 50.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