Tag Archives: #WSQ05

Temperature (Use of conditionals)

This program is intented to be an intruction to conditionals statements if and else. 

The program consist in asking the Temperature in Farenheit to the user, transform it into Celcius, print it in the screen and then letting the user know if water would be boiling or not. 

The source code is this:

temp=float(input(“What is the temperature in Fahrenheit? “))

 

temp=5*(temp-32)/9

print(temp,”ºC”)

 

if(temp<100):

    print(“Water is not boiling”)

else:

    print(“Water is boiling”)

Where we can see how we ask for the temperature to the user and then store it in the variable temp, wich in this case I have declared it as a float, just to get decimals nothing more. 

Then we apply the formula to convert Farenheit into Celcius and store it in the same variable we have created before. If we wanted to recieve an integer answer we could use a floor division // instead of the /.

Then comes the conditionals, the if statement evaluates the expression inside the parenthesis and if the expression returns a true value it execute the code below. The else statement is used to have an alternative when the if statemen expresion returns a false, if it does it executes the block of code below that has the appropiate identation.

Here you can have more information and examples to the use of conditional statements.

This is for my of my course.

Temperature #WSQ05

Here’s my temperature program. It’s pretty simple, all I used was ask the user for an input, and then convert the degrees with the formula, and use If and Else to condition to print if water would boil or not at that specific temperature.

 

https://www.dropbox.com/s/qanbejw1i1ohup4/temp.py?dl=0

 

Oscar Ricardo López López A01229116

Temperature converter in python

This little code will help you to convert from farenheit to celcius and it also tells you if at that temperature water can be boiled !

here it is!:

f= float(input(“Cual es la cantidad que quieres convertir de grados Farenheit a Celcius?:  ”))
print(“La cantidad elegida es:  ”,f,)
c=(5*((f-32)/9))
print(“La cantidad en celcius es:  ”,c,)
if c<100:
print(“El agua no hierve a esa temperatura”)
else:
print(“El agua si puede hervir a esta temperatura”)

TEMPERATURE

DIEGO PLASCENCIA A01229988

THIS PROGRAM IS USED TO TRANSFORM A TEMPERATURE GIVEN BY THE USER IN FAHRENHEIT TO CELCIUS AND KNOWING IF THE WATER WILL BOIL AT THAT TEMPERATURE.

<iostream>
using namespace std;
int main (void){
    double t; // variable for temperature.
    double r; // variable for the result.
    cout<< “What is the temperature in Fahrenheit? “<< endl;
    cin>> t;//user introduce the value in Fahrenheit.
    r= (5*(t-32))/9; //formula
    cout<< “A temperature of “<< t << “degrees Fahrenheit is” << r <<“in Celsius”<<endl;
    if (r>=100){ //if r (temperature in celcius) is higher than 100, it will display that water will boil.
        cout<< “Water boils at this temperature”<<endl;}
    else{ //if r (temperature in celcius) is lower than 100, it will display that water will not boil.
        cout<< “Water don’t boil at this temperature”<<endl;   
        }
   
}

WSQ05 Temperature!

Here is my video tutorial on how to do the WSQ05!

https://www.youtube.com/watch?v=iPLWig6ydZo

Hope you enjoy!

Temperature program


Temperature program

Temperature program

I’ve been looking on the course page, and some of my classmates got it correct first, so that helped me to fix the bugs my program had.

WSQ05 Temperature

Temperature

WSQ05 – Temperature

Here is my code of the convertion from Fahrenheit to Celcius on GitHub: https://github.com/JoseSanchez12/Fahrenheit-to-Celcius/blob/master/Convertion

#WSQ05


#WSQ05
I just used an if to make that the program say when the water does boil and when not.
These pages help me. http://www.mclibre.org/consultar/python/lecciones/python_if_else.html
program:
tem=int(input(“give me the temperature in Fahrenhei.”))
c=5*(tem-32)/9
print(“la temperatura en celsius es “,c)
if c < 100:
    print(“Water does not boil at this temperature (under typical conditions).”)
else:
    print(“Water does boil at this temperature (under typical conditions).”) 

#WSQ05

#WSQ05


#WSQ05
I just used an if to make that the program say when the water does boil and when not.
These pages help me. http://www.mclibre.org/consultar/python/lecciones/python_if_else.html
program:
tem=int(input(“give me the temperature in Fahrenhei.”))
c=5*(tem-32)/9
print(“la temperatura en celsius es “,c)
if c < 100:
    print(“Water does not boil at this temperature (under typical conditions).”)
else:
    print(“Water does boil at this temperature (under typical conditions).”) 

#WSQ05