Mastery-3

--Originally published at Programing 101

the difficult part: the hard part was know the “while” and the “if” because i didn’t know the logic of them, also i dint know what was the “rand” started for

the easy part: once i knew what do i had to do i start programing all over and over again because in the terminal said that i had wrong something

what i learned

  • “Rand” is the formula to give a number between any variable you give
  • “srand(time(NULL))” is the formula to make rand give any number overtime you used it
  • “while” is the formula to repeat an action inside the “int main”
  • “puts” is a variable to “cout”

>>>c++ page command<<<

 

 

3screen-shot-2017-02-09-at-07-55-00


MASTERY-2

--Originally published at Programing 101

the difficult part: there was not really a hard part the only thing that i didn’t know was the conversion between Farenheid and Celsius

the easy part: all the programing

what i learned

  • i learn that you need to put your formula before any “court or cin”

>>>c++ page command<<<

 

2


Mastery-1

--Originally published at Programing 101

the difficult part: the only thing that i find hard was the remainder because o didn’t know what sing i had to use but after checking some websites i track the sing “%” for the remainder

the easy part: all the formulas were easy because i only need logic to create them

what i learn:

  • “%” is the sign of remainder
  • you need to declare all the variables or it will make a mess

>>>c++ page command<<<

screen-shot-2017-02-08-at-23-25-01


Quiz 4

--Originally published at Programing 101

The difficult part : 

know the difference between all the calculations.

first i tried to do a simple “if” to check if the knowledge that i had about the “if” was ok but at fist this didn’t work. a friend of mine show me how to do it.

 the easy part : ones i knew how to do it i tried to do it by myself and i did good

what i learn:

  •  You can use “if” to compare more than two variables.
  • “pow” is the function to elevate any variable to any potency
  • “<= o >=” is the sing to refer if is less-equal or high-equal respectively

>>>c++ page command<<<  >>> Victor Barrancas (good friend that teach me all this)<<<

 

12345.png


int Square & Cube Root // Quiz Week 03

--Originally published at Alvaro_246

Quiz 03

In this Quiz I made a program to calculate de square root and cube root of a especific number, I worked with math funtions, I used the library <cmath> beacuse I need to use Math operations the funtion are “sqrt and cbrt” and one “if” because the program don’t calculate negative numbers (-x) and the program prints “Error, Don’t use negative numbers”

quiz3

This is my Code :

#include <iostream>
#include <cmath>

using namespace std;
double square_root (double x) {
double square_root = sqrt(x);
return square_root;
}
double cube_root(double x) {
double cube_root = cbrt(x);
return cube_root;
}
double x;
int main() {
cout << “This Program calculate the Square and cube root of a specific number” << endl;
cout << “Insert a number”<< endl;
cin >> x;
if (x<=0){
cout << “No negative numbers”<< endl;
}
cout <<“square root is: “<< square_root(x)<<endl;
cout <<“cube root is : ” << cube_root(x)<< endl;
return 0; // Alvaro_246
}


int sumSqueres (x,y,z) // Quiz Week 04

--Originally published at Alvaro_246

Quiz04

En el Quiz de la semana #04 tuvimos un problema el cual consistía en ingresar 3 números (x,y,z) y el programa debe de imprimir el mas grande entre esos 3 números, pero esto haciéndolo como función “minimunThree (int a, int b, int c)” y en la segunda parte del quiz teníamos que elevar cada uno de estos 3 números al cuadrado y después sumar cada resultado, para esto coloque la siguiente formula “(x*x + y*y + z*z)=” dentro de la función sumSqueres(x,y,z)

2017-02-08

#include <iostream>
using namespace std;

int minimunThree(int a, int b, int c) {
if(a>=b && a>=c){
return a;}
else if (b<=a && a<=b){
return b;}
else if (c<=a && c<=b){
return c;}
}

int sumSqueres(int x, int y, int z)
{
int R;
R= (x*x+y*y+z*z);
return R;
}

int main ()
{
float x,y,z;
cout << “Este programa encuentra el numero mas grande entre x,y,z” << endl;
cout << “Inserte el valor de x” << endl;
cin >> x;
cout << “Inserte el valor de Y” << endl;
cin >> y;
cout << “Inserte el valor de Z” << endl;
cin >> z;

cout<<“El numero mayor encontrado es: “<< minimunThree(x,y,z)<< endl;
cout<<“La suma de los cuadrados de los 3 numeros es: ” <<sumSqueres(x,y,z)<< endl;
return 0;
}
//Alvaro_246


cout<< “Hit the #” <<endl;

--Originally published at Alvaro_246

WSQ03 = PICK A NUMBER

Esta semana hice un programa que se encarga de preguntarle al usuario un numero del 1 al 100 y tiene que adivinar el numero de un cierto rango intermedio, en el caso de mi programa el rango correcto es (num<=46 || num>=54). Para ello utilice una función llamada “while” la cual no conocía, pero sirve para hacer un Loop infinito hasta que se rompa la condición dentro del while. En varias ocasiones no me funcionaba mi código, le pedí ayuda a uno de mis amigos que estudia ISC (Ingeniería en sistemas comunicacionales) Hector Chavez Morales y me ayudo a encontrar el error.(estaba mal el rango).

pick-a-number

 


Quiz3

--Originally published at Programing 101

The difficult part of this quiz was know the difference between a variable and input:

first I was really confuse because when i declare my variable of square-root I didn’t know what was the wrong part, then I realized that i dint declared it in the right place, I had put it inside the int main so the terminal didn’t know what variable I was talking about.

screen-shot-2017-01-26-at-14-56-33

terminal

The easy part:

finally when I got the point of every command I copy paste. after that I was experimenting.

this side really help me with all the commands that i didn’t know

>>>>c++ page command<<<<

screen-shot-2017-01-26-at-14-38-02