Previous Next
0 / 10
Module DEMO-33-64DEMO-OOP-33

Inventory Math Helper

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create Main.java and InventoryMath.java.

Read opening stock, incoming stock, and sold stock. Use the helper class to compute the ending stock and print Ending stock = X.

Sample Testcases

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

Sample #1
Public sample
20 5 7
Ending stock = 18
Input: opening = 20, incoming = 5, sold = 7.
Key calculation: ending stock = 20 + 5 - 7 = 18.
Output:
Ending stock = 18
Sample #2
Public sample
100 30 40
Ending stock = 90
Input: opening = 100, incoming = 30, sold = 40.
Key calculation: ending stock = 100 + 30 - 40 = 90.
Output:
Ending stock = 90

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