public class Runner
{
public static void main(String[] args){
chocolateChip Yum = new chocolateChip();
Sugar cd = new Sugar();
gingerSnap ce = new gingerSnap();
snickerDoodle cf = new snickerDoodle();
Yum.print();
cd.print();
ce.print();
cf.print();
}
}
public class chocolateChip implements Cookies
{
public void Dough(){
System.out.println("Gooey and Chocolatey");
}
public int powderedSugar(){
return 2;
}
public double Flour(){
return 1.5;
}
public int Calories(){
return 350;
}
public void print(){
System.out.println("Chocolate Chip List Interface");
Dough();
System.out.println("Cups of Powdered Sugar: " + powderedSugar() );
System.out.println("Cups of Flour: "+ Flour());
System.out.println("Calories: "+Calories());
}
public class gingerSnap implements Cookies
{
public void Dough(){
System.out.println("Crisp and Sharp Tasting");
}
public int powderedSugar(){
return 1;
}
public double Flour(){
return 3;
}
public int Calories(){
return 200;
}
public void print(){
System.out.println("Gingersnap List Interface");
Dough();
System.out.println("Cups of Powdered Sugar: " + powderedSugar() );
System.out.println("Cups of Flour: "+ Flour());
System.out.println("Calories: "+Calories());
System.out.println(" ");
}
}
public class snickerDoodle implements Cookies
{
public void Dough(){
System.out.println("Lumpy and Herby");
}
public int powderedSugar(){
return 4;
}
public double Flour(){
return 3;
}
public int Calories(){
return 450;
}
public void print(){
System.out.println("SnickerDoodle Interface List");
Dough();
System.out.println("Cups of Powdered Sugar: " + powderedSugar() );
System.out.println("Cups of Flour: "+ Flour());
System.out.println("Calories: "+Calories());
System.out.println(" ");
}
}
public class Sugar implements Cookies
{
public void Dough(){
System.out.println("Soft and Chewy");
}
public int powderedSugar(){
return 2;
}
public double Flour(){
return 5.0;
}
public int Calories(){
return 435;
}
public void print(){
System.out.println("Sugar Interface List");
Dough();
System.out.println("Cups of Powdered Sugar: " + powderedSugar() );
System.out.println("Cups of Flour: "+ Flour());
System.out.println("Calories: "+Calories());
System.out.println(" ");
}
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.