Quiz 6

--Originally published at Tec Life

In order to do this quiz I search the information in one site: http://www.cplusplus.com/reference/

We have to solve 5 problems; the first one was about correcting one program and run it, so I use two new libraries in order to solve the program and start testing and rewriting the program, and the final result was this:captura-de-pantalla-2017-02-13-a-las-09-08-45captura-de-pantalla-2017-02-13-a-las-09-09-01

The second problem was about writing a program to read in a character, an integer, and a float, and print out the values, then cast to other types; so that the interaction with the user is something like the following:

captura-de-pantalla-2017-02-22-a-las-21-25-57

captura-de-pantalla-2017-02-22-a-las-21-26-06

The next program was only about to the following pattern:

                        C
                      i   I
                    s       s
                  b           b
                e               e
              s                   s
            t s e b s i C i s b e s t

 

So the only thing that I have to do was print the letters in that order and that was allcaptura-de-pantalla-2017-02-13-a-las-09-42-22

For the fourth problem they ask us to write a program to read three ints and to print them in ascending order, so the most easy thing to do was using a lot of if and else to solve this problem:captura-de-pantalla-2017-02-22-a-las-21-31-32

captura-de-pantalla-2017-02-22-a-las-21-31-43

And the last problem they ask us to write a program given the following rules, write a program to read a year (4 digit integer) and tell whether the given year is/was a leap year.

  1. There were no leap years before 1752.
  2. If the year divides by 400 then it is a leap year.
  3. All other years that divide by 100 are not leap years.
  4. All other years that divide by four are leap years.

So I use the main if as 1752 because if that wasn’t true then the year will be normal, the I use another if to say the conditions when the year will be

captura-de-pantalla-2017-02-23-a-las-08-29-54
captura-de-pantalla-2017-02-23-a-las-08-30-04
Continue reading "Quiz 6"

Post of the week #5 what things I learned in this week #5 ? And Index of Mastery Topics

--Originally published at Solving Problems with Programming

Picture of author

First let me tell you that  I learn and achieved all transversal topics and you can see it in the following link: Post of the week #3 what things i learned in this week #3 ? And Index of Mastery Topics

I also explain my project and formed a small team that corresponds of completing this ability to create C++ project in IDE and run inside the IDE and can be explained in my post My Project For the Course TC1017 and Expo Ing

Futhermore, I am going to present the report of all the Mastery Topics achieved in this week:

  1. #Mastery01 Use of comments, achieved in: Post of the week #2 what things i learned in this week #2 ?
  2. #Mastery02 C++ Good Style coding conventions, achieved in: Post of the week #2 what things i learned in this week #2 ?
  3. #Mastery03 Basic types and their use, achieved in: Post of the week #2 what things i learned in this week #2 ?
  4. #Mastery04 Basic output (print), achieved in: Post of the week #2 what things i learned in this week #2 ?
  5. #Mastery05 Basic user input (text based), achieved in: Post of the week #2 what things i learned in this week #2 ?
  6. #Mastery06 Calling functions, achieved in: #Quiz03
  7. #Mastery07 Creating functions, achieved in: #Quiz03
  8. #Mastery08 Importing and using libraries, achieved in: Post of the week #1 what things i learned in this week #1 ?
  9. #Mastery09 Creating and using your own libraries (program with multiple files), achieved in: #Quiz03
  10. #Mastery10 Use of the conditional “if”, achieved in: #WSQ02 Post Temperature 23/01/17 and WSQ02.cpp
  11. #Mastery11 Use of “else” with a conditional if, achieved in: #WSQ02 Post Temperature 23/01/17 and WSQ02.cpp
  12. #Mastery12 Nesting of conditional statements (ifs inside ifs): #WSQ02 Post Temperature 23/01/17 and WSQ02.cpp
  13. #Mastery13 Use of
    recursion
    int-sumsquare
    double-function
    Continue reading "Post of the week #5 what things I learned in this week #5 ? And Index of Mastery Topics"

Post of the week #4 what things I learned in this week #4 ? And Index of Mastery Topics

--Originally published at Solving Problems with Programming

Picture of author

First let me tell you that  I learn and achieved all transversal topics and you can see it in the following link: Post of the week #3 what things i learned in this week #3 ? And Index of Mastery Topics

I also explain my project and formed a small team that corresponds of completing this ability to create C++ project in IDE and run inside the IDE and can be explained in my post My Project For the Course TC1017 and Expo Ing

Futhermore, I am going to present the report of all the Mastery Topics achieved in this week:

  1. #Mastery01 Use of comments, achieved in: Post of the week #2 what things i learned in this week #2 ?
  2. #Mastery02 C++ Good Style coding conventions, achieved in: Post of the week #2 what things i learned in this week #2 ?
  3. #Mastery03 Basic types and their use, achieved in: Post of the week #2 what things i learned in this week #2 ?
  4. #Mastery04 Basic output (print), achieved in: Post of the week #2 what things i learned in this week #2 ?
  5. #Mastery05 Basic user input (text based), achieved in: Post of the week #2 what things i learned in this week #2 ?
  6. #Mastery06 Calling functions, achieved in: #Quiz03
  7. #Mastery07 Creating functions, achieved in: #Quiz03
  8. #Mastery08 Importing and using libraries, achieved in: Post of the week #1 what things i learned in this week #1 ?
  9. #Mastery09 Creating and using your own libraries (program with multiple files), achieved in: #Quiz03
  10. #Mastery10 Use of the conditional “if”, achieved in: #WSQ02 Post Temperature 23/01/17 and WSQ02.cpp
  11. #Mastery11 Use of “else” with a conditional if, achieved in: #WSQ02 Post Temperature 23/01/17 and WSQ02.cpp
  12. #Mastery12 Nesting of conditional statements (ifs inside ifs): #WSQ02 Post Temperature 23/01/17 and WSQ02.cpp
  13. #Mastery13 Use of
    recursion
    int-sumsquare
    double-function
    Continue reading "Post of the week #4 what things I learned in this week #4 ? And Index of Mastery Topics"

