Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package Chapter5Test;
- /**
- *
- * @author Teacher
- */
- public class Sandwiches
- {
- private String MainIngrd;
- private String SecIngrd;
- private String ExtLayer;
- private String Condiment1;
- private String Condiment2;
- private String Condiment3;
- private String Fixing1;
- private String Fixing2;
- private String Service;
- private String Toast;
- private String Cut;
- //private String Cond1;
- public Sandwiches()
- {
- MainIngrd = "";
- SecIngrd = "";
- ExtLayer = "";
- Condiment1 = "";
- Condiment2 = "";
- Condiment3 = "";
- Fixing1 = "";
- Fixing2 = "";
- Service = "";
- Toast = "";
- Cut = "";
- }
- public void SetMainIngredient (String MI)
- {
- MainIngrd = MI;
- }
- public void SetSecIngredient (String SI)
- {
- SecIngrd = SI;
- }
- public void SetExteriorLayer (String ext)
- {
- ExtLayer = ext;
- }
- public void SetCondiment (String cond, int number)
- {
- if(number == 1)
- {
- Condiment1 = cond;
- }
- if(number == 2)
- {
- Condiment2 = cond;
- }
- if(number == 3)
- {
- Condiment3 = cond;
- }
- }
- public void SetFixing (String fix, int number)
- {
- if(number == 1)
- {
- Fixing1 = fix;
- }
- if(number == 2)
- {
- Fixing2 = fix;
- }
- }
- public void SetService (String Serve)
- {
- Service = Serve;
- }
- public void SetToast (String toaststatus)
- {
- Toast = toaststatus;
- }
- public void SetCut (String cutresponse)
- {
- Cut = cutresponse;
- }
- @Override
- public String toString()
- {
- String str;
- str = "Main: " + MainIngrd + "\n" +
- "Second Ingredient: " + SecIngrd + "\n" +
- "Exterior Layer: " + ExtLayer + "\n" +
- "Condiments: " + Condiment1 + "\n" + Condiment2 + "\n" + Condiment3 + "\n" +
- "Fixings: " + Fixing1 + "\n" + Fixing2 + "\n" +
- "Service " + Service + "\n" +
- "Toast Status: " + Toast + "\n" +
- "Cut Status: " + Cut + "\n";
- return str;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement