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

Temperature Convert

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read a Celsius value and print both Celsius and Fahrenheit with two decimals.

Input Format

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

  1. temperature in Celsius

Output Format

Print the exact report in this order:

  1. Celsius
  2. Fahrenheit

Sample Testcases

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

Sample #1
Public sample
0.0
Celsius: 0.00
Fahrenheit: 32.00
Input: temperature in Celsius = 0.0.
Key calculation(s): fahrenheit = (0.0 * 9.0 / 5.0) + 32.0 | "Celsius: " + String.format("%.2f", 0.0) = "Celsius: 0.00" | "Fahrenheit: " + String.format("%.2f", fahrenheit) = "Fahrenheit: 32.00".
Output:
Celsius: 0.00
Fahrenheit: 32.00
Sample #2
Public sample
25.0
Celsius: 25.00
Fahrenheit: 77.00
Input: temperature in Celsius = 25.0.
Key calculation(s): fahrenheit = (25.0 * 9.0 / 5.0) + 32.0 | "Celsius: " + String.format("%.2f", 25.0) = "Celsius: 25.00" | "Fahrenheit: " + String.format("%.2f", fahrenheit) = "Fahrenheit: 77.00".
Output:
Celsius: 25.00
Fahrenheit: 77.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