0
Please help me
Question- Celsius to Fahrenheit You are making a Celsius to Fahrenheit converter. Write a function to take the Celsius value as an argument and return the corresponding Fahrenheit value. Sample Input 36 Sample Output 96.8 The following equation is used to calculate the Fahrenheit value: 9/5 * celsius + 32 How can i do this question?
14 Answers
+ 3
This is right or full code
+ 3
celsius = int(input())
def conv(c):
#your code goes here
res= 9/5 * c + 32
return res
fahrenheit = conv(celsius)
print(fahrenheit)
0
Just make a function that takes celsius as a parameter and returns the result of the the formula you have in your question and print the returned value.
0
Try it yourself first and if you can't figure it out without the clues given then post the code from your try and we'll help you out. It's really permitted to just give the answers to the challenges here on SL.
0
Def fun(c):
return ((9/5) *c)+32
0
But it is showing that test case 2,3 and 4 is wrong while the test case 1 is right.
Test case 2 it is input 0 and expected output was 32.0.
Test case 3 it is input 18 and expected output is 64.4
I have written the code as
celsius = 36
def func(c):
return ((9/5)*c) +32
fahrenheit = (9/5 * celsius)+32
print(fahrenheit)
Please help
0
celsius = int(input())
def conv(c):
#your code goes here
return ((9 / 5) * c) + 32
fahrenheit = conv(celsius)
print(fahrenheit)
Got it.....
0
Sample Input
36
Sample Output
96.8
0
celsius = int(input())
def conv(c):
conv=((9/5)*celsius+32)
fahrenheit=float()
return conv
fahrenheit = conv(celsius)
print(fahrenheit)
0
Great!
0
import java.util.Scanner;
public class Program {
static double temp(double celsius){
double fahr = (1.8 * celsius) +32;
return fahr;
}
//your code goes here
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double c = sc.nextDouble();
double fahr = temp(c);
System.out.println(fahr);
}
}
This is the easiest way to run it in Java
- 1
Pleaase help with the code chaoticdog and naveen rathore because I know you have completed the course
- 4
I actually wanted the full code
Please help me with the full code Chaoticdawg