Your friend, a film critic, heard that you study Kotlin and asked if you can design a program to fill in some movie information. He wants to have a data class called Movie with three arguments: name, link to the film page on a movie database site, and dataBaseName. The arguments link and dataBaseName have default values, but you will receive new values from standard input. Make it so that your data class can be configured using the data from standard input for different movie databases and output this class to console. Try to use scope functions.
Scope functions: apply and also
Movie databases
Report a typo
Sample Input 1:
IMDb https://www.imdb.com/title/tt0059362Sample Output 1:
Movie(name=The Knack ...and How to Get It, link=https://www.imdb.com/title/tt0059362, dataBaseName=IMDb)Write a program in Kotlin
data class Movie(
var name: String = "The Knack ...and How to Get It",
var link: String = "https://",
var dataBaseName: String = "IMDB"
)
fun main() {
val movie = Movie()
// write a code which receives new values for link and dataBaseName from standard input
// and configures your data class parameters
print(movie)
}
___
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.