Complete the code to declare a function with one integer parameter named x.
func printNumber([1] int) {
fmt.Println(x)
}The parameter name must be x to match the usage inside the function.
Complete the code to declare a function that takes two string parameters: first and last.
func fullName([1] string, last string) string { return first + " " + last }
The first parameter must be named first to match the return statement.
Fix the error in the function parameter declaration to accept a float64 parameter named price.
func calculateTax([1] float64) float64 { return price * 0.1 }
The parameter name must be price to match its usage inside the function.
Fill both blanks to declare a function that takes an int parameter age and a string parameter name.
func greet([1] int, [2] string) string { return fmt.Sprintf("Hello %s, you are %d years old", name, age) }
The parameters must be named age and name to match their usage in the Sprintf call.
Fill all three blanks to declare a function that takes a string parameter title, an int parameter pages, and a float64 parameter price.
func bookInfo([1] string, [2] int, [3] float64) string { return fmt.Sprintf("%s has %d pages and costs $%.2f", title, pages, price) }
The parameter names must be title, pages, and price to match their usage in the Sprintf call.