martes, 5 de noviembre de 2019

Programa 8(VOID)

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

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;
}

No hay comentarios:

Publicar un comentario