Mastery Topic 12

--Originally published at TC1017 Programing Curse

For this mastery topic i had to think a lot, it was difficult but after tried and tried  i finally did it…

65197647

Image taken from meme generator… https://memegenerator.net/instance/65197647

yep i failed, like 3 or 4 times….

#include <iostream>
#include <cmath>
using namespace std;

int x,y,z;
int main ()
{
cout << “Escribe el primer numero” << endl;
cin >> x;
cout << “Escribe el segundo numero” << endl;
cin >> y;
cout << “Escribe el tercer numero” << endl;
cin >> z;
if (x>y) {
if (y>z) {
cout << “El numero mas chico es ” << z << endl;
}
else {
cout << “el numero mas chico es ” << y << endl;
}
}
else {
cout << “el numero mas chico es ” << x << endl;
}
return 0;
}

yes i know its easy…

 


Mastery Topic 10 & 11

--Originally published at TC1017 Programing Curse

Those are the use of if and else, they are easy, a little problematic but easy at the end, again it was easy…  using the basic code knowledge

330x192

image taken from steam community market

https://steamcommunity.com/market/listings/730/Sticker%20%7C%20Easy%20Peasy

#include <iostream>
using namespace std;

int x;
int y;

int main ()
{
cout << “Escribe el primer numero” << endl;
cin >> x;
cout << “Escribe el segundo numero” << endl;
cin >> y;
if (x>y)
{
cout << “el numero mas grande es” << x << endl;
}
else
{
cout << “el numero mas grande es ” << y << endl;
}
return 0;
}


Homework 2 Temperature

--Originally published at TC1017 Programing Curse

For this homework we were asked to do a program that will prompt the user for a temperature in Fahrenheit and then convert it to Celsius. And then decide if water would boil at that temperature. It is amazing… you will see it

Image taken from http://www.nick.com/affair-2

#include <iostream>
using namespace std;

double x;
double y;
int main () {
cout << “Escribe tus grados en fahrenheit para convertirlos en celcius” << endl;
cin >> y;
x=5*(y-32)/9;
cout << “Los grados en celcius son: ” << x << endl;
if (x>=100)
{ cout << “water does boil at this temperature, under typical conditions” << endl;
}
else
{
cout << “water does not boil at this temperature, under typical conditions” << endl;
}
return 0;
}


Mastery Topic 5

--Originally published at TC1017 Programing Curse

In this one i have to ask the user for input something, that allows me to do something with it, and to do it i have to create a variable. I show how i did it… i hope you find it useful, thank you for reading also.

#include <iostream>
using namespace std;

int x;

int main ()
{
cout << “Dime un Numero” << endl;
cin >> x;
cout << “gracias, el numero que pusiste mas 1 es = ” << x+1 << endl;
return 0;
}

captura12312


Matery Topic 4

--Originally published at TC1017 Programing Curse

For this mastery topic i had to learn what i can use to print something, and for it i used the library <iostream> , it is a basic but useful topic, i hope it may help at least someone. 

The code is

#include <iostream>
using namespace std;

int main ()
{
cout << “Hola Mundo” << endl;
return 0;

}
help-funny-picture

Photo taken from Desivalley.com

[url=http://funny.desivalley.com/help-funny-picture/][img]http://funny.desivalley.com/wp-content/uploads/2011/04/help-funny-picture.jpg[/img][/url]

 


Matery Topic 1 and 2

--Originally published at TC1017 Programing Curse

To complete both mastery topics y have to know the use of coments and also like C++ Good Style coding conventions, for now i can say that for use coments there are two ways, just a line using “//” and also like parenthesis “/*” & “*/” and i did it in code so there is like the text and also I leave a screen shot. 

#include <iostream> //to use cout you have to include this library
using namespace std; /* and also you can do this, in order to simplyfy codes
not using std */
int main () //in this variable is where your main code is going to be.
{
// to star writting a code yo have to use the brackets.
/* after it you put a line of code, you have to use “;” to end that line
and thats it */
}

hope it helps.


Quiz #3

--Originally published at TC1017 Programing Curse

For this quiz, i have to do a program that, ask the user for a number to obtain the square root and the cubir root of the number.

At first i declare the variables, well just one variable, that it is going to be x, (the number that the user will introduce), then after the number is asked, i use an if, this because the number it’s negative, the square root does not exist, so the if is for that case, and i used an else to print that the square not exist, and then print the cubic root.

#include <cmath>
#include <iostream>
using namespace std;

double x;
double resultados;

int main (){
cout << “Escribe el numero al que deseas sacarle raices” << endl;
cin >> x;
if (x>=0)
{
cout << “la raiz cuadrada es ” << sqrt(x) << endl;
}
else {
cout << “N/A” << endl;
}
cout << “la raiz cubica es ” << cbrt(x) << endl;
return 0;
}

 


Fun with Numbers

--Originally published at TC1017 Programing Curse

In the first assignment, it is about asking the user for two integer values, then use those two values to calculate the sum, the diference, the product, the division and the remainder of it, but with no decimal point. To do this, i use the book to  learn about how to declare integer variables…

To start i declare the variables, 2, used to obtain the values from the user and 1 to print the results, at first i did the sum, then the diference, after it, the product, and at the end the division and it reminder.

#include <iostream>
using namespace std;

int PrimerNumero ;
int SegundoNumero;
int resultado;

}

int main() {
cout <<“Escribe el primer numero”<< endl;
cin >> PrimerNumero;
cout << “Escribe el segundo numero”<< endl;
cin >> SegundoNumero;
cout << “Los resultados son”<< endl;
cout << “suma= ” << PrimerNumero+SegundoNumero << endl;
cout << “resta= ” << PrimerNumero-SegundoNumero << endl;
cout << “Multiplcacion= ” << PrimerNumero*SegundoNumero << endl;
cout << “Division= ” << PrimerNumero/SegundoNumero << endl;
cout << “Residuo= ” << PrimerNumero%SegundoNumero << endl;
cout << z << endl;
return 0;
}