tengo que acabar este proyecto y lo tengo que entregar mañana a las 8 am, ya tiene ciclo while y if else,pero me falta hacerle arreglos,la vedad soy nuevo en esto y nose como meterle arreglos, si algun heroe que esta ahí que me ayude por favor,se lo agradeció con toda mi vida.
por favor, lo necesito para mañana, por favor
aqui esta mi proyecto
#include <stdio.h>
#include <conio.h>
int main ()
{
int opc,opc1,opc2,op3,op4,op5,op6,op7,cantidad;
double acumsub=0, acumtotal=0,total,subtotal;
printf("desea acceder al menu? \n ");
printf("1.si \n");
printf("2.no \n");
scanf("%d",&opc);
while(opc!=2)
{
printf(" OTAKO MARKET \n ");
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \n ");
pirntf(" ~~~~~~~~~~~~~~~~~~~~~~~ \n ");
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \n ");
printf("^ 1. Pokies 70.00 ^ \n ");
printf("^ 2. Ramen 60.00 ^ \n ");
printf("^ 3. Ramune 60.00 ^ \n ");
printf("^ 4. Dangos 40.00 ^ \n ");
printf("^ 5. Anpan 30.00 ^ \n ");
printf("^ 6. Wagashi 30.00 ^ \n ");
printf("^ 7. Onigiri 20.00 ^ \n ");
printf("* INGRESE EL NUMERO DE PRODUCTO QUE DESEA* \n");
scanf("%d",&opc1);
printf("cantidad para llevar \n ");
scanf ("%d",&cantidad);
if (opc1=1)
{
subtotal=cantidad*70.00;
total=subtotal;
printf("EL SUBTOTAL A PAGAR ES DE: %2.lf \n ",subtotal);
printf("TOTAL A PAGAR: %2.lf \n ",total);
}
else if (opc1==2)
{
subtotal=cantidad*60.00;
total=subtotal;
printf("EL SUBTOTAL A PAGAR ES DE: %2.lf \n ",subtotal);
printf("TOTAL A PAGAR: %2.lf \n ",total);
}
else if (opc1==3)
{
subtotal=cantidad*60.00;
total=subtotal;
printf("EL SUBTOTAL A PAGAR ES DE: %2.lf \n ",subtotal);
printf("TOTAL A PAGAR: %2.lf \n ",total);
}
else if (opc1==4)
{
subtotal=cantidad*40.00;
total=subtotal;
printf("EL SUBTOTAL A PAGAR ES DE: %2.lf \n ",subtotal);
printf("TOTAL A PAGAR: %2.lf \n ",total);
}
else if (opc1==5)
{
subtotal=cantidad*30.00;
total=subtotal;
printf("EL SUBTOTAL A PAGAR ES DE: %2.lf \n ",subtotal);
printf("TOTAL A PAGAR: %2.lf \n ",total);
}
else if (opc1==6)
{
subtotal=cantidad*30.00;
total=subtotal;
printf("EL SUBTOTAL A PAGAR ES DE: %2.lf \n ",subtotal);
printf("TOTAL A PAGAR: %2.lf \n ",total);
}
else if (opc1==7)
{
subtotal=cantidad*20.00;
total=subtotal;
printf("EL SUBTOTAL A PAGAR ES DE: %2.lf \n ",subtotal);
printf("TOTAL A PAGAR: %2.lf \n ",total);
}
else
{
printf("ERROR,la opcion no es valida \n ");
}
acumsub+=subtotal;
acumtotal+=total;
printf ("Desea realizar otra compra? \n ");
printf ("1.si \n");
printf ("2.no \n");
scanf ("%d",&opc);
}
printf ("EL SUBTOTAL ES DE: %2.lf",acumsubtotal);
printf ("EL TOTAL A PAGAR ES DE: %2.lf",acumtotal);
getch ();
return 0;
}
Mod: Obligatorio el uso dee etiquetas GeSHi.