Programa para obtener la formula y grafica de una parabola. borland c++

Páginas: 6 (1317 palabras) Publicado: 19 de octubre de 2010
INSTITUTO POLITECNICO NACIONAL

ESCUELA SUPERIOR DE INGENIERÍA MECÁNICA Y ELÉCTRICA

UNIDAD CULHUACAN

PROGRAMA PARABOLA

FUNDAMENTOS DE PROGRAMACION
PROF: Malamoco Gómez Alejandro Narciso

1SV1
ALUMNO:

#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>

void opcion1m (void);
void opcion2m (void);

void opcion1t (void);
voidopcion2t (void);

void main(void)
{
system("cls");
system("color 3");
textcolor(10);
gotoxy(25,5);
cprintf("INSTITUTO POLITECNICO NACIONAL\n");
gotoxy (17,9);
printf("*****\t****\t*****\t*\t*\t*****\n");
gotoxy (17,10);
printf("*\t*\t *\t** **\t*\n");
gotoxy (17,11);
printf("*\t*\t *\t* * *\t* *\n");
gotoxy (17,12);
printf("*****\t****\t *\t* * *\t*****\n");gotoxy (17,13);
printf("*\t *\t *\t*\t*\t*\n");
gotoxy (17,14);
printf("*\t *\t *\t*\t*\t*\n");
gotoxy (17,15);
printf("*****\t****\t*****\t*\t*\t*****\n");
gotoxy(22,18);
printf("Ingenieria en Sistemas Automotrices");
gotoxy(26,20);
printf("Fundamentos de Programacion");
getch();
system ("cls");

gotoxy(25,5);
cprintf("Fundamentos de programacion");gotoxy(10,8);
printf("PROFESOR TITULAR: ALEJANDRO MALAMOCO GOMEZ");
gotoxy(10,10);
printf("PROFESOR DE LABORATORIO: BERNARDINO JESUS RAMIREZ SANCHEZ");
gotoxy(20,13);
printf("ALUMNO: GONZALEZ QUIROZ LUIS EDUARDO");
gotoxy(33,16);
printf("GRUPO: 1SV1");
textcolor(14);
gotoxy(29,21);
printf("ACTIVIDAD DE PROGRAMA");
gotoxy(18,23);
printf("Ecuacion de la parabola con vertice en h,k");
getch ();
system ("cls");

int opc;
system("cls");
textcolor(10);
gotoxy(35,2);
cprintf("\*PARABOLA\*");

gotoxy(28,5);
cprintf("\*SELECCIONA LA POSICION\*");

gotoxy(15,10);
printf("1. HORIZONTAL");

gotoxy(15,12);
printf("2. VERTICAL");

gotoxy(15,14);
printf("ESCRIBE EL NUMERO DE LA SELECCION DESEADA:\t");
scanf("%d",&opc);
switch(opc)

{
case 1:system("cls");
gotoxy(35,5);
cprintf("HORIZONTAL");
gotoxy(15,10);
printf("1.APERTURA HACIA LA DERECHA");
gotoxy(15,12);
printf("2.APERTURA HACIA LA IZQUIERDA");
gotoxy(15,14);
printf("ESCRIBE EL NUMERO DE LA SELECCION DESEADA:\t");
scanf("%d",&opc);
switch(opc)
{
case 1:
system("cls");
opcion1m();
break;

case 2:
system("cls");
opcion2m();
break;
}
break;

case 2:system("cls");
gotoxy(35,5);
cprintf("VERTICAL");
gotoxy(15,10);
printf("1.APERTURA HACIA ARRIBA");
gotoxy(15,12);
printf("2.APERTURA HACIA ABAJO");
gotoxy(15,14);
printf("ESCRIBE EL NUMERO DE LA SELECCION DESEADA:\t");
scanf("%d",&opc);

switch(opc)
{
case 1:
system("cls");
opcion1t();
break;

case 2:
system("cls");
opcion2t();
break;
}
}
getch();
}

void opcion1m (void)
{float h, k, p, s, r, m, x, y1, y2;
system("cls");
gotoxy(35,2);
cprintf("PARABOLA");
gotoxy(10,4);
printf("POSICION HORIZONTAL");
gotoxy(10,6);
printf("APERTURA HACIA LA DERECHA");
gotoxy(10,8);
printf("INTRODUZCA h:\t");
scanf("%f", &h);
gotoxy(10,10);
printf("INTRODUZCA k:\t");
scanf("%f", &k);
gotoxy(10,12);
printf("INTRODUZCA p:\t");
scanf("%f", &p);system("cls");

s=h+p;
r=h-p;
m=(4)*(p);
gotoxy(35,2);
cprintf("PARABOLA");
gotoxy(10,4);
printf("POSICION HORIZONTAL");
gotoxy(10,6);
printf("APERTURA HACIA LA DERECHA");
gotoxy(10,8);
printf("VERTICE (h,k): (%3.2f,%3.2f)", h, k);
gotoxy(10,10);
printf("FOCO (h+p,k): (%3.2f,%3.2f)", s, k);
gotoxy(10,12);
printf("DIRECTRIZ (x=h-p): (x=%3.2f)", r);
gotoxy(10,14);
printf("LADO RECTO 4p: %3.2f",m);
gotoxy(10,16);
printf("ECUACION ORDINARIA (y-k)^2=4p(x-h): (y-%3.2f)^2=4(%3.2f)(x-%3.2f)", k, p, h);
getch();
system("cls");
gotoxy(10,2);
cprintf("CALCULO DE LA TABLA\n\n");
gotoxy(1,4);
printf("x\ty1\t\ty2\n");
x=h;
while (x<=h+p+3)
{
y1=sqrt((4*p)*(x-h))+k;
y2=-(sqrt((4*p)*(x-h)))+k;
printf("%3.2f\t%3.2f\t\t%3.2f\n", x, y1, y2);
x=x+1;
getch();
}
}

void opcion2m...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Grafico en borland c++
  • Programas borland c++
  • Programas en borland c++
  • Programar Grafica En C++
  • Estructura de un programa grafico en C
  • Breves formulas para obtener el exito
  • Programa En C Para Promedio
  • Programa para dev c++

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS