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

Employee Payroll Card

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create Main.java and PayrollCard.java.

Implement the class using private fields plus getters and setters.

Use the object to print the required report exactly as described.

Input Format

Input is given as whitespace-separated tokens in the order stated in the question.

Output Format

Print the exact multiline report required by the question.

Sample Testcases

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

Sample #1
Public sample
Lina
500.0
50.0
Employee: Lina
Net Pay: 550.00
Input: employee = "Lina", base salary = 500.0, bonus = 50.0.
Key calculation(s): "Employee: " + "Lina" = "Employee: Lina" | "Net Pay: " + String.format("%.2f", getBaseSalary() + 50.0) = "Net Pay: 550.00".
Output:
Employee: Lina
Net Pay: 550.00
Sample #2
Public sample
Omar
700.0
0.0
Employee: Omar
Net Pay: 700.00
Input: employee = "Omar", base salary = 700.0, bonus = 0.0.
Key calculation(s): "Employee: " + "Omar" = "Employee: Omar" | "Net Pay: " + String.format("%.2f", getBaseSalary() + 0.0) = "Net Pay: 700.00".
Output:
Employee: Omar
Net Pay: 700.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