jueves, 7 de noviembre de 2019

Ejercicio 17 Factura

 #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 firma();
 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();
    firma();
    return 0;
 }

 void captura()
 {
     cout <<endl << endl<<"                **DISTRIBUIDORA ALEMAN**                         "<<endl;
     cout <<endl<<endl<<"  ~CLIENTE:  ";

     gets(cadena);
     cout <<endl<<endl<<"                                      ~FECHA:  ";
     gets(cadena);

     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<<endl<<"                                ~El Total es:  " << total << endl;

  iva= total*.16;
  cout << endl<<endl <<"                                ~El IVA es:  " << iva << endl;
 }

 void margen ()
{

for(int x=1; x<=60; x++)
{
gotoxy (x,0);
putchar ('-');
gotoxy (x,40);
putchar ('-');
}

for(int y=1; y<=40; y++)
{
gotoxy (0,y);
putchar ('|');
gotoxy (60,y);
putchar ('|');
}
}
void firma()
{
    cout<<"\n\n\n"<<endl;
cout<<"     ,;;;, ,;;;,                 ,;;;, ,;;;,       "<<endl;
cout<<"    ;;;' ';' ';;;               ;;;' ';' ';;;         "<<endl;
cout<<"    ;;;       ;;;               ;;;       ;;;        "<<endl;
cout<<"     ';;,   ,;;' AMERICA CITLALY ';;,   ,;;'       "<<endl;
cout<<"       ';;,;;'                     ';;,;;'          "<<endl;
cout<<"         ';'                         ';'        "<<endl;
system("color 75");
}

No hay comentarios:

Publicar un comentario

Cadenas

#include <iostream> #include <stdio.h> #include <string.h> using namespace std; char nombre[50],paterno[50],materno[20...