Built URL

Report a typo

Patrick has created a Go program that takes as input multiple parts of a basic URL — protocol, domain, and path:

Parts of a basic URL
Parts of a basic URL

Your task is to help Patrick write the additional required code to declare a new variable completeURL and concatenate the input parts to form a complete URL string.

Note that the complete URL format should be as follows: protocol://domain/path

Sample Input 1:

https hyperskill.org study-plan

Sample Output 1:

https://hyperskill.org/study-plan
Write a program in Go
package main

import "fmt"

func main() {
// DO NOT modify the code block below!
var protocol, domain, path string
fmt.Scanln(&protocol, &domain, &path)

// Concatenate the 'protocol', 'domain', and 'path' variables into the 'completeURL' variable below:
// Use the format: protocol://domain/path
completeURL := ? + "://" + ? + "/" + ?

fmt.Println(completeURL) // DO NOT delete, this prints the completeURL!
}
___

Create a free account to access the full topic