Final project

--Originally published at how not to program

Here is the final result of our final project. its about a code that gets the coordenates for a solid for you to graph it. I worked with Josue reyes and Rodrigo Zermeño

#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): “;
cin >> figura;
if((figura== ‘c’) || (figura== ‘C’)){
cout << “Ingresa la altura en milimetros (No mayor a 1000 mm): ” << endl;
cin >> HC;
cout << “Ingresa el radio en milimetros (No mayor a 1000 mm): ” << endl;
cin >> RC;
ofstream myfile;
myfile.open(“ArchivoCilindroProyecto.txt”);
myfile << “Las coordenadas del cilindro son: ” << endl;
for(z=0; z<=HC; z++){
for (int x=RC; x>=-RC; x–){
y=sqrt(pow(RC,2)-pow(x,2));
myfile << “(” << x << “,” << y << “,” << z << “)” << endl;
}
for (int x=RC-1; x>=-RC+1; x–){
y=sqrt(pow(RC,2)-pow(x,2));
myfile << “(” << x << “,-” << y << “,” << z << “)” << endl;
}
for (int y=RC; y>=-RC; y–){
x=sqrt(pow(RC,2)-pow(y,2));
myfile << “(” << x << “,” << y << “,” << z << “)” << endl;
}
for (int y=RC-1; y>=-RC+1; y–){
x=sqrt(pow(RC,2)-pow(y,2));
myfile << “(-” << x << “,” << y << “,” << z << “)” << endl;
}
}
}else if((figura== ‘p’) || (figura== ‘P’)) {
cout << “Ingresa la altura en milimetros (No mayor a 1000 mm): “;
cin >> HP;
cout << “Ingresa el lado 1 de la base en milimetros (No mayor a 1000 mm): “;
cin >> LP1;
cout << “Ingresa el lado 2 de la base en milimetros (No mayor a 1000 mm): “;
cin >> LP2;
ofstream myfile;
myfile.open(“ArchivoPrismaRectangularProyecto.txt”);
myfile << “Las coordenadas del Prisma

Continue reading "Final project"

Final Project Completo

--Originally published at My awesome Blog!

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): “;
cin >> figura;
if((figura== ‘c’) || (figura== ‘C’)){
cout << “Ingresa la altura en milimetros (No mayor a 1000 mm): ” << endl;
cin >> HC;
cout << “Ingresa el radio en milimetros (No mayor a 1000 mm): ” << endl;
cin >> RC;
ofstream myfile;
myfile.open(“ArchivoCilindroProyecto.txt”);
myfile << “Las coordenadas del cilindro son: ” << endl;
for(z=0; z<=HC; z++){
for (int x=RC; x>=-RC; x–){
y=sqrt(pow(RC,2)-pow(x,2));
myfile << “(” << x << “,” << y << “,” << z << “)” << endl;
}
for (int x=RC-1; x>=-RC+1; x–){
y=sqrt(pow(RC,2)-pow(x,2));
myfile << “(” << x << “,-” << y << “,” << z << “)” << endl;
}
for (int y=RC; y>=-RC; y–){
x=sqrt(pow(RC,2)-pow(y,2));
myfile << “(” << x << “,” << y << “,” << z << “)” << endl;
}
for (int y=RC-1; y>=-RC+1; y–){
x=sqrt(pow(RC,2)-pow(y,2));
myfile << “(-” << x << “,” << y << “,” << z << “)” << endl;
}
}
}else if((figura== ‘p’) || (figura== ‘P’)) {
cout << “Ingresa la altura en milimetros (No mayor a 1000 mm): “;
cin >> HP;
cout << “Ingresa el lado 1 de la base en milimetros (No mayor a 1000 mm): “;
cin >> LP1;
cout << “Ingresa el lado 2 de la base en milimetros (No mayor a 1000 mm): “;
cin >> LP2;
ofstream myfile;
myfile.open(“ArchivoPrismaRectangularProyecto.txt”);
myfile << “Las coordenadas del Prisma rectangular son: ” << endl;
for(int z=0; z<=HP; z++){
for(int

Continue reading "Final Project Completo"

The final boss has been defeated!

--Originally published at Programming Path

At last our final project is finished! It was very interesting to make the code, and to make it run properly. My partner Sergio Iriarte and I decided to program a little game, this was because we both like video games and it sound fun to make a game. It felt more like an achievement.

We came up with the idea of programming the game Battleship. Sergio knows how to program in Java after taking some classes on past years, so we decided to do the game in Java. The reasons were because it is a more simple way of programming, is better organized and much easier to use than C++. And of course he was very patient with me because I am new to this thing they call programming.

After making the decision, I had to install eclipse, it was a total disaster because my computer was very slow, but in the end we could defeat this troublemaker called Battleship.

Here is the code:

Final1final2final3

And here is how we see it when running:

  • * means the user have missed.
  • ~ means the user did not hit that coordinate.
  • X means the user has hit a ship.

Every round, the game gives the user a hint about where could a ship be.

final4

So this is it. We finally finished the project. Just in time for this post ?

 


Final project. Snake!!

--Originally published at My life @ TEC

hey guys!

I´ve been abscent for a while now, but here I am again ? so for our final project, my friend Fernando Pacheco a I did a game that I´m sure everybody knows it, the snake game from the old nokia’s cellphones.

at the beggining we started programming in atom as usual, but when we noticed it was not working we decided to try with an other editor, I tried with DEV-C++ and Fernando tried with Code::Blocks, mine did not work, but pacheco’s one did, so we used that one, I believe it was easier because it has its own compiler, so that made it easier to handle.

First we did all the functions and put the library,one of the libraries also didn’t work when we tried it out in atom, but with this one it did, once we finished everything we created a menu for the game and it was hard because it ran, but it did not do what we wanted so we spent a while in there trying to fugure out what was wrong , at the end, we decided to leave it without the last “while”

this is my code

#include<windows.h>
#include<iostream>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>

using namespace std;

int cuerpo[200][2];
int n = 1;
int tam = 5;
int x = 10, y=12;
int dir = 3;
int xc =30, yc=15;
int velocidad = 100, h=1;
int score = 0;

char tecla;

#define ARRIBA 72
#define IZQUIERDA 75
#define DERECHA 77
#define ABAJO 80
#define ESC 27

void gotoxy(int x, int y)
{
HANDLE hCon;
COORD dwPos;

dwPos.X = x;
dwPos.Y = y;
hCon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hCon,dwPos);
}

void pintar(){
//lineas horizontales
for(int i = 2; i < 78 ; i++){
gotoxy(i,3); printf(“%c”,205);
gotoxy(i,23); printf(“%c”,205);
}

//lineas verticales
for(int i =

Continue reading "Final project. Snake!!"

Final Project! Snake game lml

--Originally published at Programming the city

Hello guys.

My friend Gustavo Hinojosa and I did the snake game, like the one that was installed in the Nokia 3310.

First of all, we tried to make the code in atom and run it in the cygwin terminal, but the specifications of the coordinates were wrong. Cygwin didn’t respected the specifications, that’s why we started doing the code in the IDE named CodeBlocks.

First of all we added all the libraries, “Windows.h” was to include the specifications of the coordinates. Later, we added all  the variables and the keys of the board to indicate which buttons the program had to take.

Then, we created the functions, this was the hardest part and the most difficult too. First we created the gotoxy function, We could did that function because we asked for help in Google, this function helped us to make the coordinates specifications.

Later that day, we created another eight functions, pintar: it was to build the square where the snake is eating, guardar_posición: it is to sabe the position where the snake crashed, dibujar_cuerpo: is to créate the whole body of the snake, teclear: is to indicate which buttons we needed to use, cambiar velocidad: is to increase the speed of the snake every time it eats,  comida: is to put a random place for the food, game over: is to end the game and puntos: is to show the score the user has done.

Finally we created the main function with a small menu which included an image of the snake and the options “1. Jugar   2.Salir” and after that, we added the functions.

Here is the amazing code!

1

2

3

 

4

And here is the snake Game!

6

7

8

 

 

 


Final Project – Arc Reactor

--Originally published at Franco TC1017

Hi, I´m Franco and this is my final project for TC1017. 

Cardiovascular diseases are the number one cause of death worldwide. File_000These problems affect a lot of kids as well. Cardiovascular disease in kids means that they cannot do activities that require a high level of exercise for a prolonged time, like running or playing outside. It would be easier for parents to take care of their kid´s health if they could oversee their kid´s heart rate easily.

My solution to this problem was to create a wearable light feedback monitor that constantly measures the patient’s pulse and emits a light at the same rhythm.

As it is intended for kids, I made it in the form of Ironman´s arc reactor and big enough for parents to see it at a distance.

It is a completely original design. I designed the hardware, the electrical circuit, and the code.

If you would like to know more about this project, please come visit me at ExpoIngeniería.

File_001 (27)File_000 (37)ECG


My final project

--Originally published at my programming blog

So at the end we didn’t do a program that could catch the movement of a hand (my last post about my final project), because we didn’t found the sensors, so we decided to do a little robot, we obtained the instruction to make it here. (in this link you can find the instructions, materials and the code).

First we ordered the circuit online and we found a code and we understood and changed some things.

Then once we have the circuit and the micro servo motors, we attached everything together and we connected the robot to the computer and we run the program, the final result was that robot danced.

18176144_10212929911225526_27241085_o

The robot dancing:

 


Final Project Concept

--Originally published at how not to program

For the final project, my team and I decided to develop a program that can help you to find out your average grade for all your courses. We also want to add a prediction mode that calculates how much do you need in your final partial so you don’t fail.

Right now we´re just drafting the main funtions the program needs in order to accomplish everything

¿Cuál semestre estás cursando? = nsemestre
¿En qué parcial estás? = nparical
¿Cuántas materias cursas? = nmaterias

//Inicio Loop^(nmaterias)
¿Cuál es el porcentaje por parcial de materia1? %parcial1

materia1,calficacionparcial1 x %parcial1

We´ll work on the program via GitHub and we’ll update with more news of the project in the following weeks.

If you have any idea feel free to comment


Talking Chalk/ OlagGC #FinalProject©

--Originally published at OlafGC / Class #TC1017

So here is the first post about our progress in the project. We have eight weeks left. We had two ideas: the first one consisted on assembling a robotic arm and program it; the second one, in making an app (for cellphone or computer) very similar to Duo-lingo, but instead of learning  new idiom, it will teach you C++. We thought it may be a great support tool (gamification) for learning how to program, helping students on their journey through  Solving Problems with Programming.

sin-titulo

***Update***

This is a link to the latest update of our SUPER ULTRA MEGA ADVANCED, GREAT AND POWERFUL INNOVATIVE PROJECT, a post made by me and The Talking Chalk

on his blog.