Post of the week #3 what things i learned in this week #3 ? And Index of Mastery Topics

--Originally published at Solving Problems with Programming

Picture of author

First let me tell you that in my last post i learn all transversal topics that are:

  • Ability to create C++ file and run from command line (terminal)
  • Create accounts: Blog, Twitter, GitHub
  • Submit work via Blog RSS and GitHub
  • Demonstrate use of Linux sufficient for quizzes/exams
  • Install Linux on their own computer

And you can find it in these posts:

Post of the week #2 what things i learned in this week #2 ?

Post of the week #1 what things i learned in this week #1 ?

I also explain my project and formed a small team that corresponds of completing this ability to create C++ project in IDE and run inside the IDE and can be explained in my post My Project For the Course TC1017 and Expo Ing

Futhermore, I am going to present the report of all the Mastery Topics achieved in this week:

  1. #Mastery01 Use of comments, achieved in: Post of the week #2 what things i learned in this week #2 ?
  2. #Mastery02 C++ Good Style coding conventions, achieved in: Post of the week #2 what things i learned in this week #2 ?
  3. #Mastery03 Basic types and their use, achieved in: Post of the week #2 what things i learned in this week #2 ?
  4. #Mastery04 Basic output (print), achieved in: Post of the week #2 what things i learned in this week #2 ?
  5. #Mastery05 Basic user input (text based), achieved in: Post of the week #2 what things i learned in this week #2 ?
  6. #Mastery06 Calling functions, achieved in: #Quiz03
  7. #Mastery07 Creating functions, achieved in: #Quiz03
  8. #Mastery08 Importing and using libraries, achieved in: Post of the week #1 what things i learned in this week #1 ?
  9. #Mastery09 Creating and using your own libraries (program with multiple files), achieved in: #Quiz03
  10. #Mastery10 Use of
    Continue reading "Post of the week #3 what things i learned in this week #3 ? And Index of Mastery Topics"

Yo por Yo, por Yo, por Yo…

--Originally published at Adal´s Blog

La actividad esta así:


Básicamente consiste en hacer un programa que nos permita calcular el factorial de cualquier número que le introduzcamos, es decir que hay que multiplicar todos los números enteros positivos que hay entre ese número y el 1.  

En el libro de la clase thinkCScpp, viene un ejemplo, el cual solamente lo voy a adaptar al código


Libro de ayuda:
  • thinkCScpp

A reformular!

--Originally published at Adal´s Blog

Y el tema de hoy es el siguente: 


Gracias a que esta actividad ya estaba hecha solo fue necesario hacer las funciones y andarlas llamar despues, gracias a que los valores se van sustituyendo cada ves que se llama de nuevo la función, solo utilice 3 variales, dandole mas volativilidad a la Z  


Pagina de ayuda:

Quiz #4

--Originally published at Programming 101

Today we had our fourth quiz and I found it quite hard. I thought about the problem and understood it but I had a bit of trouble writing it. In the end, a friend in class helped me and I got a better idea of what to do.

Functions were a bit of a headache for me but I’ll read more pages of the book and keep on working with my friends.

Here’s a screenshot of the program and three examples to show how it works.

Cheers!

captura-de-pantalla-12


Me llaman me llaman me llaman ♪♫ (Jammin Bob Marley)

--Originally published at Adal´s Blog

En la clase de hoy tuvimos un quiz el cual dice:


En pocas palabras, lo que tenemos que hacer es una función que nos diga cual es el numero menor de una lista de tres números, y con estos mismos saber la suma de sus cuadrados.

En términos simples, una función es un pedazo de código que nos retorna un o mas valores específicos esto con el fin de ayudarnos a no escribir lineas de código una y otra vez 

Quiz 4

--Originally published at Tec Life

For this quiz we have to do this:

For this quiz I want you to (in class) create a program with two functions:

  • int minimumThree(int x, int y, int z){ }  // returns the value that is smallest of x, y and z
  • int sumSquares(int x, int y, int z) {}  // returns the value of the sum of squares of x, y, z

You should make a main routine that asks the user for three numbers and then calls your functions to which should *RETURN* the value and you print in the main program.

So I started writing my program normally, declaring my variables, naming my functions and to make the user to write the three numbers.

captura-de-pantalla-2017-02-02-a-las-09-28-40

Then I make what my functions would do, that says in the first function that I am going to multiplied my variables with the function “pow” and in a parenthesis my variable “,” and the number I want to multiplied my variable, in this case 2 for square and the sum the operations.

And on my second function I put conditions with if and else to make the program know what number is bigger than the other and finally printed on the result.

captura-de-pantalla-2017-02-02-a-las-09-28-52Image from: http://www.quizfactor.com/quiz/general-knowledge/5

#Quiz04


Suman y suman y vuelven a sumar ♪♫

--Originally published at Adal´s Blog

La actividad de esta semana es:


La actividad consiste en crear un código el cual nos ayude a sumar un rango de valores dado


Este problema lo resolví con un ciclo un while para así obtener la sumatoria de los números  

Personas de ayuda:
  • Sandoval A.