jueves, 14 de noviembre de 2019

Programa 19 (Parte 2)

Programa 19 (Parte 2)

Programa 19 (Parte 2)
 #include <stdlib.h>
 #include <stdio.h>
 #include <iostream>
 #include <windows.h>

 using namespace std;

char cadena[30];
 int cliente,fac,pre1,pre2,pre3,total,iva;
 void captura();
 void operacion();
 void margen();
 void gotoxy(int x, int y)
 {
     HANDLE hcon;
    hcon=GetStdHandle(STD_OUTPUT_HANDLE);
    COORD dwPos;
    dwPos.X=x;
    dwPos.Y=y;
    SetConsoleCursorPosition(hcon,dwPos);
 }

 int main()

 {
    captura();
    operacion();
    margen();
   
     return 0;
 }

 void captura()

 {
     cout <<endl << endl<<"                         DISTRIBUIDORA ALEMAN                         "<<endl;
     cout <<endl<<endl<<"  CLIENTE:  ";
     gets(cadena);
     cout <<endl<<endl<<"  FACTURA:  " ;
     cin >> fac;
     cout << endl <<"  PRECIO 1:  ";
     cin >> pre1;
     cout << endl <<"  PRECIO 2:  ";
     cin >> pre2;
     cout << endl <<"  PRECIO 3:  ";
     cin >> pre3;
 }

 void operacion()

 {
  total=pre1+pre2+pre3;
  cout << endl << endl<<"  El Total es:  " << total << endl;
  
  iva= total*.16;
  cout << endl <<"  El IVA es:  " << iva << endl;
 }

 void margen ()

{

for(int x=1; x<=79; x++)

{
gotoxy (x,0);
putchar ('*');
gotoxy (x,24);
putchar ('*');
}

for(int y=1; y<=24; y++)

{
gotoxy (0,y);
putchar ('*');
gotoxy (79,y);
putchar ('*');
}
}

No hay comentarios.:

Publicar un comentario