Build a TemperatureConverter Class

Hard Method Types & Behaviors PRO
🔒 Login to Unlock

Problem Statement

Build a `TemperatureConverter` class with two static methods: `c_to_f(c)` and `f_to_c(f)`. Read a type (‘C’ or ‘F’) and a float value. Convert and print ‘Result: [value]’ formatted to 2 decimal places.

Input Format

A single character ('C' or 'F') and a float separated by space.

Output Format

Print the converted temperature to 2 decimal places.

Constraints

Assume standard conversion formulas.

Sample Input

C 100

Sample Output

Result: 212.00

Explanation

Applies static utility methods in a practical, unified class context.

Starter Code

class TemperatureConverter:
    # Define c_to_f and f_to_c static methods
    pass

if __name__ == '__main__':
    t, v = input().split()
    val = float(v)
    # Convert based on type and print
    pass

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used