/*
 * assign: hw#5 
 */

#include <stdio.h>

void main(void) 
{
	float total, order, amount, change, tax;
	int num_of_order;
 
 	/* initizing variables.. tax rate is 7.75% */
	tax = 0.0775;
	num_of_order = 0;
	total = 0;

	/* print out greeing & take orders from user */
	printf ("********************************************\n");
	printf ("       Welcome to Burger World ! \n");
	printf ("********************************************\n");

	do {
		num_of_order ++;
		printf ("Order %d: $ ", num_of_order);
		scanf("%f", &order);
		total += order;
	} while ( order != 0); /* stop when user enters 0*/

	/* calculate tax and print out the total */
	total *= 1 + tax;
	printf ("\nThe Total of your %d orders, including tax is %.2f\n", num_of_order, total);
	
	/* calcuate change & print it out on screen */
	printf ("Amount tendered: $ ");
	scanf ("%f", &amount);
	change = amount - total;
	printf ("Your change is : $%.2f\n", change);
	printf ("Thank you for your purchase. We'll fire Beavis A.S.A.P. Please visit us again\n");

	return;
}
