Movie recommendations

Report a typo

Keanu wants to create a Go program that recommends one of his movies to the user, based on their age:

  • Age <= 14 | "Toy Story 4"
  • Age 15 - 18 | "The Matrix"
  • Age 19 - 25 | "John Wick"
  • Age 26 - 35 | "Constantine"
  • Age > 35 | "Speed"

Help him write the code by using either a switch or if...else-if statement to evaluate the user's age and recommend them a movie.

Sample Input 1:

13

Sample Output 1:

Toy Story 4
Write a program in Go
package main

import "fmt"

func main() {
var age int
fmt.Scanf("%d", &age)

// Code your switch or if...else-if statement here.
}
___

Create a free account to access the full topic