Write a program that will ask the user to give its age and then the program will check and determine if the given age of the user is already an adult or still a minor using structures using Golang.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.
My personal website is http://www.jakerpomperada.com
Sample Program Output
Program Listing
/* legal_age__structures.go
Author : Mr. Jake Rodriguez Pomperada,MAED-IT
Date : August 6, 2019 Tuesday 4:23 PM
Location : Bacolod City, Negros Occidental
Website : http://www.jakerpomperada.com
Emails : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
*/
package main
import "fmt"
type check_age struct {
age int
}
func main() {
var legal check_age
fmt.Print("\n")
fmt.Print("\tLegal Age Checker Using Structures")
fmt.Print("\n\n")
fmt.Print("\tWhat is your Age? ")
fmt.Scanln(&legal.age)
if legal.age >= 18 {
fmt.Print("\n")
fmt.Print("\tAt the age of ")
fmt.Printf("%d ",legal.age)
fmt.Print(" years old. You are already an Adult.")
} else {
fmt.Print("\n")
fmt.Print("\tAt the age of ")
fmt.Printf("%d ",legal.age)
fmt.Print(" years old. You are still a Minor.")
}
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}
No comments:
Post a Comment