-
Notifications
You must be signed in to change notification settings - Fork 17
Ksenija lizko #51
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
base: Ksenija_Lizko
Are you sure you want to change the base?
Ksenija lizko #51
Conversation
RinOttawa
commented
Nov 2, 2019
|
Build Failed :( Надо проверить почему сборка не проходит - проблема версия .net - надо тогда или до 2.1 снизить или в Actions - файле сборки поправить |
| - name: Setup .NET Core | ||
| uses: actions/setup-dotnet@v1 | ||
| with: | ||
| dotnet-version: 2.1.802 |
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.
Вот тут можно на 3-. попробовать поменять
CourseApp.Tests/UnitTest1.cs
Outdated
| [Fact] | ||
| public void Test1() | ||
| { | ||
|
|
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.
Тестов бы добавить
CourseApp/Program.cs
Outdated
| { | ||
| public class Program | ||
| { | ||
| public static void Сalculation(double x_h, double x_k, double dx) |
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.
переименуйте x_n -> xN (остальные переменные тоже проверьте) - в c# не принят snake_case (как в питоне), а принят camelCase
|
|
🔧 |
CourseApp/Program.cs
Outdated
| double[] b = { 0.1, 0.35, 0.4, 0.55, 0.6 }; | ||
| for (int i = 0; i < 5; i++) | ||
| { | ||
| y2 = Math.Pow(Math.Pow(Math.Asin(b[i]), 2) + Math.Pow(Math.Cos(b[i]), 4), 3); |
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.
Само вычисление следует вынести в отдельный метод
CourseApp/Program.cs
Outdated
| public static void Сalculation2() | ||
| { | ||
| double y2; | ||
| double[] b = { 0.1, 0.35, 0.4, 0.55, 0.6 }; |
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.
Эти параметры должны передаваться снаружи
CourseApp/Program.cs
Outdated
| for (double x = xH; x <= xK; x = x + dx) | ||
| { | ||
| y = Math.Pow(Math.Pow(Math.Asin(x), 2) + Math.Pow(Math.Cos(x), 4), 3); | ||
| Console.WriteLine(y + " "); |
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.
Используйте форматированные строки
CourseApp/Program.cs
Outdated
| public static void Сalculation2() | ||
| { | ||
| double y2; | ||
| double[] b = { 0.1, 0.35, 0.4, 0.55, 0.6 }; |
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.
Используйте списки вместо массивов
34a600c to
d603784
Compare
b327fd7 to
d603784
Compare
|
@jskonst добавила юнит тест к задаче на вычисления |
| { | ||
| int i = 0; | ||
| List<double> output = new List<double>(); | ||
| for (double x = xH; x <= xK; x = x + dx) |
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.
x += dx
CourseApp/Program.cs
Outdated
| for (double x = xH; x <= xK; x = x + dx) | ||
| { | ||
| output.Add(Mathhh(x)); | ||
| Console.WriteLine(Mathhh(x)); |
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.
this function should not write into console
CourseApp/Program.cs
Outdated
| { | ||
| output.Add(Mathhh(x)); | ||
| Console.WriteLine(Mathhh(x)); | ||
| i++; |
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.
why?
CourseApp/Program.cs
Outdated
| foreach (double i in b) | ||
| { | ||
| output.Add(Mathhh(i)); | ||
| Console.WriteLine(Mathhh(i)); |
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.
same here for output
CourseApp.Tests/DemoTest.cs
Outdated
| List<double> input = new List<double>() { 0.1, 0.35, 0.4, 0.55, 0.6 }; | ||
| var res = Program.Сalculation2(input); | ||
| List<double> result = new List<double>() { 0.970885488727385, 0.744968715506544, 0.702712806929317, 0.65257962383342, 0.677063603240845 }; | ||
| Assert.Equal(res, result); |
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.
equale for double should have accuracy (3 digits after .)
