This commit is contained in:
a.pivkin
2025-07-14 06:14:06 +03:00
parent f7620b40f3
commit cebbf27b3a
11 changed files with 140 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
module main.go
go 1.24.4
+26
View File
@@ -0,0 +1,26 @@
package main
import (
"fmt"
"math"
)
type Cicle struct {
radius int
}
type Rectangle struct {
lenght,width int
}
func (circle Cicle) Perim() float64 {
return float64(circle.radius) * math.Pi
}
func main() {
c := Cicle{
radius: 3,
}
fmt.Println(c.Perim())
}
+3
View File
@@ -0,0 +1,3 @@
module main.go
go 1.24.4
+27
View File
@@ -0,0 +1,27 @@
package main
import "fmt"
type Employee struct {
name string
position string
salary int
currency string
}
func (e Employee) DisplayInfo() {
fmt.Println("Name: ", e.name)
fmt.Println("Position: ",e.position)
fmt.Printf("Salary: %d %s\n",e.salary,e.currency)
}
func main(){
emp := Employee {
name: "Bob",
position: "senior",
salary: 10000,
currency: "RUB",
}
emp.DisplayInfo()
}