Previous Next
0 / 11
Module DEMO-33-62DEMO-OOP-33

Salary Slip Starter

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read the base salary, allowance, and deduction, then print a salary slip summary.

Input Format

Input is given as whitespace-separated tokens in this order:

  1. base salary
  2. allowance
  3. deduction

Output Format

Print the exact report in this order:

  1. Base
  2. Net

Sample Testcases

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

Sample #1
Public sample
500.0
50.0
20.0
Base: 500.00
Net: 530.00
Input: base salary = 500.0, allowance = 50.0, deduction = 20.0.
Key calculation(s): net = 500.0 + 50.0 - 20.0 | "Base: " + String.format("%.2f", 500.0) = "Base: 500.00" | "Net: " + String.format("%.2f", net) = "Net: 530.00".
Output:
Base: 500.00
Net: 530.00
Sample #2
Public sample
700.0
0.0
35.5
Base: 700.00
Net: 664.50
Input: base salary = 700.0, allowance = 0.0, deduction = 35.5.
Key calculation(s): net = 700.0 + 0.0 - 35.5 | "Base: " + String.format("%.2f", 700.0) = "Base: 700.00" | "Net: " + String.format("%.2f", net) = "Net: 664.50".
Output:
Base: 700.00
Net: 664.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