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

Invoice Total Method

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read quantity, unit price, and tax rate, implement invoiceTotal, and print the final total.

Input Format

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

  1. quantity
  2. unit price
  3. tax rate

Output Format

Print the exact report in this order:

  1. Total

Sample Testcases

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

Sample #1
Public sample
2
10.0
16.0
Total: 23.20
Input: quantity = 2, unit price = 10.0, tax rate = 16.0.
Key calculation(s): subtotal = 2 * 10.0 | "Total: " + String.format("%.2f", result) = "Total: 23.20".
Output:
Total: 23.20
Sample #2
Public sample
5
4.5
5.0
Total: 23.62
Input: quantity = 5, unit price = 4.5, tax rate = 5.0.
Key calculation(s): subtotal = 5 * 4.5 | "Total: " + String.format("%.2f", result) = "Total: 23.62".
Output:
Total: 23.62

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