import java.util.*;

public class CableTVBillCalculator
{
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int totalCharge = 0;

		System.out.println("--Cable Service Menu--");
		System.out.println("BAS [Basic Cable]");
		System.out.println("FAM [Family Cable]");
		System.out.println("PLA [Platinum Cable]");
		System.out.print("Enter your menu choice: ");

		String service = scan.nextLine();

		if (!service.equals("BAS") && !service.equals("FAM") && !service.equals("PLA"))
			System.out.println("Cannot compute cable bill - unknown service type.");
		else
		{
			System.out.print("Do you have a DVR Box? (YES/NO) ");
			String boxAnswer = scan.nextLine();
			boolean hasBox;
			if (boxAnswer.equals("YES"))
				hasBox = true;
			else if (boxAnswer.equals("NO"))
				hasBox = false;
			else {
				System.out.println("WARNING: Using an answer of NO.");
				hasBox = false;
			}

			if (service.equals("BAS"))
				totalCharge = computeBasic(hasBox);
			else 
			{
				System.out.print("Enter the number of premium channels received: ");
				int channels = scan.nextInt();
				if (service.equals("FAM"))
				{
					totalCharge = computeFamily(channels, hasBox);
				}
				else
				{
					System.out.print("Enter the number of pay-per-view movies purchased: ");
					int ppvMovies = scan.nextInt();
					totalCharge = computePlatinum(channels, ppvMovies, hasBox);
				}
			}
			int dollars = totalCharge / 100;
			int remainingCents = totalCharge % 100;
			System.out.print("Your cable bill is $");
			System.out.print(dollars + ".");
			if (remainingCents < 10)
				System.out.print("0");
			System.out.println(remainingCents);
		}

	}

	public static int computeBasic(boolean hasDVRBox)
	// returns the cable bill in cents for a Basic Cable customer 
	// given whether the customer has a DVR box or not
 	{
		int total = 3500;
		if (hasDVRBox)
			total += 350;
		return total;
	}

	public static int computeFamily(int premiumChannels, boolean hasDVRBox)
	// returns the cable bill in cents for a Family Cable customer 
	// given the number of premium channels purchased as given  
	// and whether the customer has a DVR box or not
	{
		int total = 5000;
		if (hasDVRBox)
			total += 500;
		total += (799*premiumChannels);
		return total;
	}

	public static int computePlatinum(int premiumChannels, int numMovies, boolean hasDVRBox)
	// returns the cable bill in cents for an Platinum Cable customer 
	// given the number of premium channels purchased, the number 
	// of pay-per-view movies viewed and whether the customer has a 
	// DVR box or not
	{
		int total = 7250;
		if (hasDVRBox)
			total += 725;
		total += 549*premiumChannels;
		if (numMovies <= 4)
			total += (499*numMovies);
		else
			total += (499*4 + 249*(numMovies-4));
		return total;
	}

}
