Temperature

Hi!

Welcome again. Now I made a code using temperature.

Instructions:

Write a program that will prompt the user for a temperature in Fahrenheit and then convert it to Celsius. You may recall that the formula is C = 5 ∗ (F − 32)/9.

Modify the program to state whether or not water would boil at thetemperature given. Your output might look like the following.

And this is the Code:

temp

The main point is to convert Fahrenheit degrees to Celsius degrees. We all know that simple formula to convert the degrees: C = 5 ∗ (F − 32)/9.

Steps:

  1. Ask to the user to write the Celsius degrees (remember to save the variable with CIN).
  2. Use the formula in a way the computer can understand and the computer is going to convert the degrees.
  3. Show the Celsius Degrees.

Now I’m going to introduce IF and ELSE.

We use IF and ELSE to compare two or more sets of data and tests the results. If the results are true, the THEN instructions are taken; if not, the ELSE instructions are taken. (http://www.pcmag.com/encyclopedia/term/44748/if-then-else).

In this case IF temperature is more than 100° Celsius it will show up a message (“El agua hierve a esta temperatura”). BUUUUUT IF NOT it will show you another message (“El agua no hierve a esta temperatura”).

The basic structure is:

If (condition)

{ make this }

else

{ make this }

It isn’t really difficult. I have some knowledge of this because I took a course of an introduction to code.

Thanks for coming! See you later.

Code Link:

https://www.dropbox.com/s/5nynn2ucy8pluf3/Temperature.cpp?dl=0

Fun with numbers

Hello.

In this post I will show you basic math operations. Here’s the instructions:

  • The difference of the two numbers.
  • The product of the two numbers.
  • The integer based division of the two numbers (so no decimal point). First divided by second.
  • The remainder of integer division of the two numbers.

And this is the code:

numeros

It is a basic structure to have the difference, product, integer division and ramainder. As you can see I used variables. The variable tells the compiler where and how much to create the storage for the variable (http://www.tutorialspoint.com/cplusplus/cpp_ variable_types.htm).

The basic variable of Integer numbers is INT. As you can see in the image you have to write next to INT the variables that you want to use. In this case we have 6:

  1. num1
  2. num2
  3. resta
  4. producto
  5. division
  6. residuo

But now we are using CIN. The opposite of COUT. We have to use it when we want to ask to the user for values and put it here:

numeros1

Under the COUT.

Then we write the operations with the respective variable.

Finally COUT is used to write the final message. To present the variable you have to write it between << variable << and it will show up the answer.

 

Thank you for see my post! See you Later.

 

Flipped Learning / #AbolishGrades

Can we imagine a class with out grades? Well, it’s difficult to imagine the concept.

I have many experiences with this kind of class but this time is #AbolishGrades at 100%. My experience here depends on what kind of class is or more digested in what subject is.

I think that science classes are not the best options in the flipped learning because we really need an explanation of the topics. How to do it, how to practice, how to use it in the real life, etc.

Then I think that there’s others practical subjetc in which flipped learning can be more potential than the old method.

In this case, in my Code Class I really like to use #AbolishGrades because in that way I can read and read and find more information than in an usual class. I learn in that way several things in the past and know I’m aware is a functional way to learn.

My first code!

This is my first code and my first video showing what I did. I know is not a perfect video but the next ones will be better. So, I hope you can use this 😉

Here’s the link of the video:

https://www.dropbox.com/s/zo2ifp75iwpjzh8/Mi%20pel%C3%ADcula.mp4?dl=0

The instructions was:

Get your program to print (on the terminal/shell) the message “Hello World”. Yes, that simple. Remember you are doing this at the terminal, NOT inside an IDE like Code::Blocks, Eclipse, Xcode.

For this code my only helper was my teacher (https://twitter.com/ken_bauer). And here is a picture of it:

helloworld

With this code I learn how to introduce a text line. We use:

*#include <iostream> (Introduce the library).

*Using namespace std (To use cout as simple as you can see [without std::cout] because we know that we are going to use it several times).

*int main() (To introduce functions).

*COUT (to WRITE A TEXT LINE!).

*return 0 (it means that we finish the code with no problems).

(Remember to use the keys correctly).

To run the program we use CYGWIN:

helloworldcyg.png

STEPS:

  1. Write the location of the file.
  2. Use “ls” and it shows you the list of the folder.
  3. Use “g++” to compile and then write the file’s name. (If it shows you an error is because something in the code is wrong).
  4. Finally write “./a.exe” to execute the program.

 

Thank you for see my post and see you in my next. Have a nice day.