HOLA DE NUEVO GENTE OTRA VEZ AQUI SOLO PARA COMPARTIR UNO DE MIS LOGROS QUE NO FUE SOLO MIO SINO DEL EQUIPO QUE PARTICIPAMOS EN EL SEGUNDO ENCUENTRO DE ESTUDIANTES REALIZADO POR EL CENTRO UNIVERSITARIO DE LOS VALLES MI EQUIPO ESTABA CONFORMADO POR RAMON BUENO HERNANDEZ, JUAN MANUEL HERNANDEZ QUINTERO Y SU SERVIDOR JOSE SALVADOR MUÑIZ ALCANTAR ESTE MISMO EL CAPITAN DEL EQUIPO LLAMADO "LOS BURROS SIN MECATE" QUE PARTICIPAMOS EN EL CONCURSO DE PROGRAMACION BASICA QUE CONSTABA DE REALIZAR LA MAYOR CANTIDAD DE PROGRAMAS INDICADOS POR LOS JUECES QUIENES CALIFICABAN EL TIEMPO Y EL PROGRAMA EN SU ESTRUCTURA Y SU FUNCIONAMIENTO DEL CUAL DESPUES DE TERMINAR LA COMPETENCIA LA RESOLUCION DE LOS JUECES FUE OTORGARNOS EL PRIMER LUGAR DEL CONCURSO A NUESTRO EQUIPO Y HASTA HACE UNAS SEMANAS NOS ENTREGRARON ESTOS RECONOSIMIENTOS Y ESE MISMO DIA DEL CONCURSO UNOS PREMIOS QUE LA VERDAD VALIERON LA PENA BUENO NO LES PLATICO MAS QUE AQUI ESTAN LOS RECONOCIMIENTOS COMENTEN POR FAVOR....
El éxito sólo se logra rompiéndote la madre,de otra manera serías un suertudo no una persona exitosa, Tener éxito en la vida no es llegar a tener fama,sino a realizar aquello que realmente deseas,Una persona no vale por sus éxitos, sino de las veces que se ha levantado de sus fracasos,Lo difícil no es tener éxito, lo difícil es conservarlo, La mejor venganza es el éxito, La fuerza de tu envidia es la rapidez de mi progreso.
miércoles, 21 de septiembre de 2011
MENU DE LISTAS LIGADAS SIMPLES EN JAVA
BUENO AMIGOS DE LA CARRERA DE MECATRONICA Y A TODA LA GENTE QUE SE DIO LA OPORTUNIDAD DE LEER ESTO AQUI LES SUBO LA TAREA DE ESTA SEMANA DE PROGRAMACION QUE SON LAS LISTAS LIGADAS TERMINADOS TODOS LOS CASOS Y JALANDO A TODA MADRE BUENO JENTE DISFRUTENLO.......... Y POR FAVOR SI LO VAN A COPIAR Y PEGAR POR FAVOR DE PERDIDA COMENTEN Y AGRADESCAN QUE ME MATE HACIENDO ESTO HAHAHAHAHA NO ES CIERTO NO POR ALGO SOMOS EL #1 EN EL CONCURSO DE PROGRAMACION BASICA.
EL PRIMER ARCHIVO SE DEBE DE LLAMAR NODOLISTA Y ASI QUEDARA:
///clase (registro) que sirve para generar nodos de dos tipos de formas (2 constructores)
public class NodoLista {
// 2 campos
Object Info;
NodoLista Liga;
//PRIMER CONSTRUCTOR
public NodoLista(Object dato){
Info = dato;
Liga = null;
}
//SEGUNDO CONSTRUCTOR
public NodoLista(Object dato, NodoLista liga){
Info = dato;
this.Liga = liga; /////el this solo es para decir que la primera "liga"
} ////es global
}
ESTE ES EL ARCHIVO LLAMADO LISTA , ES DONDE SE REALIZAN LAS FUNCIONES PARA EJECUTAR LOS CONSTRUCTORES, ASI DEBE DE QUEDAR:
//// clase que manipula a los punteros para manipular los nodos en la memoria
public class Lista{
// declarar los punteros!!!
NodoLista Primero, ultimo, aux, nuevo, ant, post;
public Lista(){
Primero = ultimo = aux = nuevo = ant = post = null;
}
public void insertarAlFrente(Object dato){
if(Primero==null){// si la lista esta vacia
Primero = new NodoLista(dato);
ultimo=Primero;
}
else{////ya hay mas nodos en la lista
nuevo = new NodoLista(dato);
ultimo.Liga = nuevo;
ultimo = nuevo;
}despliegaLista();
}
public void insertarAtras(Object dato){
if(Primero==null){// si la lista esta vacia
Primero = new NodoLista(dato);
ultimo=Primero;
}
else{
nuevo = new NodoLista(dato,Primero);
Primero = nuevo;
}despliegaLista();
}
public void despliegaLista(){
aux = Primero;
System.out.println ("##########LISTA COMPLETA#########");
while (aux != null) {
System.out.println (aux.Info);
aux = aux.Liga;
}
System.out.println ("##########LISTA COMPLETA#########");
}
/////////INSERTAR ANTES DE //////////
public void insertarAntesDe(Object DatoB,Object DatoI){
if(Primero==null){
System.out.println ("lista vacia");
}
else{/////hay datos
if(buscar(DatoB)== true){
///////EMPEZAR A REALIZAR EL METODO
if(aux==Primero){///caso 1
nuevo= new NodoLista(DatoI,Primero);
Primero = nuevo;
}
else{//en caso de que no este al inicio de la lista
nuevo = new NodoLista(DatoI , aux);
ant.Liga = nuevo;
}
}
}
despliegaLista();
}
//////////////INSERTAR DESPUES DE//////////////////
public void insertarDespuesDe(Object DatoB, Object DatoI){
if(Primero==null){
System.out.println ("lista vacia");
}
else{///hay metodos
if(buscar(DatoB)== true){
//////EMPEZAR A REALIZAR EL METODO/////
if(aux==Primero){
nuevo=new NodoLista(DatoI);
Primero.Liga=nuevo;
}
else{///en caso de que no este al inicio de la lista
nuevo= new NodoLista(DatoI, aux.Liga);
aux.Liga=nuevo;
}
}
}despliegaLista();
}
///////////////METODO ELIMINAR NODO//////////////
public void eliminarNodo(Object DatoB){
if(Primero==null){
System.out.println ("lista vacia");
}
else{
if(buscar(DatoB)==true){///hacer cuatro casos
if(Primero==ultimo){//// 1 caso
Primero=ultimo=null;
}
else if(aux==Primero){
Primero=aux.Liga;
aux=null;
}
else if(aux==ultimo){
ultimo=ant;
ultimo.Liga=null;
aux=null;
}
else{
ant.Liga=aux.Liga;
aux=null;
}
}
}despliegaLista();
}
/////////////METODO PARA SUSTITUIR DATO///////////////
public void modificaLista(Object DatoB,Object DatoI){
if(Primero==null){
System.out.println ("lista vacia");
}
else{
if(buscar(DatoB)==true){
aux.Info=DatoI;
}
}despliegaLista();
}
//////////////////////////METODO BUSCAR/////////
public boolean buscar(Object DatoB){
aux = Primero;
boolean bandera = false;
while (aux != null && bandera != true) {
if(DatoB.equals(aux.Info)){// si encuentra el dato
bandera = true;
}
else{//apunta al siguiente nodo
ant = aux;
aux = aux.Liga;
post = aux.Liga;
}
}
if(bandera == true){
return true;
}
else{
System.out.println ("ese dato no existe");
return false;
}
}
}
ESO FUE EL ARCHIVO LISTA Y ESTE ES EL ARCHIVO APPLISTA , ES DONDE SE LLAMARAN A LAS FUNCIONES ASI DEBE DE QUEDAR:
import java.util.Scanner;
class AppLista{
public static void main(String args[]){
Lista lista = new Lista();
Integer DatoB,DatoI;
int opcion;
//Inicializacion del teclado
Scanner Teclado = new Scanner(System.in);
do{
System.out.println ("1) Insertar al frente");
System.out.println ("2) Insertar al Atras");
System.out.println ("3) Insertar Antes de");
System.out.println ("4) Insertar Despues de");
System.out.println ("5) Eliminar Dato");
System.out.println ("6) Modificar Dato");
System.out.println ("7) DesplegarLista");
System.out.println ("8) Salir");
opcion = Teclado.nextInt();
switch (opcion) {
case 1: System.out.println ("Que dato quieres insertar al frente de la Lista: ");
DatoI = new Integer(Teclado.nextInt());
lista.insertarAlFrente(DatoI);
break;
case 2: System.out.println ("Que dato quieres insertar Atras de la Lista: ");
DatoI = new Integer(Teclado.nextInt());
lista.insertarAtras(DatoI);
break;
case 3: System.out.println ("Que dato quieres insertar Antes de la Lista: ");
DatoI = new Integer(Teclado.nextInt());
System.out.println ("Atras de que dato quieres insertar el :"+DatoI);
DatoB = new Integer(Teclado.nextInt());
lista.insertarAntesDe(DatoB,DatoI);
break;
case 4: System.out.println ("Que dato quieres insertar Despues de la Lista: ");
DatoI = new Integer(Teclado.nextInt());
System.out.println ("Despues de que dato quieres insertar el :"+DatoI);
DatoB = new Integer(Teclado.nextInt());
lista.insertarDespuesDe(DatoB,DatoI);
break;
case 5: System.out.println ("Que dato quieres ELiminar de la Lista: ");
DatoB = new Integer(Teclado.nextInt());
lista.eliminarNodo(DatoB);
break;
case 6: System.out.println ("Que dato quieres buscar para sustituir: ");
DatoB = new Integer(Teclado.nextInt());
System.out.println ("Que dato quieres poner en el numero "+DatoB+":");
DatoI = new Integer(Teclado.nextInt());
lista.modificaLista(DatoB,DatoI);
break;
case 7: lista.despliegaLista();
break;
case 8: System.out.println ("\tbye...\n");
break;
default :System.out.println ("\topcion no valida intenta de nuevo\n");
}
}while (opcion != 8);
}
}
ESO ES TODO COMPAÑEROS ASI QUE NO SEAN CABRAS Y COMENTEN DE PERDIDA PARA AGRADESER CABRONES!!!...
EL PRIMER ARCHIVO SE DEBE DE LLAMAR NODOLISTA Y ASI QUEDARA:
///clase (registro) que sirve para generar nodos de dos tipos de formas (2 constructores)
public class NodoLista {
// 2 campos
Object Info;
NodoLista Liga;
//PRIMER CONSTRUCTOR
public NodoLista(Object dato){
Info = dato;
Liga = null;
}
//SEGUNDO CONSTRUCTOR
public NodoLista(Object dato, NodoLista liga){
Info = dato;
this.Liga = liga; /////el this solo es para decir que la primera "liga"
} ////es global
}
ESTE ES EL ARCHIVO LLAMADO LISTA , ES DONDE SE REALIZAN LAS FUNCIONES PARA EJECUTAR LOS CONSTRUCTORES, ASI DEBE DE QUEDAR:
//// clase que manipula a los punteros para manipular los nodos en la memoria
public class Lista{
// declarar los punteros!!!
NodoLista Primero, ultimo, aux, nuevo, ant, post;
public Lista(){
Primero = ultimo = aux = nuevo = ant = post = null;
}
public void insertarAlFrente(Object dato){
if(Primero==null){// si la lista esta vacia
Primero = new NodoLista(dato);
ultimo=Primero;
}
else{////ya hay mas nodos en la lista
nuevo = new NodoLista(dato);
ultimo.Liga = nuevo;
ultimo = nuevo;
}despliegaLista();
}
public void insertarAtras(Object dato){
if(Primero==null){// si la lista esta vacia
Primero = new NodoLista(dato);
ultimo=Primero;
}
else{
nuevo = new NodoLista(dato,Primero);
Primero = nuevo;
}despliegaLista();
}
public void despliegaLista(){
aux = Primero;
System.out.println ("##########LISTA COMPLETA#########");
while (aux != null) {
System.out.println (aux.Info);
aux = aux.Liga;
}
System.out.println ("##########LISTA COMPLETA#########");
}
/////////INSERTAR ANTES DE //////////
public void insertarAntesDe(Object DatoB,Object DatoI){
if(Primero==null){
System.out.println ("lista vacia");
}
else{/////hay datos
if(buscar(DatoB)== true){
///////EMPEZAR A REALIZAR EL METODO
if(aux==Primero){///caso 1
nuevo= new NodoLista(DatoI,Primero);
Primero = nuevo;
}
else{//en caso de que no este al inicio de la lista
nuevo = new NodoLista(DatoI , aux);
ant.Liga = nuevo;
}
}
}
despliegaLista();
}
//////////////INSERTAR DESPUES DE//////////////////
public void insertarDespuesDe(Object DatoB, Object DatoI){
if(Primero==null){
System.out.println ("lista vacia");
}
else{///hay metodos
if(buscar(DatoB)== true){
//////EMPEZAR A REALIZAR EL METODO/////
if(aux==Primero){
nuevo=new NodoLista(DatoI);
Primero.Liga=nuevo;
}
else{///en caso de que no este al inicio de la lista
nuevo= new NodoLista(DatoI, aux.Liga);
aux.Liga=nuevo;
}
}
}despliegaLista();
}
///////////////METODO ELIMINAR NODO//////////////
public void eliminarNodo(Object DatoB){
if(Primero==null){
System.out.println ("lista vacia");
}
else{
if(buscar(DatoB)==true){///hacer cuatro casos
if(Primero==ultimo){//// 1 caso
Primero=ultimo=null;
}
else if(aux==Primero){
Primero=aux.Liga;
aux=null;
}
else if(aux==ultimo){
ultimo=ant;
ultimo.Liga=null;
aux=null;
}
else{
ant.Liga=aux.Liga;
aux=null;
}
}
}despliegaLista();
}
/////////////METODO PARA SUSTITUIR DATO///////////////
public void modificaLista(Object DatoB,Object DatoI){
if(Primero==null){
System.out.println ("lista vacia");
}
else{
if(buscar(DatoB)==true){
aux.Info=DatoI;
}
}despliegaLista();
}
//////////////////////////METODO BUSCAR/////////
public boolean buscar(Object DatoB){
aux = Primero;
boolean bandera = false;
while (aux != null && bandera != true) {
if(DatoB.equals(aux.Info)){// si encuentra el dato
bandera = true;
}
else{//apunta al siguiente nodo
ant = aux;
aux = aux.Liga;
post = aux.Liga;
}
}
if(bandera == true){
return true;
}
else{
System.out.println ("ese dato no existe");
return false;
}
}
}
ESO FUE EL ARCHIVO LISTA Y ESTE ES EL ARCHIVO APPLISTA , ES DONDE SE LLAMARAN A LAS FUNCIONES ASI DEBE DE QUEDAR:
import java.util.Scanner;
class AppLista{
public static void main(String args[]){
Lista lista = new Lista();
Integer DatoB,DatoI;
int opcion;
//Inicializacion del teclado
Scanner Teclado = new Scanner(System.in);
do{
System.out.println ("1) Insertar al frente");
System.out.println ("2) Insertar al Atras");
System.out.println ("3) Insertar Antes de");
System.out.println ("4) Insertar Despues de");
System.out.println ("5) Eliminar Dato");
System.out.println ("6) Modificar Dato");
System.out.println ("7) DesplegarLista");
System.out.println ("8) Salir");
opcion = Teclado.nextInt();
switch (opcion) {
case 1: System.out.println ("Que dato quieres insertar al frente de la Lista: ");
DatoI = new Integer(Teclado.nextInt());
lista.insertarAlFrente(DatoI);
break;
case 2: System.out.println ("Que dato quieres insertar Atras de la Lista: ");
DatoI = new Integer(Teclado.nextInt());
lista.insertarAtras(DatoI);
break;
case 3: System.out.println ("Que dato quieres insertar Antes de la Lista: ");
DatoI = new Integer(Teclado.nextInt());
System.out.println ("Atras de que dato quieres insertar el :"+DatoI);
DatoB = new Integer(Teclado.nextInt());
lista.insertarAntesDe(DatoB,DatoI);
break;
case 4: System.out.println ("Que dato quieres insertar Despues de la Lista: ");
DatoI = new Integer(Teclado.nextInt());
System.out.println ("Despues de que dato quieres insertar el :"+DatoI);
DatoB = new Integer(Teclado.nextInt());
lista.insertarDespuesDe(DatoB,DatoI);
break;
case 5: System.out.println ("Que dato quieres ELiminar de la Lista: ");
DatoB = new Integer(Teclado.nextInt());
lista.eliminarNodo(DatoB);
break;
case 6: System.out.println ("Que dato quieres buscar para sustituir: ");
DatoB = new Integer(Teclado.nextInt());
System.out.println ("Que dato quieres poner en el numero "+DatoB+":");
DatoI = new Integer(Teclado.nextInt());
lista.modificaLista(DatoB,DatoI);
break;
case 7: lista.despliegaLista();
break;
case 8: System.out.println ("\tbye...\n");
break;
default :System.out.println ("\topcion no valida intenta de nuevo\n");
}
}while (opcion != 8);
}
}
ESO ES TODO COMPAÑEROS ASI QUE NO SEAN CABRAS Y COMENTEN DE PERDIDA PARA AGRADESER CABRONES!!!...
jueves, 21 de julio de 2011
LAS PERSONAS QUE ARRUINAN TU FOTO
este video se los muestro porque me hizo reir muchisimo jajajaja bueno bueno mejor aqui se los dejo para que lo disfruten
ya ven por eso cuando se tomen una foto simpre revicen que no alla algun pen!"#$% atras. jajaja !comenten!
jueves, 7 de julio de 2011
CODIGO PARA ORDENAR LOS DATOS DE UN VECTOR CON EL METODO DE LA BURBUJA
BUENO AMIGOS AKI DE NUEVO CON UN NUEVO APORTE QUE NOS HIZO FAVOR DE ENVIAR NUESTRO GRAN AMIGO JUAN MANUEL "JANMAN", ES UN CODIGO EN C++ PARA ORDENAR DE MENOR A MAYOR LOS NUMEROS INTRODUCIDOS EN UN VECTOR CON EL METODO DE LA BURBUJA Y LOS IMPRIME EN PANTALLA, BUENO AQUI SE LOS DEJO ESPERO Y LES SIRVA DE MUCHO AAAAA Y POR FAVOR TENGAN LA AMABILIDAD DE COMENTAR PARA AGRADECERLE A JUAN MANUEL "JANMAN".
#include <stdio.h>
#include <conio.h>
main()
{
int vector[5];
int i, m, n;
int vuelta=0;
for(i=0; i<5;i++)
{printf("\nIntroduce valor %d \n", i+1);
scanf("%d", &vector[i]);
}
do{
for(i=0; i<5;i++)
{
n=vector[i];
m=vector[i+1];
if (vector[i]>vector[i+1])
{vector[i+1]=n;
vector[i]=m;
}
}
vuelta++;
}while(vuelta!=5);
printf("\nvalores:");
for(i=0; i<5;i++)
printf("\n%d\n", vector[i]);
getch();
}
#include <conio.h>
main()
{
int vector[5];
int i, m, n;
int vuelta=0;
for(i=0; i<5;i++)
{printf("\nIntroduce valor %d \n", i+1);
scanf("%d", &vector[i]);
}
do{
for(i=0; i<5;i++)
{
n=vector[i];
m=vector[i+1];
if (vector[i]>vector[i+1])
{vector[i+1]=n;
vector[i]=m;
}
}
vuelta++;
}while(vuelta!=5);
printf("\nvalores:");
for(i=0; i<5;i++)
printf("\n%d\n", vector[i]);
getch();
}
jueves, 23 de junio de 2011
SECUENCIADOR DE LUCES
aqui les traego este nuevo aporte de las luces secuenciales es muy sencillo
este circuito es muy sencillo aqui les dejo una imagen de como se debe de ver en el proto hay tambien viene de cuanto debe de ser cada cosa la resistencia de 100k es un potenciometro para que puedan variar el 555 bueno esto es todo comenten y ustedes tambien hagan sus aportes aqui.
jueves, 2 de junio de 2011
CONTADOR JHONSON DE 4 BITS
AQUI LES TRAEGO UN NUEVO APORTE ES UN CONTADOR JHONSON DE 4 BITS ESTE DIAGRAMA ES MUY SENCILLO ES PARECIDO AL CONTADOR DE 0 A 9 SOLO QUE EL PULSO ESTA CONECTADO A LAS ENTRADAS DE RELOJ DEL FLIP FLOP Y LAS SALIDAS DEL ULTIMO FLIP FLOP ESTAN CONECTADAS CON LAS ENTRADAS DE LOS PRIMEROS AQUI SE LOS DEJO:
PARA ESTE CIRCUITO SE NECESITA:
1- 555
2 FLIP FLOP JK 74LS76
4 LED
1 RESISTENCIA 4.7K
1 RESISTENCIA 1K
1 CAPACITOR DE 100UF
1 CAPACITOR DE 100PF
BUENO ESO ES TODO LO NECESARIO ESPERO Y LES AGRADE RECUERDEN COMENTAR
PARA ESTE CIRCUITO SE NECESITA:
1- 555
2 FLIP FLOP JK 74LS76
4 LED
1 RESISTENCIA 4.7K
1 RESISTENCIA 1K
1 CAPACITOR DE 100UF
1 CAPACITOR DE 100PF
BUENO ESO ES TODO LO NECESARIO ESPERO Y LES AGRADE RECUERDEN COMENTAR
CONTADOR DE 0-9 CON FLIPFLOP JK
aqui les traego un nuevo aporte a la comunidad es un contador de 0 a 9 con 2 flip flop jk y una compuerta nand en este caso la compuerta nand la utilizamos para que funcione de reset al momento de que llegue al numero nueve el contador la compuerta nand se activara y la salida de esta misma estara conectada a los reset de los flip flop de este modo se reiniciaran y volvera a empezar la cuenta.
este es el diagrama conta de:
1- 555
2 flip flop jk 74ls76
1 nand 74ls00
1 decodificador 74ls47
1 display de anodo
1 resistensia de 4.7k
1 resistensia de 1k
1 capacitor de 100uf
1 capacitor de 100pf
y si le quieren poner resistensias al display agregan
7 resistensias de 300 ohms
espero y les sea de utilidad comenten.
este es el diagrama conta de:
1- 555
2 flip flop jk 74ls76
1 nand 74ls00
1 decodificador 74ls47
1 display de anodo
1 resistensia de 4.7k
1 resistensia de 1k
1 capacitor de 100uf
1 capacitor de 100pf
y si le quieren poner resistensias al display agregan
7 resistensias de 300 ohms
espero y les sea de utilidad comenten.
miércoles, 1 de junio de 2011
PROGRAMACION PIC EN C
hola amigos aqui de nuevo con una nueva aportacion para el blog esta vez les traigo una presentacion de power point para que la disfruten esta presentacion es para que aprendan a programar pic en c con un programa muy bueno que se llama mikroc que les permite programarlos de una forma sencilla y rapida solo agregan la librerias que trae el programa, claro que solo agregaran las librerias que van a utilizar bueno... que mas les puedo decir espero y sea de su agrado comenten y suscribanse aqui les dejo el link para que lo descarguen cualquier anomalia con el link me lo hacen saber para corregirlo.
descarga el tutorial de mikro c haciendo clic aqui
comenten y suscribanse.
descarga el tutorial de mikro c haciendo clic aqui
comenten y suscribanse.
MENU DE FUNCIONES TRIGONOMETRICAS
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <conio.h>
float y, n;
int s, i=0;
double seno(float x)
{
y=sin(x);
return (y);
}
double coseno(float x)
{
y=cos(x);
return (y);
}
double tangente(float x)
{
y=tan(x);
return (y);
}
void menu()
{
printf("\n\n\t*Este programa calcula funciones trigonometricas*");
printf("\n1. seno");
printf("\n2. coseno");
printf("\n3. tangente");
printf("\n4. salir");
printf("\n\n Selecciona una de estas opciones:");
scanf("%d",&s);
}
int main()
{
menu();
for(i=s;i!=4;)
{
system("cls");
menu();
if(s==4)
{
exit(0);
}
if(s>4)
{
printf("\n\n no existe la opcion %d, intenta de nuevo.",s);
}
switch(s)
{
case 1:
printf("\n\nEscribe el numero:");
scanf("%f", &n);
printf("\n\n El seno del numero %f es: %.3f",n,seno(n));
break;
case 2:
printf("\n\nEscribe el numero:");
scanf("%f", &n);
printf("\n\n El coseno del numero %f es: %.3f",n,coseno(n));
break;
case 3:
printf("\n\nEscribe el numero:");
scanf("%f", &n);
printf("\n\n La tangente del numero %f es: %.3f",n,tangente(n));
break;
} getch();
}
getch();
return 1;
}
"ESPERO Y LES SEA DE UTILIDAD" SUSCRIBANSE Y DEJEN COMENTARIOS PARA MEJORAR EL BLOG, PIDAN LO QUE OCUPEN Y TRATARE DE CONSEGUIRLO SOBRES DE RATO.
#include <math.h>
#include <stdlib.h>
#include <conio.h>
float y, n;
int s, i=0;
double seno(float x)
{
y=sin(x);
return (y);
}
double coseno(float x)
{
y=cos(x);
return (y);
}
double tangente(float x)
{
y=tan(x);
return (y);
}
void menu()
{
printf("\n\n\t*Este programa calcula funciones trigonometricas*");
printf("\n1. seno");
printf("\n2. coseno");
printf("\n3. tangente");
printf("\n4. salir");
printf("\n\n Selecciona una de estas opciones:");
scanf("%d",&s);
}
int main()
{
menu();
for(i=s;i!=4;)
{
system("cls");
menu();
if(s==4)
{
exit(0);
}
if(s>4)
{
printf("\n\n no existe la opcion %d, intenta de nuevo.",s);
}
switch(s)
{
case 1:
printf("\n\nEscribe el numero:");
scanf("%f", &n);
printf("\n\n El seno del numero %f es: %.3f",n,seno(n));
break;
case 2:
printf("\n\nEscribe el numero:");
scanf("%f", &n);
printf("\n\n El coseno del numero %f es: %.3f",n,coseno(n));
break;
case 3:
printf("\n\nEscribe el numero:");
scanf("%f", &n);
printf("\n\n La tangente del numero %f es: %.3f",n,tangente(n));
break;
} getch();
}
getch();
return 1;
}
"ESPERO Y LES SEA DE UTILIDAD" SUSCRIBANSE Y DEJEN COMENTARIOS PARA MEJORAR EL BLOG, PIDAN LO QUE OCUPEN Y TRATARE DE CONSEGUIRLO SOBRES DE RATO.
codigo de menu de divisas en c++
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
float r;
int opcion;
float europ( float e)
{
r=16.5892517*e;
return(r);
}
float peseu( float p)
{
r=p*0.0602799944;
return(r);
}
float pesdol( float p)
{
r=p*0.086116;
return(r);
}
float dolpes(float d)
{
r=d*11.612244;
return(r);
}
void menu()
{
do
{
system("cls");
printf("\n\n\t Convertidor de divisas\n");
printf("\n1. pesos a dolares.\n");
printf("\n2. pesos a euros.\n");
printf("\n3. dolares a pesos.\n");
printf("\n4. euros a pesos.\n");
printf("\n5. salir.\n");
printf("\n\t selecciona una de las opciones\n");
scanf("%d",&opcion );
if (opcion == 5)
exit(0);
if (opcion >5)
printf("\n\n\t opcion no valida inteta de nuevo");
} while (opcion!=1 && opcion!=2 && opcion!=3 && opcion!=4);
}
int main()
{
while(opcion!=5)
{
menu();
float cant;
switch(opcion)
{
case 1:
printf("introduce tu cantidad de dinero:");
scanf("%f",&cant);
printf("\n\n\t $%.2f pesos son lo mismo que $%.2f dolares\n\n",cant,pesdol(cant));
break;
case 2:
printf("introduce tu cantidad de dinero:");
scanf("%f",&cant);
printf("\n\n\t $%.2f pesos son lo mismo que $%.2f euros\n\n",cant,peseu(cant));
break;
case 3:
printf("introduce tu cantidad de dinero:");
scanf("%f",&cant);
printf("\n\n\t $%.2f dolares son lo mismo que $%.2f pesos\n\n",cant,dolpes(cant));
break;
case 4:
printf("introduce tu cantidad de dinero:");
scanf("%f",&cant);
printf("\n\n\t $%.2f euros son lo mismo que $%.2f pesos\n\n",cant,europ(cant));
break;
}
system("pause");
}
getch();
return 1;
}
#include<conio.h>
#include<stdlib.h>
float r;
int opcion;
float europ( float e)
{
r=16.5892517*e;
return(r);
}
float peseu( float p)
{
r=p*0.0602799944;
return(r);
}
float pesdol( float p)
{
r=p*0.086116;
return(r);
}
float dolpes(float d)
{
r=d*11.612244;
return(r);
}
void menu()
{
do
{
system("cls");
printf("\n\n\t Convertidor de divisas\n");
printf("\n1. pesos a dolares.\n");
printf("\n2. pesos a euros.\n");
printf("\n3. dolares a pesos.\n");
printf("\n4. euros a pesos.\n");
printf("\n5. salir.\n");
printf("\n\t selecciona una de las opciones\n");
scanf("%d",&opcion );
if (opcion == 5)
exit(0);
if (opcion >5)
printf("\n\n\t opcion no valida inteta de nuevo");
} while (opcion!=1 && opcion!=2 && opcion!=3 && opcion!=4);
}
int main()
{
while(opcion!=5)
{
menu();
float cant;
switch(opcion)
{
case 1:
printf("introduce tu cantidad de dinero:");
scanf("%f",&cant);
printf("\n\n\t $%.2f pesos son lo mismo que $%.2f dolares\n\n",cant,pesdol(cant));
break;
case 2:
printf("introduce tu cantidad de dinero:");
scanf("%f",&cant);
printf("\n\n\t $%.2f pesos son lo mismo que $%.2f euros\n\n",cant,peseu(cant));
break;
case 3:
printf("introduce tu cantidad de dinero:");
scanf("%f",&cant);
printf("\n\n\t $%.2f dolares son lo mismo que $%.2f pesos\n\n",cant,dolpes(cant));
break;
case 4:
printf("introduce tu cantidad de dinero:");
scanf("%f",&cant);
printf("\n\n\t $%.2f euros son lo mismo que $%.2f pesos\n\n",cant,europ(cant));
break;
}
system("pause");
}
getch();
return 1;
}
Suscribirse a:
Entradas (Atom)