Advertisement
mehedi2022

Practice

Sep 23rd, 2022 (edited)
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.53 KB | None | 0 0
  1.  val expenseInaDay = (("Metro", 4),
  2.   ("Pizza", 10),
  3.   ("Groceries", 20),
  4.   ("Coffee Break at work", 3),
  5.   ("New iPhone", 600)) // the task here is to define a list of expenses – so the challenge is to figure out how to represent individual expenses and then unite them in one list.
  6.   val m1 = expenseInaDay._1
  7.   val m2 = expenseInaDay._2
  8.   val m3 = expenseInaDay._3
  9.   val m4 = expenseInaDay._4
  10.   val m5 = expenseInaDay._5
  11.   println(m1) //println(s"Cost for $m1$$")
  12.   println(m2)
  13.   println(m3)
  14.   println(m4)
  15.   println (m5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement