WSQ 03 – Pick a Number

I completed my assignment for Week 4.

I learnt how to ask the computer for a random function. I had to include the libraries <cstlib> and <ctime>.

For the random number I used the code:

srand(time(NULL));
int secret = rand () % 100 + 1;

I also did a loop using while () and I introduced conditionals inside while.

Captura

Fun with Numbers (Week 02)

Today I spent almost 3 hours trying to understand how to calculate values using integers that the user inserted. The best method for doing this assignment was to work through trial and error. I googled doubts I had such as how to insert a new line so that it wouldn’t look crowded. The final result is shown on the image.

Here I learnt how to introduce an integer into my code and as the user to assign it a value with cin >> .

Captura 1

 

My first class

I just had my first class. There was so much to do, that I actually did not do anything because I got confused. When I got home I started reading a book called How to think like a computer scientist by Allen B. Downey to understand what I had to do, and I watched several videos.

I downloaded Atom, to write my code, and installed a Bash terminal on my Windows 10 laptop. After that, I wrote my first code: Hello world. I executed it and it worked!!

For this task I understood the main structure of a code as well as how to use cout. 

I learnt the Matery Topics #2, #3, #4, & #5

 

Captura