   import java.util.*;
   import java.io.*;

/**
@author        Kevin Bojarski
@version       1.0   9/16/2008

this is the driver that calculates taxs on
non food items, prepared food items
and nonprepared food items
*/

    public class TaxOnomy{
      static Scanner keyboard = new Scanner(System.in);
      PrintStream tape;
      static double food = 0;
      static double prepared = 0;
      static double other = 0;
   //main class prompts use for number of items
   //then prompts the category of each item and then its price
       public static void main(String[] agrs)
      {
         int numberOfItems;
      	
      
         System.out.printf("Enter the number of items: ");
         numberOfItems = keyboard.nextInt();
      System.out.println("Number of Items:" + numberOfItems);
         double[] prices = new double[numberOfItems];
         int[] category = new int[numberOfItems];
      
      //user input for number of items         
         for (int i = 0; i < numberOfItems; i++)
         {
            category[i] = requestCategory();
            prices[i] = requestDouble();
         }//end for
      
         food = TaxCalculator.foodTax(prices, category);
         prepared = TaxCalculator.preparedfoodTax(prices, category);
         other = TaxCalculator.nonfoodTax(prices, category);
      
      //prints the summary of the taxes calculated
         System.out.printf("Summary\n");
         System.out.printf("Food:%8.4f\n", food);
         System.out.printf("Prepared:%8.4f\n", prepared);
         System.out.printf("Other:%8.4f\n", other);
			System.out.println("This program has ended normally");
      
      }
   
   
   /**
   prompts the use for the type of item purchased
   
   @return  int that corresponds to the type of item
   */
       public static int requestCategory()
      {
         int category = 0;
      
         System.out.printf("Enter 0 for non-food, 1 for food, or 2 for prepared: ");
         category = keyboard.nextInt();
			System.out.println("Item category: " +category);
      
      
         return category;
      }//end requestCategory()
   
   /**
   prompts the use for the price of item purchased
   
   @return  double that corresponds to the price of the item
   */   
       public static double requestDouble()
      {
         double price = 0;
      
         System.out.printf("Enter the price: ");
         price = keyboard.nextDouble();
			System.out.println("Item price: " +price);
      
      
         return price;
      }//end requestCategory()
   
   
   
   }//end class