Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // cooking recipe for beef steak
- println("Beef steak recipe :")
- println("Wash and soak the beef.")
- println("Add salt and peeper.")
- println("Place the beef in oven, set temperature and time.")
- println("Take out from oven & serve")
- //cooking recipe for beef steak (Method way)
- def favRecipe =
- println("Beef steak recipe :")
- println("Wash and soak the beef.")
- println("Add salt and peeper.")
- println("Place the beef in oven, set temperature and time.")
- println("Take out from oven & serve")
- favRecipe
- // cooking recipe for beef steak (Method & parameter)
- def favRecipe (temp: Int, time:Int, s: String, s2: String, s3:String, s4:String) =
- {
- var temp= 350 // for Rare/medium Rare/well cooked steak it may change that's why its var
- var time= 6.0 //for Rare/medium Rare/well cooked steak it may change that's why its var
- var s1= "Beef steak (well cooked) recipe :"
- val s2= "Wash and soak the beef."
- val s3= "Add salt and pepper."
- val s4= "Place the beef in oven, set at "
- val s5= "Take out from oven & serve."
- val result = (s1 + s2 + s3 + s4 + s" $temp deg F and $time mins." + s5)
- println(result)
- temp= 400
- time= 4.0
- s1= "Beef steak (Medium Rare) recipe :"
- val(result2) = (s1 + s2 + s3 + s4 + s" $temp deg F and $time mins." + s5)
- println(result2)
- time= 2.5
- s1= "Beef steak (Rare Cooked) recipe :"
- val(result3) = (s1 + s2 + s3 + s4 + s" $temp deg F and $time mins." + s5)
- println(result3)
- }
- favRecipe
- // cooking recipe for beef steak
- def favRecipe:Unit = (args: Array[String])
- {
- var temp= 350 // for Rare/medium Rare/well cooked steak it may change that's why its var
- var time= 6.0 //for Rare/medium Rare/well cooked steak it may change that's why its var
- var s1= "Beef steak (well cooked) recipe : "
- val s2= " Wash and soak the beef."
- val s3= " Add salt and pepper."
- val s4= " Place the beef in oven, set at "
- val s5= " Take out from oven & serve."
- val result = (s1 + s2 + s3 + s4 + s" $temp deg F and $time mins." + s5)
- println(result)
- temp= 400
- time= 4.0
- s1= "Beef steak (Medium Rare) recipe : "
- val(result2) = (s1 + s2 + s3 + s4 + s" $temp deg F and $time mins." + s5)
- println(result2)
- time= 2.5
- s1= "Beef steak (Rare Cooked) recipe : "
- val(result3) = (s1 + s2 + s3 + s4 + s" $temp deg F and $time mins." + s5)
- println(result3)
- }
- favRecipe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement