Good afternoon, in the following exercise, if I want to serve two people for example, when asking for the first data and what you are going to buy, you do not throw the invoice, but you throw it with the last one or this case In the latter case, it also combines the data and does not do it individually for one.
It should be noted that there are still several cases that need to be worked out in the program and, in addition, to print the total sold and attended to, but at the moment this doubt does not allow me to continue.
#include "iostream"
#include "stdio.h"
#include "math.h"
#include "stdlib.h"
#include "iomanip"
using namespace std;
int main(int argc, char const *argv[])
{
int i, n, cn = 0, combo, c1, c2, c3;
float combo1 = 8500, combo2 = 11700, combo3 = 15000;
float descuento = 0, subtotal, total;
char nombre[30], carnet = 's';
cout<<"< = = = C L A P Edo. T A C H I R A = = = >";
cout<<"\n\nCantidad de Personas para Atender: ";
cin>>n;
for(i = 0 ; i < n ; i++)
{
cn++;
system("cls");
cout<<"< = = = C L A P Edo. T A C H I R A = = = >";
cout<<"\n\nNombre del Ciudadano: "<<cn;cout<<" ";
cin>>nombre;
cout<<"\nPosee Carnet de la Patria (S/N): ";
cin>>carnet;
if(carnet == 's' || carnet =='S')
{
system("cls");
cout<<"< = = = C L A P Edo. T A C H I R A = = = >";
cout<<"\n\nCombos Disponibles: ";
cout<<"\n\nCombo 1 (Bs. 8500)";
cout<<"\nCombo 2 (Bs. 11700)";
cout<<"\nCombo 3 (Bs. 15000)";
cout<<"\n\nCombo a Comprar: ";
cin>>combo;
switch (combo)
{
case 1:
system("cls");
cout<<"< = = = C L A P Edo. T A C H I R A = = = >";
cout<<"\n\nCombo 1 (Bs. 8500)";
cout<<"\n\nCantidad a Comprar: ";
cin>>c1;
subtotal = c1 * combo1;
if(subtotal > 50000)
descuento = subtotal * 8.7/100;
total = subtotal - descuento;
system("cls");
cout<<"< = = = C L A P Edo. T A C H I R A = = = >";
cout<<"\n\n< - F A C T U R A - >";
cout<<"\n\nCliente: "<<nombre;
cout<<"\n\nSubtotal: Bs. "<<subtotal;
cout<<"\nDescuento: Bs. -"<<descuento;
cout<<"\n\nTotal a Pagar: Bs. "<<total;
break;
default:
cout<<"Opcion Invalida, Intente Nuevamente";
}
}
}
return 0;
}