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

Temperature Ratio Console

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Parse two temperatures and print the ratio of the current temperature to the base temperature. Handle invalid numbers and a zero base.

Input Format

Input is given as whitespace-separated raw tokens exactly in the order described by the problem statement.

Output Format

Print the exact success report or exact error message required by the problem.

Sample Testcases

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

Sample #1
Public sample
20
5
Ratio: 4.00
Input: current temperature = "20", base temperature = "5".
Derivation: ratio = 20 / 5 = 4.00 | "Ratio: " + "4.00" = "Ratio: 4.00".
Output:
Ratio: 4.00
Sample #2
Public sample
7
2
Ratio: 3.50
Input: current temperature = "7", base temperature = "2".
Derivation: ratio = 7 / 2 = 3.50 | "Ratio: " + "3.50" = "Ratio: 3.50".
Output:
Ratio: 3.50

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