Now, in this program, you will try to guess the number I´m thinking in.
First, I will assign a value to the number. Then you´re going to ingress a number and the program will tell you if the number is smaller or bigger than my number.
And here is the code:
And here is when it runs:
The link to the code on GitHub is:
In this project I´m going to make a program that converts from Fahrenheit degrees to Celcius degrees.
The code is simple, but it has a little level of difficulty.
Once I finished this is how it runs:
Also the code will be on GitHub here:
Now I´m going to use the operators in C++.
You have to enter two numbers and the program will calculate:
- 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.
So I started creating the code, it looks like this:
Then, when I run it shows this:
This is the first time I actually start to program.
I´m going to make a program that, when it runs, it will say “Hello world”.
This is the code I made on XCode.
Once it runs the program will be show here:
And finally this is how it looks:
First we need a code editor, so I chose Atom.
This is how it looks:
Then we need to setup the machine to run the compiler (g++), I used Homebrew to install the packages into the directory.
I copied the code to the terminal and the packages installed.
Also you can use the command-line tool for XCode to set this up.
Once you have already installed the packages your computer is set to compile.