PROGRAMA 19
(factura)
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
using namespace std;
char cadena[30];
void captura();
void imprimir();
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 fac,p1,p2,p3,suma,total,x,y;
int main()
{
captura();
imprimir();
margen();
return 0;
}
void captura()
{
cout<<endl<<endl<<"-----------------DISTRIBUIDORA----------------"<<endl;
cout<<endl<<endl<<"----------------------ALEMAN----------------------"<<endl;
cout<<endl<<endl<<" CLIENTE: ";
gets(cadena);
cout<<endl<<endl<<" FACTURA: ";
cin>>fac;
cout<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<"PRECIO"<<endl;
cout<<endl<<" PRODUCTO 1: ";
cin>>p1;
cout<<endl<<" PRODUCTO 2: ";
cin>>p2;
cout<<endl<<" PRODUCTO 3: ";
cin>>p3;
}
void imprimir()
{
suma=p1+p2+p3;
total=suma*0.16;
cout<<endl<<endl<<" Total: "<<suma<<endl;
cout<<endl<<" IVA: "<<total<<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