Author Archives: Jose Eduardo Sanchez

Mastery 13

La librería cmath es la que nos da una serie de funciones para poder realizar operaciones matemáticas complejas (potencias, raices cuadradas,senos, cosenos…). Toda la información referente a esta librería la puedes encontrar en internet. 

Aqui esta un ejemplo de la libreria cmath para poder usar el remainder.

 

Mastery 12

In C++, a function is a group of statements that is given a name, and which can be called from some point of the program. The most common syntax to define a function is:

type name ( parameter1, parameter2, ...) { statements }

Where:
– type is the type of the value returned by the function.
– name is the identifier by which the function can be called.
– parameters (as many as needed): Each parameter consists of a type followed by an identifier, with each parameter being separated from the next by a comma. Each parameter looks very much like a regular variable declaration (for example:int x), and in fact acts within the function as a regular variable which is local to the function. The purpose of parameters is to allow passing arguments to the function from the location where it is called from.
– statements is the function’s body. It is a block of statements surrounded by braces { } that specify what the function actually does.

Let’s have a look at an example:

 

Mastery 11

Calling a funcion in c++

Mastery 04

Here is the link to my GitHub Repository for WSQ: https://github.com/JoseSanchez12/TC1017-GitHub-Repos

And here some pictures about this

WSQ09 – Factorial Calculator

Here is the pictures to my code about factorial i have some problems about ask to the user for another number but i read the code of my classmates and that help me to undertand how to do it.

Mastery 10

Aqui esta un ejemplo de como usar los output y input, el output funciona para tu escribir un texto que se imprima a la hora de correr el programa, y input para poner un valor una variable aqui esta un ejemplo de esto:

WSQ08 – On To Functions

Para hacer este wsq, lei el capitulo 3 del libro, tambien vi algunos videos en Lynda para poder comprender el tema, pero tambien me base en algunos trabajos de mis compañeros aqui dejo el link al codigo y las imagenes:

Link: https://github.com/JoseSanchez12/On-To-Functions/blob/master/.gitignore

Mastery 09

Las variables sirven para guardar varia informacion. Las variables no hacen mas que reservar memoria para almacenar valores. Esto quiere decir que cuando tu creas una variable tu reservas espacio en la memoria para esta informacion.

Tu puedes almacenar informacion de varios tipos de datos como carácter, caracteres anchos, entero, punto flotante, punto flotante doble, boolean etc.

Aqui esta una tabla de algunas variables:

Type Typical Bit Width Typical Range
char 1byte -127 to 127 or 0 to 255
unsigned char 1byte 0 to 255
signed char 1byte -127 to 127
int 4bytes -2147483648 to 2147483647
unsigned int 4bytes 0 to 4294967295
signed int 4bytes -2147483648 to 2147483647
short int 2bytes -32768 to 32767
unsigned short int Range 0 to 65,535
signed short int Range -32768 to 32767
long int 4bytes -2,147,483,647 to 2,147,483,647
signed long int 4bytes same as long int
unsigned long int 4bytes 0 to 4,294,967,295
float 4bytes +/- 3.4e +/- 38 (~7 digits)
double 8bytes +/- 1.7e +/- 308 (~15 digits)
long double 8bytes +/- 1.7e +/- 308 (~15 digits)
wchar_t 2 or 4 bytes 1 wide character

WSQ07 – Sum of Numbers

Here are the pictures for my wsq07 sum of numbers, the code works good here is the link to the code on github:https://github.com/JoseSanchez12/Sum-of-Numbers/blob/master/Sum%20of%20Numbers

 

Mastery 06

I don´t want to nstall linux because i think that i don´t need but here is a video who explain how to install this operative system :https://www.youtube.com/watch?v=h_L703LWueY