Random number generator

--Originally published at My TC1017 programming class

Here is a random number generator. There are some annotations on the program itself, and as always, I will put the link to the Google Drive document.

 

I personally had some trouble understanding the srand seed. There is a small description on the cpp file that explains a little bit on how it works.

https://drive.google.com/open?id=0B8vzJAbVok1MLUttZERaTFhtXzQ

Random number generator: http://www.cplusplus.com/reference/cstdlib/rand/

Seed for random number:

http://www.cplusplus.com/reference/cstdlib/srand/


Homework 03

--Originally published at Blog de Esteban

This task was a little bit more difficult, I relay had no idea so I started to watch youtube tutorials because I didn´t understand the explanation from the book. At the end, the algorithm works and I´m so proud of it.

Here I attach a photo of my program working:

Download link: https://www.dropbox.com/s/31npytul84x6746/Tarea3.cpp?dl=0

Pick a number

--Originally published at Future Queen of C++

It took me almost a whole week to work on this task, and my main problem was that in the start I put <time.h> instead of <ctime>, this was the only thing that was wrong and I spend days stressing because of it. When Ken help me out and correct it, I do some research to make it count the times of tries.

http://www.cplusplus.com/reference/cstdlib/rand/

http://logpracticas2013.blogspot.mx/2013/04/c-introduccion-de-datos-contadores-y.html

http://www.aprenderaprogramar.com/index.php?option=com_content&view=article&id=917:generar-numeros-o-secuencias-aleatorios-en-c-intervalos-srand-y-rand-time-null-randmax-cu00525f&catid=82&Itemid=210

 

Click to view slideshow.

Guess the random number (WSQ 03)

--Originally published at TC1017 (Python3) – Titel der Website

The task was to write a program were the User have to guess the random number between 1 – 100. The random number is to be selected by the program.

After the guess the program have to tell you if your guess is to low or to high. And every time when the user do a guess, the sum of the guesses should be counted. When the User finally guesses the correct number, the program have to say that it is the correct number with the sum of the tryings.

 

The problem

Before a could start to write the program i had to inform myself for the issue with the random number. I never had a task like this with eclipse before. So I had no idea how program a random number between 1 – 100.

In my internet research i found a simple video for this problem.

 

The biggest challenge in this program was to build a loop while the user dont get the random number wich was chosen from the program.

The keyword while helped me a lot in this case. So i just choose a while loop wich i knew from Java programming.

The program

WSQ03 - SourceCode- RandomNumber.PNG

 

The result

WSQ03 - Ergebnis - Random Number.PNG


Pick a Number

--Originally published at Valeria CT

This was the assignment that I’ve struggled with the most. I had to read a lot, reasearch many terms and ask for help. After about three days working on this, I finally figured out a simple way to write the code.

The resources that I used were:

The picture of my code running can be found on top.

-Valeria


WSQ 03

--Originally published at Blog TC1017

Guess the number.

This code is about guessing one number between 1 to 100 that the pc picked randomly (X). If you give a number and is lower than the X, then it will display a message saying that your number is lower and vice-versa.

Here is a link to the code —–> https://www.dropbox.com/s/wvi33ntxok5dbo3/RandN.cpp?dl=0

RandN