Examen Armando

Páginas: 17 (4213 palabras) Publicado: 27 de octubre de 2015
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
typedef struct{
int origen;
int destino;
int distancia;
int ubicacion_N;
int ubicacion_W;
}Ruta;

typedef struct{
int dd;
int mm;
int aaaa;
}Fecha;typedef struct{
int hh;
int mm;
}Hora;

typedef struct{
int inentificacion;
int tipo;
Ruta ruta;
Fecha fecha_salida;
Hora hora_salida;
Fecha fecha_llegada;
Hora hora_llegada;
int disponibilidad;
int mantenimiento;}Unidad;

Unidad camiones[15];

int i,opp,op2,distancia,opd,op3,op4,op4_1,op4_1k,op4_1u,op4_2,op4_2k,op4_2u,op5,op5c,op5c_1,op5c_2,op5c_3,op5c_4,op5m,op5m_1,op5m_2,op5m_3,op5m_4,t,m,op6,c,p;


void liberar(){
camiones[op3-1].disponibilidad=0;
}

void km(){
printf("Kilometros recorridos:%d\n\n",camiones[op4_1k-1].ruta.distancia);
}

void mkm(){
printf("Inserte km: ");
scanf("%d",&camiones[op4_2k-1].ruta.distancia);
}

void cu(){
camiones[op4_1u-1].ruta.ubicacion_N=(rand()%1000);
camiones[op4_1u-1].ruta.ubicacion_W=(rand()%1000);
printf("La unidad se encuentra en las coordenadas %dN%dW\n\n",camiones[op4_1u-1].ruta.ubicacion_N,camiones[op4_1u-1].ruta.ubicacion_W);
}

void mu(){
printf("Inserte coordenadas Norte: ");
scanf("%d",&camiones[op4_2u-1].ruta.ubicacion_N);
printf("\nInserte coordenadas Oeste: ");
scanf("%d",&camiones[op4_2u-1].ruta.ubicacion_W);
}

void cfe(){
camiones[op5c_1-1].fecha_llegada.dd=(rand()%30)+1;camiones[op5c_1-1].fecha_llegada.mm=(rand()%12)+1;
camiones[op5c_1-1].hora_llegada.hh=(rand()%24)+1;
camiones[op5c_1-1].hora_llegada.mm=(rand()%60)+1;
printf("La fecha de entrada de la unidad fue: %d/%d/%d a las%d:%d\n\n",camiones[op5c_1-1].fecha_llegada.dd,camiones[op5c_1-1].fecha_llegada.mm,camiones[op5c_1-1].fecha_llegada.aaaa,camiones[op5c_1-1].hora_llegada.hh,camiones[op5c_1-1].hora_llegada.mm);
}

void cfs(){
camiones[op5c_2-1].fecha_llegada.dd=(rand()%30)+15;
camiones[op5c_2-1].fecha_llegada.mm=(rand()%12)+1;
camiones[op5c_2-1].hora_llegada.hh=(rand()%24)+1;
camiones[op5c_2-1].hora_llegada.mm=(rand()%60)+1;
printf("La fecha de salida de la unidad es: %d/%d/%d a las%d:%d\n\n",camiones[op5c_2-1].fecha_llegada.dd,camiones[op5c_2-1].fecha_llegada.mm,camiones[op5c_2-1].fecha_llegada.aaaa,camiones[op5c_2-1].hora_llegada.hh,camiones[op5c_2-1].hora_llegada.mm);
}
void ct(){
t=(rand()%15)+1;
printf("Tiempo en mantenimiento: %ddias\n\n",t);
}
void tm(){
m=(rand()%2);
if(m==0){printf("El tipo de mantenimiento es: Preventivo\n\n");}
else{printf("El tipo de mantenimiento es:Correctivo\n\n");}
}

void mfe(){
printf("Introdusca el dia: ");
scanf("%d",&camiones[op5m_1-1].fecha_llegada.dd);
printf("\nIntrodusca el mes: ");
scanf("%d",&camiones[op5m_1-1].fecha_llegada.mm);
printf("\nIntrosuca el año: ");
scanf("%d",&camiones[op5m_1-1].fecha_llegada.aaaa);
printf("\nIntrodusca la hora: ");scanf("%d",&camiones[op5m_1-1].hora_llegada.hh);
printf("\nIntrodusca los minutos: ");
scanf("%d",&camiones[op5m_1-1].hora_llegada.mm);
}

void mfs(){
printf("Introdusca el dia: ");
scanf("%d",&camiones[op5m_2-1].fecha_llegada.dd);
printf("\nIntrodusca el mes: ");
scanf("%d",&camiones[op5m_2-1].fecha_llegada.mm);
printf("\nIntrosuca...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Examen De Admision Armanda De Mexico
  • Armando
  • armando
  • ARMANDO
  • Armand
  • armando
  • armand
  • armando

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS