-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpractice-profile-class.go
54 lines (39 loc) · 978 Bytes
/
practice-profile-class.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import "fmt"
type Profile struct {
FirstName string
LastName string
Gender string
DateOfBirth int
MonthOfBirth int
YearOfBirth int
CountryOfOrigin string
}
func main() {
var first, last, gender, country string
var date, month, year int
fmt.Println("Enter your first name:")
fmt.Scanln(&first)
fmt.Println("Enter your last name:")
fmt.Scanln(&last)
fmt.Println("Enter your gender:")
fmt.Scanln(&gender)
fmt.Println("Enter your date of birth:")
fmt.Scanln(&date)
fmt.Println("Enter the month you were born using number format. Example, 1 for january:")
fmt.Scanln(&month)
fmt.Println("Enter the year you were born:")
fmt.Scanln(&year)
fmt.Println("Enter your country of origin:")
fmt.Scanln(&country)
person := Profile{
FirstName: first,
LastName: last,
Gender: gender,
DateOfBirth: date,
MonthOfBirth: month,
YearOfBirth: year,
CountryOfOrigin: country,
}
fmt.Println(person.FirstName, "is a", person.Gender)
}