Quote:
#include <stdio.h>
int main()
{
int group,nopeople,noticket,n=1,num=0;
float totalprice=0;
printf("How many group you want to process:");
scanf("%d",&group);
while(n<=group)
{
printf("Enter how many people in group#:",group);
scanf("%d",&nopeople);
printf("Group #\t# of Participants\tTotal Price\n");
printf("========================================== =============\n");
n++;
if (noticket>=1 && noticket<=20)
printf("%d\t\t%d\t\t%0.2f\n",group,nopeople,5.20*n opeople);
else if (noticket>=21 && noticket<=30)
printf("%d\t\t%d\t\t%0.2f\n",group,nopeople,4.85*n opeople);
else if (noticket>=31 && noticket<=50)
printf("%d\t\t%d\t\t%0.2f\n",group,nopeople,4.20*n opeople);
else if (noticket>=51 && noticket<=100)
printf("%d\t\t%d\t\t%0.2f\n",group,nopeople,3.85*n opeople);
else
printf("%d\t\t%d\t\t%0.2f\n",group,nopeople,3.00*n opeople);
}
system("pause");
return 0;
}
n the real output should be like this
Quote:
How many groups you want to process ? 2
Enter how many people in group#1: 9
Group# # of Participants Total Price
==============================
1 9 RM46.80
Enter how many people in group#2: 45
Group# # of Participants Total Price
================================
2 45 RM189.00
===================== ==========
TOTAL 54 RM235.80
===============================
n The price ticket is as below;