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

Gross And VAT Total

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read a base price and VAT rate, then print the price before and after VAT.

Input Format

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

  1. base price
  2. VAT percentage

Output Format

Print the exact report in this order:

  1. Base
  2. Total

Sample Testcases

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

Sample #1
Public sample
10.0
16.0
Base: 10.00
Total: 11.60
Input: base price = 10.0, VAT percentage = 16.0.
Key calculation(s): total = 10.0 * (1 + (16.0 / 100.0)) | "Base: " + String.format("%.2f", 10.0) = "Base: 10.00" | "Total: " + String.format("%.2f", total) = "Total: 11.60".
Output:
Base: 10.00
Total: 11.60
Sample #2
Public sample
25.5
8.0
Base: 25.50
Total: 27.54
Input: base price = 25.5, VAT percentage = 8.0.
Key calculation(s): total = 25.5 * (1 + (8.0 / 100.0)) | "Base: " + String.format("%.2f", 25.5) = "Base: 25.50" | "Total: " + String.format("%.2f", total) = "Total: 27.54".
Output:
Base: 25.50
Total: 27.54

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