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

Sum Button Panel

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create a Swing panel with two text fields, a button, and a label. The label must show the sum after the action event.

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
3
4
Sum: 7
Input: first value = 3, second value = 4.
Derivation: total = 3 + 4 = 7 | "Sum: " + 7 = "Sum: 7".
Final label text:
Sum: 7
Sample #2
Public sample
10
20
Sum: 30
Input: first value = 10, second value = 20.
Derivation: total = 10 + 20 = 30 | "Sum: " + 30 = "Sum: 30".
Final label text:
Sum: 30

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