import uk.co.jscieng.*;		

public class calorie extends SciGraph

{
	public static void main(String[] argv)

	{

			

		String basketball, tennis, bike94, bike55, walk, football, rollerblade;
		String basketballtime, tennistime, bike94time, bike55time, walktime;
		String footballtime, rollerbladetime;
		double total, b, t, b94, b55, w, f, rb;
		double bt, tt, b94t, b55t, wt, ft, rbt;
		
		String bigmac, cheeseburger, quaterpounder,cocacola, snickers, icecream, chips, cookies; 
		String bigmacsize, cheeseburgersize, quarterpoundersize, cocacolasize;
		String snickerssize, icecreamsize, chipssize, cookiessize;
		double bm, cb, qp, cc, snick, ic, ch, cok;
		double bmsize, cbsize, qpsize, ccsize, snicksize, icsize, chsize, coksize;
		
		double caloriegain, calorieloss, poundgain, poundloss;
		
		SciGraph.showText();
		
		{
	
               	total = 2000;
		
		SciGraph.println();
		SciGraph.println("Note: This mini-survey has been created by"
		+ " by Samantha Silva and copyrighted \n 2003. It is"
		+ " not intended to substitute any medical or dietary "
		+ "advise. Please \n consult a doctor before "
		+ "beginning any strenuous activity."

		+ "\n \n This survey is a simulation of a typical "
		+ "day's activities. It is based on the \n metabolism "
		+ "of an average 150lb (65kg) person with a daily " 
		+ "calorie intake of \n 2000 calories."

		+ "\n \n For this survey to function correctly please "
		+ "read and follow the instructions \n carefully: "
		+ "Read the question. Type \'1\' if the answer is yes "
		+ "type \'2\' if the \n answer is no "
		+ "\n \n do you practice competitive basketball?");


		basketball = SciGraph.readln();
		b = Double.parseDouble(basketball);

			if (b == 1)
				{
				SciGraph.println();
				SciGraph.println("how long did you practice this "
				+ "activity in terms of hours ex. .5, 1.5, 2");	
				basketballtime = SciGraph.readln();
				bt = Double.parseDouble(basketballtime);
				total = total - (545*bt);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}

			





		SciGraph.println();
		SciGraph.println("do you play tennis?");	
		tennis = SciGraph.readln();
		t = Double.parseDouble(tennis);

			if (t == 1)
				{
				SciGraph.println();
				SciGraph.println("how long did you practice this "
				+ "activity in terms of hours ex. .5, 1.5, 2");	
				tennistime = SciGraph.readln();
				tt = Double.parseDouble(tennistime);
				total = total - (460*tt);
				System.out.println(total);
				
				}
			else	
				{
				System.out.println("");
				}

		



		SciGraph.println();
		SciGraph.println("do you ride a bike at 9.4mph?");	
		bike94 = SciGraph.readln();
		b94 = Double.parseDouble(bike94);

			if (b94 == 1)
				{
				SciGraph.println();
				SciGraph.println("how long did you practice this "
				+ "activity in terms of hours ex. .5, 1.5, 2");	
				bike94time = SciGraph.readln();
				b94t = Double.parseDouble(bike94time);
				total = total - (420*b94t);
				System.out.println(total);
	
				}
			else	
				{
				System.out.println("");
				}

	

		

		SciGraph.println();
		SciGraph.println("do you ride a bike at 5.5mph?");	
		bike55 = SciGraph.readln();
		b55 = Double.parseDouble(bike55);

			if (b55 == 1)
				{
				SciGraph.println();
				SciGraph.println("how long did you practice this "
				+ "activity in terms of hours ex. .5, 1.5, 2");	
				bike55time = SciGraph.readln();
				b55t = Double.parseDouble(bike55time);
				total = total - (270*b55t);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}



		SciGraph.println();
		SciGraph.println("do you walk (walk dog or for fun)?");	
		walk = SciGraph.readln();
		w = Double.parseDouble(walk);

			if (w == 1)
				{
				SciGraph.println();
				SciGraph.println("how long did you practice this "
				+ "activity in terms of hours ex. .5, 1.5, 2");	
				walktime = SciGraph.readln();
				wt = Double.parseDouble(walktime);
				total = total - (239*wt);
				System.out.println(total);

				}
			else	
				{
				System.out.println("");
				}



		SciGraph.println();
		SciGraph.println("do you play competitive football?");	
		football = SciGraph.readln();
		f = Double.parseDouble(football);

			if (f == 1)
				{
				SciGraph.println();
				SciGraph.println("how long did you practice this "
				+ "activity in terms of hours ex. .5, 1.5, 2");	
				footballtime = SciGraph.readln();
				ft = Double.parseDouble(footballtime);
				total = total - (614*ft);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}



		SciGraph.println();
		SciGraph.println("do you rollerblade?");	
		rollerblade = SciGraph.readln();
		rb = Double.parseDouble(rollerblade);

			if (rb == 1)
				{
				SciGraph.println();
				SciGraph.println("how long did you practice this "
				+ "activity in terms of hours ex. .5, 1.5, 2");	
				rollerbladetime = SciGraph.readln();
				rbt = Double.parseDouble(rollerbladetime);
				total = total - (477*rbt);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}
		

		SciGraph.println();
		SciGraph.println("Follow the same procedure as before"
			+ "Have you eaten/drank the selected food/drinks \n during the day?"
			+ "\n \n McDonald's Big Mac?");	
		bigmac = SciGraph.readln();
		bm = Double.parseDouble(bigmac);

			if (bm == 1)
				{
				SciGraph.println();
				SciGraph.println("how much of this did you eat? "
				+ "in terms of serving size ex. .5, 1.5, 2");	
				bigmacsize = SciGraph.readln();
				bmsize = Double.parseDouble(bigmacsize);
				total = total + (590*bmsize);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}

		SciGraph.println();
		SciGraph.println("McDonald's cheeseburger?");	
		cheeseburger = SciGraph.readln();
		cb = Double.parseDouble(cheeseburger);

			if (cb == 1)
				{
				SciGraph.println();
				SciGraph.println("how much of this did you eat? "
				+ "in terms of serving size ex. .5, 1.5, 2");	
				cheeseburgersize = SciGraph.readln();
				cbsize = Double.parseDouble(cheeseburgersize);
				total = total + (330*cbsize);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}		

		SciGraph.println();
		SciGraph.println("regular size Snickers bar?");	
		snickers = SciGraph.readln();
		snick = Double.parseDouble(snickers);

			if (snick == 1)
				{
				SciGraph.println();
				SciGraph.println("how much of this did you eat? "
				+ "in terms of serving size ex. .5, 1.5, 2");	
				snickerssize = SciGraph.readln();
				snicksize = Double.parseDouble(snickerssize);
				total = total + (280*snicksize);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}

		SciGraph.println();
		SciGraph.println("one cup of ice cream?");	
		icecream = SciGraph.readln();
		ic = Double.parseDouble(icecream);

			if (ic == 1)
				{
				SciGraph.println();
				SciGraph.println("how much of this did you eat? "
				+ "in terms of serving size ex. .5, 1.5, 2");	
				icecreamsize = SciGraph.readln();
				icsize = Double.parseDouble(icecreamsize);
				total = total + (340*icsize);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}		
		
		SciGraph.println();
		SciGraph.println("one small bag of chips?");	
		chips = SciGraph.readln();
		ch = Double.parseDouble(chips);

			if (ch == 1)
				{
				SciGraph.println();
				SciGraph.println("how much of this did you eat? "
				+ "in terms of serving size ex. .5, 1.5, 2");	
				chipssize = SciGraph.readln();
				chsize = Double.parseDouble(chipssize);
				total = total + (150*chsize);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}	

		SciGraph.println();
		SciGraph.println("three chocolate cookies?");	
		cookies = SciGraph.readln();
		cok = Double.parseDouble(cookies);

			if (cok == 1)
				{
				SciGraph.println();
				SciGraph.println("how much of this did you eat? "
				+ "in terms of serving size ex. .5, 1.5, 2");	
				cookiessize = SciGraph.readln();
				coksize = Double.parseDouble(cookiessize);
				total = total + (160*coksize);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}

		SciGraph.println();
		SciGraph.println("coca-cola or sprite 12oz.?");	
		cocacola = SciGraph.readln();
		cc = Double.parseDouble(cocacola);

			if (cc == 1)
				{
				SciGraph.println();
				SciGraph.println("how much of this did you drink? "
				+ "in terms of serving size ex. .5, 1.5, 2");	
				cocacolasize = SciGraph.readln();
				ccsize = Double.parseDouble(cocacolasize);
				total = total + (210*ccsize);
				System.out.println(total);
				}
			else	
				{
				System.out.println("");
				}


		SciGraph.println();
		SciGraph.println("total calories for the day = " + total);

			if (total > 2000)
				{
				caloriegain = total - 2000;
				poundgain = caloriegain/2000;
				SciGraph.println();
				SciGraph.println("you have gained " + caloriegain 
					+ " calories, which is " + poundgain + " pounds");	
				}
			else	
				{
				calorieloss = 2000 - total;
				poundloss = calorieloss/2000;
				SciGraph.println();
				SciGraph.println("you have lost " + calorieloss 
					+ " calories, which is " + poundloss + " pounds");
				}


		SciGraph.println();
		SciGraph.println("\n \n ~~THANK YOU FOR TAKING THIS MINI-SURVEY~~");

		}		

		 	


	}

public void main()
	{
		main(new String[1]);
	}
	

} 	
	