Author Archives: Carlos Adrian

#TC1017 #finalproyect #sudoku

Al principio el proyecto sonaba muy dificl lograrlo, pero despues que pasaron las semanas y buscamos ayuda y vimos varios videos, empezamos a armar el codigo, optamos utilizar el codigo del maestro ya que tenia muchas bases del codigo y eso nos facilito organizar las ideas.

Lo mas complicado fue poder meter un numero nuevo al cuadro, nos botaba muchos errores, pedimos ayuda a muchas personas en la biblioteca hasta que se nos ocurrio modificarlo y utilizar otra forma.

Lo unico que no logramos fue modificar el color de los numeros ingresados por el usuario y optamos por no hacerlo, sabemos que era necesario pero ninguna de las formas que intentamos funciono y nadie de los que nos ayudaba sabian como.

Dejamos hasta el final agregar los colores pensando que iba a ser sencillo pero al ver la cantidad de codigo que era, se hizo tedioso el buscar cada texto y agregarle el color deseado pero al final se logro el objetivo.

Fue comodo trabajar en este equipo ya que nos entendiamos y siempre habia comida al momento de trabajar aunque muchas veces perdiamos mucho tiempo en internet.

https://github.com/kenwbauer/CarlosOlaf/blob/master/sudoku.cpp

#TC1017 #Quiz10

#TC1017 #Bonusquiz


#TC1017 #Bonusquiz

#TC1017 #Bonusquiz

#TC1017 #QUIZ09

#WSQ14 #TC1017 – Estimating number e

#TC1017 #Mastery20


#TC1017 #Mastery20

#TC1017 #Mastery20

http://www.cplusplus.com/doc/tutorial/control/

#TC1017 #Mastery18

Nested if and if-else statements

The if-else statement allows a choice to be made between two possible alternatives. Sometimes a choice must be made between more than two possibilities. For example the sign function in mathematics returns -1 if the argument is less than zero, returns +1 if the argument is greater than zero and returns zero if the argument is zero. The following C++ statement implements this function:

if (x < 0)
   sign = -1;
else
   if (x == 0)
      sign = 0;
   else
      sign = 1;

This is an if-else statement in which the statement following the else is itself an if-else statement. If x is less than zero then sign is set to -1, however if it is not less than zero the statement following the else is executed. In that case if x is equal to zero then sign is set to zero and otherwise it is set to 1.

Novice programmers often use a sequence of if statements rather than use a nested if-else statement. That is they write the above in the logically equivalent form:

if (x < 0)
   sign = -1;
if (x == 0)
   sign = 0;
if (x > 0)
   sign = 1;

This version is not recommended since it does not make it clear that only one of the assignment statements will be executed for a given value of x. Also it is inefficient since all three conditions are always tested.

http://www.macs.hw.ac.uk/~pjbk/pathways/cpp1/node99.html

 

#TC1017 #Mastery17

#TC1017 #Mastery14

#TC1017 #Mastery04