Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/feed-rss2.php on line 8
‘#WSQ06’ Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Mon, 23 Nov 2015 16:39:06 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ Try Again. WSQ06 https://kenscourses.com/tc101fall2015/2015/try-again-wsq06-2/ Mon, 23 Nov 2015 16:39:06 +0000 http://andressava.wordpress.com/?p=100 ]]> Hi, we’re back. Well for this WSQ we need some new libraries and a accumulator in which we will be able to store the number of fails the player did obtain, and that’s all is pretty simple this time. Down below you will find the code.

Have a nice week.

 

The Source Code

 

flickr photo by Christopher Ludtke
https://www.flickr.com/photos/imhof89/22112428156/
Some Rights Reserved

]]>
https://creativecommons.org/licenses/by/4.0/
Try Again. WSQ06 https://kenscourses.com/tc101fall2015/2015/try-again-wsq06/ Mon, 23 Nov 2015 16:39:06 +0000 http://andressava.wordpress.com/?p=100 ]]> Hi, we’re back. Well for this WSQ we need some new libraries and a accumulator in which we will be able to store the number of fails the player did obtain, and that’s all is pretty simple this time. Down below you will find the code.

Have a nice week.

 

The Source Code

 

flickr photo by Christopher Ludtke
https://www.flickr.com/photos/imhof89/22112428156/
Some Rights Reserved

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ06 https://kenscourses.com/tc101fall2015/2015/wsq06-26/ Thu, 12 Nov 2015 15:42:46 +0000 http://estebanpg.wordpress.com/?p=29 https://github.com/estebanpinal/WSQ/blob/master/WSQ06

Me tope con pared con este programa tuve que ir a asesorias para poder lograrlo

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ06 https://kenscourses.com/tc101fall2015/2015/wsq06-24/ Fri, 30 Oct 2015 13:32:17 +0000 http://alansprogramming.wordpress.com/?p=108 ]]> Randomness abounds.

Random

So many possibilities… “/the missus and me fart out 10 random SW idiots” by nolnet. Photo used for academic purposes only. Link: https://www.flickr.com/photos/nolnet/4873057384

So for this WSQ, I had to check the <ctime> library and why it worked for assigning random numbers, several times. It ended up being quite easy, as with C++ the same thing can be done in different ways (Thank you cplusplus.com!).

Here’s the GitHub link to WSQ 6.

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ6: Random Numbers https://kenscourses.com/tc101fall2015/2015/wsq6-random-numbers-2/ Mon, 26 Oct 2015 01:50:21 +0000 http://ivancortes96.wordpress.com/?p=33 Seguir leyendo WSQ6: Random Numbers ]]> This WSQ was really hard because it was completely different of what the others WQS were about. I did knew how to make random numbers so i just looked up on google. after that I read about it in the book, and in some way I managed to make the code run and to work.

Link to my code:

https://github.com/cortesivan96/WSQs/blob/master/Random

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ06 – Pick a Number https://kenscourses.com/tc101fall2015/2015/wsq06-pick-a-number-12/ Thu, 08 Oct 2015 22:40:57 +0000 http://finntec.wordpress.com/?p=38 ]]> Again is used these Python 3 programming examples. There I found how to use while-loops.

Here is my code:

import random
numCom = random.randrange(1, 101)

numUs = int( input( "Give me a number between 1 and 100: "))

attempt = int(1)
while numCom != numUs :
    attempt = attempt + 1
    
    if (numCom < numUs) :
        print( "My number is smaller.")
        numUs = int( input( "Give me a another number: "))
    else :
        print ( "My number is greater.")
        numUs = int( input( "Give me a another number: "))
        
print(numCom,"was the right number!")
print("You needed",attempt,"attempts.")

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ06!! https://kenscourses.com/tc101fall2015/2015/wsq06-19/ Fri, 25 Sep 2015 18:01:05 +0000 https://vanessabaeza.withknown.com/2015/wsq06

Here is my code, you have to guess a number that is randomly selected by the program. I did it with no help (except for the time/rand thing).

Hope this helps you!

#WSQ06 #Tc1017

 

#include

#include

#include

using namespace std;

 

int main() {

  srand(time(0));           //time changes, the number changes

  int r=1+(rand() % 100);

  int x;

  int count = 0;

  cout

 

cout

cin >>x;

count = count+1;

 

while (x!=r){

  if(x

  cout

  cin >>x;

  count = count + 1;

} else {

  if (x>r){

      cout

      cin >>x;

      count = count + 1;

 }

  }

}

 

cout

  return 0;

 

}

]]>

