Final Exam
Final Exam
TAREGA BSIT-1B
#include <stdio.h>
#include<string.h>
#include <stdlib.h>
#include <conio.h>
char name[20];
int qty;
float price;
}item;
int main()
char choice,choice2;
item list[10];
printf("Item: ");
scanf("%s", list[i].name);
printf("Quantity: ");
scanf("%d", &list[i].qty);
printf("Price: ");
scanf("%f", &list[i].price);
printf("\n");
scanf("%s",&choice);
temp++;
}else{
break;
int cnt = i;
total+=sum;
printf("\n");
printf("\n");
printf("\n");
if(choice2=='Y'||choice2=='y')
scanf("%d",&friends);
printf("\n");
else if(choice2=='N'||choice2=='n')
scanf("%f",&cash);
while(cash<total)
printf("\nInvalid Cash");
scanf("%f",&cash);
float solo_change=cash-total;
exit(1);
else
while(choice2)
printf("Invalid input\n");
printf("Do you want to divide the expenses? (Y / N): ");
scanf("%s",&choice2);
printf("\n");
if(choice2=='N'||choice2=='n')
scanf("%f",&cash);
while(cash<total)
printf("\nInvalid Cash");
scanf("%f",&cash);
float solo_change=cash-total;
exit(1);
else if(choice2=='Y'||choice2=='y')
scanf("%d",&friends);
printf("\n");
break;
printf("\n");
}
}
for(j=0;j<friends;j++)
scanf("%f",&friends_money);
while(friends_money<t_payment)
printf("\nInvalid Cash");
scanf("%f",&friends_money);
printf("\n");
sum_cash+=friends_money;
gen_change += friends_change;
printf("______________________________________\n");
return 0;
}
//RESULTS//
|
|
|
|
|
v