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

Currency Exchange

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read an amount and exchange rate, then print the original and converted values.

Input Format

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

  1. amount in JOD
  2. exchange rate

Output Format

Print the exact report in this order:

  1. JOD
  2. Converted

Sample Testcases

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

Sample #1
Public sample
10.0
1.41
JOD: 10.00
Converted: 14.10
Input: amount in JOD = 10.0, exchange rate = 1.41.
Key calculation(s): converted = 10.0 * 1.41 | "JOD: " + String.format("%.2f", 10.0) = "JOD: 10.00" | "Converted: " + String.format("%.2f", converted) = "Converted: 14.10".
Output:
JOD: 10.00
Converted: 14.10
Sample #2
Public sample
5.5
0.89
JOD: 5.50
Converted: 4.90
Input: amount in JOD = 5.5, exchange rate = 0.89.
Key calculation(s): converted = 5.5 * 0.89 | "JOD: " + String.format("%.2f", 5.5) = "JOD: 5.50" | "Converted: " + String.format("%.2f", converted) = "Converted: 4.90".
Output:
JOD: 5.50
Converted: 4.90

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