Академический Документы
Профессиональный Документы
Культура Документы
import TerminalIO.KeyboardReader;
import java.text.DecimalFormat;
class clarkFinalExam { // this is the name of the program
public static void main(String args[]){ // this line wiill be in every main program
KeyboardReader reader = new KeyboardReader(); // making a copy of the code
KeyboardReader(someone elses code), in your program called reader
DecimalFormat twoDecimal = new DecimalFormat("0.00");
String food1, food2; //String to identify words or sentences
double cal=0, carb=0, pro=0, fat=0, cal2=0, carb2=0, pro2=0, fat2=0, finalcal=0, finalfat=0,
finalcarb=0, finalpro=0; //calories, protein, carbs, and fat
System.out.println ("Good evening!");
System.out.println ("These are the items you're able to order- Quarter Pound + Cheese,
Fish Burger, Bacon Double + Cheese, Big Breakfast, Large Fries, Hash Brown (1), and
Milkshake.");
System.out.println ("Enter your first item as spelled above"); //for the string to detect the
correct term, it has to be spelled as above
food1 = reader.readLine(); //reader.readLine so the reader can input something with the
keyboard
System.out.println ("Enter your second item");
food2 = reader.readLine();
if(food1.equals("Quarter Pound + Cheese")) cal=500;
fat=26; carb=38;
pro=17;
fat=24; carb=34;
fat=36; carb=40;
pro=30;
pro=28;
pro=26;
carb=16; pro=1.5;