-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lab4,6 #603
Open
information278
wants to merge
9
commits into
ISUCT:Gretchenko_Vladislav
Choose a base branch
from
information278:lab4,6
base: Gretchenko_Vladislav
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Lab4,6 #603
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
83a2e2a
выполнена 4 лаба
information278 a4e9345
сделал 4 лабу
information278 93117e5
Merge branch 'Gretchenko_Vladislav' into 4lab
information278 678704a
исправил lab4
information278 1ffa120
Merge branch '3lab' of https://github.com/information278/Informatics_…
information278 b293465
внесены правки
information278 97f4c07
внесены правки
information278 98808e1
внесены правки
information278 8d55245
внесены изменения по коментариям, выполнена 6 лаба
information278 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package lab4 | ||
|
||
import ( | ||
"fmt" | ||
"math" | ||
) | ||
|
||
func Calculate(x float64) float64 { | ||
if math.Abs(x) >= 1 { | ||
return (math.Pow(1.2, x)) - (math.Pow(x, 1.2)) | ||
} | ||
return math.Acos(x) | ||
} | ||
|
||
func TaskA(Xmin, Xmax, Xdel float64) []float64 { | ||
var y []float64 | ||
for x := Xmin; x <= Xmax; x += Xdel { | ||
y = append(y, Calculate(x)) | ||
} | ||
return y | ||
} | ||
|
||
func TaskB(x [5]float64) []float64 { | ||
var y []float64 | ||
for _, value := range x { | ||
y = append(y, Calculate(value)) | ||
} | ||
return y | ||
} | ||
|
||
func Runlab4() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CamelCase соблюдайте во всем проекте |
||
fmt.Println(TaskA(0.2, 2.2, 0.4)) | ||
fmt.Println(TaskB([5]float64{0.1, 0.9, 1.2, 1.5, 1.3})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package lab6 | ||
|
||
import "fmt" | ||
|
||
type Phone struct { | ||
Name string | ||
Op string | ||
Number string | ||
} | ||
|
||
func NewPhone(name, op, number string) *Phone { | ||
p := new(Phone) | ||
p.Name = name | ||
p.Op = op | ||
p.Number = number | ||
return p | ||
} | ||
|
||
func (p *Phone) SetNumber(number string) { p.Number = number } | ||
func (p Phone) GetNumber() string { return p.Number } | ||
func (p Phone) GetOp() string { return p.Op } | ||
func (p Phone) GetName() string { return p.Name } | ||
|
||
func Runlab6() { | ||
phone := NewPhone("Влад", "Билайн", "89621658549") | ||
phone.SetNumber("89012863969") | ||
fmt.Println("Имя владельца:", phone.GetName()) | ||
fmt.Println("Оператор сотовой связи:", phone.GetOp()) | ||
fmt.Println("Номер телефона пользователя:", phone.GetNumber()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
package main | ||
|
||
import "fmt" | ||
import ( | ||
"fmt" | ||
|
||
lab4 "isuct.ru/informatics2022/lab4" | ||
lab6 "isuct.ru/informatics2022/lab6" | ||
) | ||
|
||
func main() { | ||
fmt.Println("Гретченко Владислав") | ||
fmt.Println("Гретченко Владислав Игоревич") | ||
lab4.Runlab4() | ||
lab6.Runlab6() | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нет смысла делать их публичными, вы используете их только внутри пакета