miércoles, 6 de noviembre de 2019

Programa 8(Firma)

#include <stdio.h>
#include <iostream>
#include <windows.h>
using namespace std;

void gotoxy(int x,int y){
HANDLE hcon;
hcon=GetStdHandle(STD_OUTPUT_HANDLE);
COORD dwpos;
dwpos.X=x;
dwpos.Y=y;
SetConsoleCursorPosition(hcon, dwpos);
}
void ingresar();
void calcular();
void impresion();

float CT,TP,a,b,c,d,e,iva=0.016,i;

int main(){
system("color F0");
ingresar();
calcular();
impresion();
return 0;
}

void ingresar(){
cout<<"Ingrese el precio del primer producto"<<endl;
cin>>a;
cout<<"Ingrese el precio del segundo producto"<<endl;
cin>>b;
cout<<"Ingrese el precio del tercer producto"<<endl;
cin>>c;
cout<<"Ingrese el precio del cuarto producto"<<endl;
cin>>d;
cout<<"Ingrese el precio del quinto producto"<<endl;
cin>>e;
}

void calcular(){
CT=a+b+c+d+e;
i=iva*CT/100;
TP=CT+i;
}

void impresion(){
cout<<"La compra total es:"<<CT<<endl;
cout<<"El IVA es:"<<i<<endl;
cout<<"El total a pagar es:"<<TP<<endl;
for(int i=1; i<=1; i++){
gotoxy(36,i);
for(int i=0; i<=0; i++){
cout<<"B";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"a";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"r";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"b";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"a";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<" ";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"M";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"e";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"d";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"i";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"n";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"a";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<" ";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"C";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"a";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"r";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"l";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"o";
Sleep(100);
}
for(int i=0; i<=0; i++){
cout<<"s ";
Sleep(100);
}
}
system("pause");
system("cls");
}

No hay comentarios:

Publicar un comentario