Está en la página 1de 13

//Resendiz Daniel Lisset

#include <iostream>

#include <cstring>

#include <cstdlib>

#include <iomanip>

#include <ctime>

#include <conio.h>

#include <windows.h>

using namespace std;

class Aeropuerto{

private:

char nombre[15], apellido[15], vuelo[15], clase[15], destino[18];

int boletos, tarifa_clase, tarifa_destino, TUA;

float pesoExtra, tarifa_pesoExtra, costoTotal, IVA;

int op_MenuP, op_Tvuelo, op_Tclase, op_destino, op_pesoExtra, op_confirmar;

double folio;

public:

Aeropuerto(){}

int MenuPrincipal();

void Comprar();

void Folio(){ srand(time(NULL)); folio=rand(); }

void TipoVuelo();

void TipoClase();

void DestinoNacional();

void DestinoInternacional();

void Boletos();

void PesoExtra();
void Confirmar();

float Tabla();

void gotoxy(int x, int y);

};

int Aeropuerto::MenuPrincipal(){ system("cls");

cout << "\n\t\t==========================" << endl;

cout << "\n\t\t LISSET AIRLINES" << endl;

cout << "\t\t = MENU PRINCIPAL =" << endl;

cout << "\t\t==========================\n" << endl;

cout << "\t\t(1)- Generar Venta." << endl;

cout << "\t\t(2)- Generar Corte." << endl;

cout << "\t\t(3)- Salir.\n" << endl;

cout << "\t\t---> Seleccion: ";

cin >> op_MenuP; system("cls");

return op_MenuP;

void Aeropuerto::TipoVuelo(){ system("cls");

cout << "\n\t---------------------------------------------";

cout << "\n\t\tSelecione un tipo de vuelo.";

cout << "\n\t---------------------------------------------\n";

cout << "\n\t\t(1) Nacional";

cout << "\n\t\t(2) Internacional";

cout << "\n\n\t---> Seleccion: ";

cin >> op_Tvuelo;

void Aeropuerto::TipoClase(){
AB: system("cls");

cout << "\n\t---------------------------------------------";

cout << "\n\t\tSelecione un tipo de clase.";

cout << "\n\t---------------------------------------------\n";

cout << "\n\t\t" << setw(9) << "CLASE" << setw(16) << "TARIFA" << endl;

cout << "\n\t\t(1) Clase Ejecutiva" << setw(8) << "$ 1950";

cout << "\n\t\t(2) Clase Turista" << setw(8) << "$ 1250";

cout << "\n\n\t---> Seleccion: ";

cin >> op_Tclase;

switch(op_Tclase){

case 1: strcpy(clase, "PRIMERA C"); tarifa_clase = 1950; break;

case 2: strcpy(clase, "SEGUNDA C"); tarifa_clase = 1250; break;

default: goto AB; break;

void Aeropuerto::DestinoNacional(){

AC: system("cls");

cout<<"\n\t--------------------------------------------------------------------------------";

cout<<"\n\t\t Seleccione un destino nacional.";

cout<<"\n\t--------------------------------------------------------------------------------\n";

cout<<"\n\t\t DESTINO TARIFA VUELOS DISPONIBLES PARA MA\245ANA \n";

cout<<"\n\t\t(1) Baja California $ 800 Salida: 07:45 Legada 11:30";

cout<<"\n\t\t(2) Jalisco $ 450 Salida: 08:30 Legada 10:00";

cout<<"\n\t\t(3) Nuevo Leon $ 700 Salida: 12:00 Legada 01:50";

cout<<"\n\t\t(4) Queretaro $ 350 Salida: 17:45 Legada 18:45";


cout<<"\n\t\t(5) Sinaloa $ 680 Salida: 22:00 Legada 23:35";

cout << "\n\n\t---> Seleccion: ";

cin >> op_destino;

switch(op_destino){

case 1: strcpy(destino, "B CALIFORN"); tarifa_destino = 800;break;

case 2: strcpy(destino, "JALISCO "); tarifa_destino = 450; break;

case 3: strcpy(destino, "NUEVO LEON"); tarifa_destino = 700;break;

case 4: strcpy(destino, "QUERETARO "); tarifa_destino = 350; break;

case 5: strcpy(destino, "SINALOA "); tarifa_destino = 680; break;

default: goto AC; break;

void Aeropuerto::DestinoInternacional(){

AE: system("cls");

cout<<"\n\t--------------------------------------------------------------------------------------------------------
----";

cout<<"\n\t\t Seleccione un destino Internacional.";

cout<<"\n\t--------------------------------------------------------------------------------------------------------
----\n";

cout<<"\n\t\t DESTINO TARIFA VUELOS DISPONIBLES PARA MA\245ANA\n";

cout<<"\n\t\t(1) Brasil $ 1800 VUELO DIRECTO: CDMX a Brasilia Salida: 06:00


Legada 18:00";

cout<<"\n\t\t(2) Canada $ 1450 VUELO DIRECTO: CDMX a Toronto Salida: 00:40


Legada 05:55";

cout<<"\n\t\t(3) Espa\244a $ 1700 VUELO DIRECTO: CDMX a Madrid Salida:


01:00 Legada 11:00";

cout<<"\n\t\t(4) EUA $ 1350 VUELO DIRECTO: CDMX a Las Vegas Salida: 13:00
Legada 15:55";
cout<<"\n\t\t(5) Francia $ 1680 VUELO ESCALA: CDMX a Paris Salida: 07:45
Legada 11:30";

cout << "\n\n\t---> Seleccion: ";

cin >> op_destino;

switch(op_destino){

case 1: strcpy(destino, "BRASIL "); tarifa_destino = 1800;break;

case 2: strcpy(destino, "CANADA "); tarifa_destino = 1450; break;

case 3: strcpy(destino, "ESPAÑA "); tarifa_destino = 1700;break;

case 4: strcpy(destino, "EUA "); tarifa_destino = 1350; break;

case 5: strcpy(destino, "FRANCIA"); tarifa_destino = 1680; break;

default: goto AE; break;

void Aeropuerto::Boletos(){

cout << "\n\t---------------------------------------------";

cout << "\n\t Numero total de boletos a comprar: "; cin >> boletos;

cout << "\t---------------------------------------------\n";

void Aeropuerto::PesoExtra(){

AD: system("cls");

cout << "\n\t---------------------------------------------";

cout << "\n\t\tDesea agregar Peso Extra.";

cout << "\n\t---------------------------------------------\n";

cout << "\n\t\t(1) SI" << setw(18) << "(2) NO";

cout << "\n\n\t---> Seleccion: ";

cin >> op_pesoExtra;


if(op_Tvuelo == 1){

switch(op_pesoExtra){

case 1:

cout << "\n\t Por cada kilo extra se cobrara $80.00"

"\n\t Ingrese la cantidad de peso extra en Kg: ";

cin >> pesoExtra; tarifa_pesoExtra = pesoExtra*80;

cout << "\n\tTarifa por el Peso Extra: " << tarifa_pesoExtra;

break;

case 2: tarifa_pesoExtra = 0; break;

default: goto AD; break;

else if(op_Tvuelo == 2){

switch(op_pesoExtra){

case 1:

cout << "\n\t Por cada kilo extra se cobrara $140.00"

"\n\t Ingrese la cantidad de peso extra en Kg: ";

cin >> pesoExtra; tarifa_pesoExtra = pesoExtra*140;

cout << "\n\tTarifa por el Peso Extra: " << tarifa_pesoExtra;

break;

case 2: tarifa_pesoExtra = 0; break;

default: goto AD; break;

void Aeropuerto::Comprar(){

A: system("cls");
cout << "\n\t\t==========================";

cout << "\n\t\t = REGISTRO DE COMPRA =";

cout << "\n\t\t==========================";

cout << "\n\t---------------------------------------------";

cout << "\n\t\tLlene los siguientes campos.";

cout << "\n\t---------------------------------------------\n";

cout << "\n\tNombre de Pila: "; cin >> nombre;

cout << "\tApellido Paterno: "; cin >> apellido;

AA: TipoVuelo();

switch(op_Tvuelo){

case 1:

strcpy(vuelo, "NACIONAL");

TipoClase();

DestinoNacional();

Boletos();

PesoExtra();

cout << "\n\t---------------------------------------------" << endl;

cout << "\t---------------------------------------------" << endl;

cout << "\t"; system("pause"); system("cls");

TUA = 575; IVA = 0.04;

break;

case 2:

strcpy(vuelo, "INTERNAC");
TipoClase();

DestinoInternacional();

Boletos();

PesoExtra();

cout << "\n\t---------------------------------------------" << endl;

cout << "\t---------------------------------------------" << endl;

cout << "\t"; system("pause"); system("cls");

TUA = 1240; IVA = 0.16;

break;

default: goto AA; break;

costoTotal = (boletos*(tarifa_destino + tarifa_clase) + tarifa_pesoExtra + TUA)*(IVA + 1);

Confirmar();

if(op_confirmar == 1){ cout << endl << setw(40) <<"PROCESANDO COMPRA..." << endl <<
setw(41) << "TRANSFERENCIA DE DATOS";}

else if(op_confirmar == 2){ fflush(stdin); goto A; }

void Aeropuerto::Confirmar(){ Folio(); // Llama a la función folio.

cout << "\n\t---------------------------------------------";

cout << "\n\t\t\tVISTA PREVIA";

cout << "\n\t---------------------------------------------" << endl;


cout << "\n\t\tNombre completo: " << nombre << " " << apellido;

cout << "\n\t\tFolio: AL-" << folio;

cout << "\n\t\tVuelo: " << vuelo << "\n\t\tClase: " << clase;

cout << "\n\t\tDestino: " << destino << "\n\t\tBoletos: " << boletos;

cout << "\n\t\tPeso Extra: " << pesoExtra << " Kg";

cout << "\n\t\tTarifa Peso Extra: $ " << tarifa_pesoExtra;

cout << "\n\t\tIVA = " << IVA << endl;

cout << "\n\t---------------------------------------------" << endl;

cout << setw(45) << "Costo Total: $ " << costoTotal;

cout << "\n\n\t---------------------------------------------" << endl;

cout << setw(38) << "CONFIRMAR COMPRA";

cout << "\n\t---------------------------------------------" << endl;

cout << "\n\t\t(1) SI" << setw(18) << "(2) NO";

cout << "\n\n\t---> Seleccion: ";

cin >> op_confirmar;

float Aeropuerto::Tabla(){

static int y = 7;

gotoxy(6,y); cout << nombre; gotoxy(17,y); cout << vuelo; gotoxy(28,y); cout << clase;

gotoxy(41,y); cout << destino; gotoxy(58,y); cout << boletos; gotoxy(67,y); cout <<
pesoExtra << " Kg";

gotoxy(79,y); cout << "$ " << tarifa_pesoExtra; gotoxy(93,y); cout << "AL-" << folio ;

gotoxy(105,y); cout << "$ " << costoTotal << endl; Sleep(500);

y++;

return costoTotal;

}
void Descripcion();

void Corte(int);

float GanTot = 0;

int main(){

int n, op;

system("Esime");

Descripcion();

cout << endl << endl;

cout << endl << setw(84) << "---------------------------------------------";

cout << endl << setw(66) << "CLIENTES";

cout << endl << setw(84) << "---------------------------------------------";

Sleep(400);

cout << endl << setw(70) << "D\241gite el n\243mero de clientes: ";

cin >> n; n++;

Aeropuerto *Usuario = new Aeropuerto[n];

do{

B: op = Usuario[0].MenuPrincipal();

switch(op){

case 1: for(int i=1; i<n; i++){ Usuario[i].Comprar(); } break;

case 2: Corte(1);

for(int i=1; i<n; i++){ GanTot += Usuario[i].Tabla(); }

Corte(2);

break;

case 3: exit(0); break;

default: goto B; break;


}

}while(op!=3);

delete [] Usuario;

getch();

return 0;

void Aeropuerto::gotoxy(int x, int y){

HANDLE hcon;

hcon = GetStdHandle(STD_OUTPUT_HANDLE);

COORD dwPos;

dwPos.X = x;

dwPos.Y = y;

SetConsoleCursorPosition(hcon,dwPos);

void Descripcion(){

char mensaje[10] = {'B','I','E','N','V','E','N','I','D','O'};

cout << endl;

cout << endl << setw(90) <<


"\t===========================================================";

cout << endl << setw(89) << " \tREGISTRO DE VUELOS Y COSTOS DIARIOS DE AEROLINEA
LISSET AIR";

cout << endl << setw(90) <<


"\t==========================================================="; Sleep(500);

cout << endl << setw(90) << "----------------------------------------------------------"; Sleep(600);

cout << endl << endl << setw(38);

for(int i=0; i<10; i++){ Sleep(300); cout << " " << mensaje[i]; }
cout << "\n\n" << setw(90) << "----------------------------------------------------------";

cout << endl << setw(65) << "Presione enter para continuar... "; getch();

Sleep(300);

void Corte(int _op){

float CAD, USD, EUR, GBP;

const float dolarCAN = 0.064;

const float dolarEUA = 0.051;

const float EURO = 0.042;

const float LibrEstrl = 0.037;

if(_op == 1){ cout << endl;

cout << setw(73) << "=========================" << endl;

cout << setw(72) << " = GENERANDO CORTE =" << endl;

cout << setw(73) << "=========================" << endl; Sleep(500);

cout << endl << setw(12) << "NOMBRE" << setw(11) << "VUELO" << setw(12) <<
"CLASE"

<< setw(13) << "DESTINO" << setw(14) << "BOLETOS" << setw(13) <<
"PESO EXTRA"

<< setw(13) << "TARIFA P.E." << setw(11) << "FOLIO" << setw(12) <<
"COSTO" << endl;

cout << " ------------------------------------------------------------------------------------------------


------------------";

Sleep(300);

else if(_op == 2){

Sleep(300);

cout << " ------------------------------------------------------------------------------------------------


------------------";

Sleep(500);
cout << setw(111) << "Total = $ " << GanTot << endl;

CAD = GanTot*dolarCAN; USD = GanTot*dolarEUA;

EUR = GanTot*EURO; GBP = GanTot*LibrEstrl;

cout << endl << setw(29) << "DIVISAS" << endl; Sleep(500);

cout << endl << setw(28) << "Total = $ " << CAD << " CAD"; Sleep(500);

cout << endl << setw(28) << "Total = $ " << USD << " USD"; Sleep(500);

cout << endl << setw(28) << "Total = E " << EUR << " EUR"; Sleep(500);

cout << endl << setw(28) << "Total = \234 " << GBP << " GBP"; Sleep(500);

cout << endl << " ------------------------------------------------";

cout << endl << " Presione cualquier tecla para salir... ";

getch(); exit(0);

También podría gustarte