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

Unit Price Total

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read quantity and unit price, then print the quantity and total value.

Input Format

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

  1. quantity
  2. unit price

Output Format

Print the exact report in this order:

  1. Quantity
  2. Total

Sample Testcases

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

Sample #1
Public sample
3
4.5
Quantity: 3
Total: 13.50
Input: quantity = 3, unit price = 4.5.
Key calculation(s): total = 3 * 4.5 | "Quantity: " + 3 = "Quantity: 3" | "Total: " + String.format("%.2f", total) = "Total: 13.50".
Output:
Quantity: 3
Total: 13.50
Sample #2
Public sample
10
2.0
Quantity: 10
Total: 20.00
Input: quantity = 10, unit price = 2.0.
Key calculation(s): total = 10 * 2.0 | "Quantity: " + 10 = "Quantity: 10" | "Total: " + String.format("%.2f", total) = "Total: 20.00".
Output:
Quantity: 10
Total: 20.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