Here is my code, you have to guess a number that is randomly selected by the program. I did it with no help (except for the time/rand thing).

Hope this helps you!

#WSQ06 #Tc1017

 

#include

#include

#include

using namespace std;

 

int main() {

  srand(time(0));           //time changes, the number changes

  int r=1+(rand() % 100);

  int x;

  int count = 0;

  cout

 

cout

cin >>x;

count = count+1;

 

while (x!=r){

  if(x

  cout

  cin >>x;

  count = count + 1;

} else {

  if (x>r){

      cout

      cin >>x;

      count = count + 1;

 }

  }

}

 

cout

  return 0;

 

}

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ06 https://kenscourses.com/tc101fall2015/2015/wsq06-18/ Thu, 24 Sep 2015 00:38:39 +0000 http://tonygarciavz.wordpress.com/?p=38 Continue reading

]]>
In this WSQ we were asked to make a program that automatically could choose a number between 1 and 100, and the user would try to guess it. The program will show a message saying if the number is higher or lower than the chosen by the user, then the user will try with another number until he choose the correct one.

You can make this program using -while- or -for-, if you want it to be easy. I found -for- a nice way to make it.

To generate a random number and understand how that functions work, this video helped me a lot: https://www.youtube.com/watch?v=XfHI4ePUHc4

Also page 103 and 104 of the book.

WSQ06

Here is the link to GitHub: https://github.com/tonygarciavz/A01630861-TC1017.git

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ06, Guess them damn number https://kenscourses.com/tc101fall2015/2015/wsq06-guess-them-damn-number/ Fri, 18 Sep 2015 13:01:01 +0000 http://hrglez.wordpress.com/?p=122 ]]> Let’s talk about the WSQ06, maybe the hardest in this partial (actually it is not hard, but you have to search a lot to understand it).

Here the image with the program and the compiler running it:

wsq06

Gaze at the program, stare at it as they are no other thing to observe.

I am going to explain it quickly, but if you still having doubts, search for yourself, and if it is not clear yet, ask me and then I am going to help you.

We include <stdlib> and <time> (for this example is cstdlib and ctime, but it depends on the compiler), because we need to use the functions rand(), srand() (from <stdlib>) and time() (from <time>).

Rand() is supposed to create a random number, but it is always the same value, and that is why we have to include sradn() (refers to seed random), because from that function the rand() takes like a reference for create a number. In this case, between the parenthesis of the srand() function, we put the time() function, and in this way, the random number will be generated based on a value given by the current time of the computer.

It is important to put the “%” after the rand(), because in this way you are telling the function to generate a number into a range. In this case we want to set the range between the number 1 and 100, after the “%” sign, we put the number of spaces that we are going to use, plus the initial number. For the first value, took the initial number too, that means that the final value that you want to put is the upper bound plus one, and then “+” before the first value.

There is an error in the program of the image, try to  find it.

That’s all for this WSQ, here is the code (the correct one): https://github.com/hrglez/TC1017/blob/master/WSQ06%20-%20Random%20Number

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ06, Guess the damn number https://kenscourses.com/tc101fall2015/2015/wsq06-guess-the-damn-number/ Fri, 18 Sep 2015 13:01:01 +0000 https://hrglez.wordpress.com/?p=122 ]]> Let’s talk about the WSQ06, maybe the hardest in this partial (actually it is not hard, but you have to search a lot to understand it).

Here the image with the program and the compiler running it:

wsq06

Gaze at the program, stare at it as they are no other thing to observe.

I am going to explain it quickly, but if you still having doubts, search for yourself, and if it is not clear yet, ask me and then I am going to help you.

We include <stdlib> and <time> (for this example is cstdlib and ctime, but it depends on the compiler), because we need to use the functions rand(), srand() (from <stdlib>) and time() (from <time>).

Rand() is supposed to create a random number, but it is always the same value, and that is why we have to include sradn() (refers to seed random), because from that function the rand() takes like a reference for create a number. In this case, between the parenthesis of the srand() function, we put the time() function, and in this way, the random number will be generated based on a value given by the current time of the computer.

It is important to put the “%” after the rand(), because in this way you are telling the function to generate a number into a range. In this case we want to set the range between the number 1 and 100, after the “%” sign, we put the number of spaces that we are going to use, plus the initial number. For the first value, took the initial number too, that means that the final value that you want to put is the upper bound plus one, and then “+” before the first value.

There is an error in the program of the image, try to  find it.

That’s all for this WSQ, here is the code (the correct one): https://github.com/hrglez/TC1017/blob/master/WSQ06%20-%20Random%20Number

]]>
https://creativecommons.org/licenses/by/4.0/