package main
import "fmt"
type studentType struct {
name string
score scoreType
}
type scoreType struct {
subject string
points int
}
func (s scoreType) isPassed() bool {
if s.points >= 70 {
return true
} else {
return false
}
}
func main() {
taro := studentType{
name: "Taro",
score: scoreType{
subject: "Math",
points: 85,
},
}
fmt.Println(taro.name)
fmt.Println(taro.score.subject)
fmt.Println(taro.score.points)
fmt.Println(taro.score.isPassed())
}