Scally starts a program that will maintain the duty schedule for her team. The program gets the day of the week and prints out who is on duty on this day and how many day-offs a person will get. Finish the program that Scally started.
Tuples
Duty schedule
Report a typo
Sample Input 1:
MondaySample Output 1:
On Monday Alice on duty, will get 1.0 day-offsWrite a program in Scala 3
object DutySchedule extends App {
val dutySchedule = Map(
"Monday" -> ("Alice", 1.0),
"Tuesday" ??? ("Bob", 1.0),
"Wednesday" ??? ("Scally", 1.0),
"Thursday" ??? ("Alice", 1.0),
"Friday" ??? ("Bob", 1.5),
"Saturday" ??? ("Scally" ??? 2.0),
"Sunday" ??? ("Scally" ??? 2.0)
)
val day = scala.io.StdIn.readLine()
val tuple = dutySchedule(???)
println(s"On $day ${???} on duty, will get ${???} day-offs")
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.