Write a Kotlin program that reads an integer n from the standard input using the Scanner class. The program should add five to the read number and then multiply it by 2. Print the final result in the standard output.
Standard input with Java Scanner
Adding five to a number, then doubling it
Report a typo
Sample Input 1:
5Sample Output 1:
20Sample Input 2:
7Sample Output 2:
24Write a program in Kotlin
import java.util.Scanner
fun main(args: Array<String>) {
// TODO: Use the nextInt() method of the Scanner class to read an integer from the standard input.
// Then, add five to the read number and multiply the result by two.
// Finally, print the result of the multiplication to the standard output.
}'
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.