Random Code

Heres a code i was doing with some friends just for fun   #include <iostream> using namespace std; int main (){ int pant; float precio, desc, total, final; cout << «¿Cual es el valor del pantalon? » << endl; cin >> precio; cout << «¿Cual es la cantidad de pantalones comprados? » << endl; cin […]

Leer Más "Random Code"

Volume of a piramid

Here is a code that help to give me an idea for our final project. its about a volume of a piramid #include <iostream> // Este programa saca el volumen de una piramide con base rectangular, pide los datos al usuario (lado 1 lado 2 (area de la base) y la altura) y realiza las […]

Leer Más "Volume of a piramid"

Arrays

This is a code of me learning how to use arrays im not sure if im nailing it #include <iostream> using namespace std; int calificaciones [100] {1,1,5,2,8,6,5,3,0,4,10,7,5,1,8,6,5,3,0,1,1,2,5,1,8,6,5,3,2,4,7,1,5,10,8,6,5,7,0,1,9,9,1,9,6,5,9,0,4,9,10,5,1,8,9,5,3,0,4,9,1,5,1,8,6,5,9,0,4,10,10,9,10,8,6,5,3,0,4,10,10,5,10,8,6,5,3,0,4,10,10,5,10,8,6,5,3,0,4}; int n0=0,n1=0,n2=0,n3=0,n4=0,n5=0,n6=0,n7=0,n8=0,n9=0,n10=0; int valora; int contador; int numeroMenosRepetido; int main(){ //contador numeor 1 para recorrer el array // casos segundo cuando se repita la calificación for (int contador […]

Leer Más "Arrays"

Función Coseno

For this code i also use factorial function to get the values for Cos in a function nice#include <iostream> #include <cmath> using namespace std; float factorial(float); int main(){ float n, x, s; float coseno, numerador, fact, cont, denominador, numero; cout << «Inserta x» << endl; cin >> x; cout << «Inserta n» << endl; cin […]

Leer Más "Función Coseno"

Funcion Factorial

In the following code ill be using how to use Factorial functions #include <iostream> using namespace std; int main(){ int n, contador; string respuesta; cout << «Número Factorial » << endl; do { cout << «Dame un número positivo » << endl; cin >> n; contador = n; do { contador = contador – 1; […]

Leer Más "Funcion Factorial"

Final Project Completo

Here i have the final result of my final project. Paco, josue and i worked hard on it and it is finally done #include <iostream> #include <fstream> #include <cmath> #define pi 3.14159 using namespace std; char figura; int HP, LP1, LP2, HC, RC; float x, y, z; int main(){ cout << «Que figura quieres (C=Cilindro/P=Prisma): […]

Leer Más "Final Project Completo"

Quiz 7

The next code from my quiz 7 is about arrays #include <iostream> using std::cout; using std::cin; using std::endl; int dotProduct(int n1, int n2) { int resp; resp = n1 * n2; return resp; } int main() { int i, x, add = 0, suma; cout << «Dame la cantidad de números para las listas » […]

Leer Más "Quiz 7"

Quiz 6

What do you think the code below does? answere in the comments #include <iostream> #include <stdio.h> using std::cout; using std::cin; using std::endl; int mcd(int a, int b) { int c, d, e; e = a % b; do { d = b; b = e; e = d % b; } while(e != 0); return […]

Leer Más "Quiz 6"

Quiz 5

#include <iostream> #include <math.h> using std::cout; using std::cin; using std::endl; int find_threes(int number[], int numNumbers){ int sum = 0; for(int i = 0; i < numNumbers; i++){ if (number[i] % 3 == 0) { sum += number[i]; } else { } } return sum; } int main(){ const int NUM_NUMBERS=8; int x[NUM_NUMBERS]; for (int i […]

Leer Más "Quiz 5"

Arrays

Here is a good video on how to use arrays i found and i will use for my proyect. its from Reellearning

Leer Más "Arrays"