Advertisement
Guest User

sandwiches file

a guest
Dec 14th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.53 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package Chapter5Test;
  7.  
  8. /**
  9.  *
  10.  * @author Teacher
  11.  */
  12. public class Sandwiches
  13. {
  14.     private String MainIngrd;
  15.     private String SecIngrd;
  16.     private String ExtLayer;
  17.     private String Condiment1;
  18.     private String Condiment2;
  19.     private String Condiment3;
  20.     private String Fixing1;
  21.     private String Fixing2;
  22.     private String Service;
  23.     private String Toast;
  24.     private String Cut;
  25.    
  26.     //private String Cond1;
  27.    
  28.     public Sandwiches()
  29.     {
  30.         MainIngrd = "";
  31.         SecIngrd = "";
  32.         ExtLayer = "";
  33.         Condiment1 = "";
  34.         Condiment2 = "";
  35.         Condiment3 = "";
  36.         Fixing1 = "";
  37.         Fixing2 = "";
  38.         Service = "";
  39.         Toast = "";
  40.         Cut = "";
  41.     }
  42.     public void SetMainIngredient (String MI)
  43.     {
  44.         MainIngrd = MI;
  45.     }
  46.     public void SetSecIngredient (String SI)
  47.     {
  48.         SecIngrd = SI;
  49.     }
  50.     public void SetExteriorLayer (String ext)
  51.     {
  52.         ExtLayer = ext;
  53.     }
  54.     public void SetCondiment (String cond, int number)
  55.     {
  56.         if(number == 1)
  57.         {
  58.             Condiment1 = cond;
  59.         }
  60.         if(number == 2)
  61.         {
  62.             Condiment2 = cond;
  63.         }
  64.         if(number == 3)
  65.         {
  66.             Condiment3 = cond;
  67.         }
  68.                    
  69.                
  70.     }
  71.     public void SetFixing (String fix, int number)
  72.     {
  73.         if(number == 1)
  74.         {
  75.             Fixing1 = fix;
  76.         }
  77.         if(number == 2)
  78.         {
  79.             Fixing2 = fix;
  80.         }
  81.     }
  82.     public void SetService (String Serve)
  83.     {
  84.        Service = Serve;
  85.     }
  86.    
  87.     public void SetToast (String toaststatus)
  88.     {
  89.        Toast = toaststatus;
  90.     }
  91.     public void SetCut (String cutresponse)
  92.     {
  93.        Cut = cutresponse;
  94.     }
  95.    
  96.     @Override
  97.     public String toString()
  98.     {
  99.         String str;
  100.         str = "Main:      " + MainIngrd + "\n" +
  101.               "Second Ingredient: " + SecIngrd + "\n" +
  102.               "Exterior Layer: " + ExtLayer + "\n" +
  103.               "Condiments: " + Condiment1 + "\n" + Condiment2 + "\n" + Condiment3 + "\n" +
  104.               "Fixings: " + Fixing1 + "\n" + Fixing2 + "\n" +
  105.               "Service " + Service + "\n" +
  106.               "Toast Status: " + Toast + "\n" +
  107.               "Cut Status: " + Cut + "\n";
  108.         return str;
  109.     }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement