Skip to content

Ksenija lizko#51

Open
RinOttawa wants to merge 15 commits intoISUCT:Ksenija_Lizkofrom
RinOttawa:Ksenija_Lizko
Open

Ksenija lizko#51
RinOttawa wants to merge 15 commits intoISUCT:Ksenija_Lizkofrom
RinOttawa:Ksenija_Lizko

Conversation

@RinOttawa
Copy link
Copy Markdown

:)

@jskonst
Copy link
Copy Markdown
Collaborator

jskonst commented Nov 11, 2019

Build Failed :( Надо проверить почему сборка не проходит - проблема версия .net - надо тогда или до 2.1 снизить или в Actions - файле сборки поправить

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.802
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот тут можно на 3-. попробовать поменять

Comment thread CourseApp.Tests/UnitTest1.cs Outdated
[Fact]
public void Test1()
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тестов бы добавить

Comment thread CourseApp/Program.cs Outdated
{
public class Program
{
public static void Сalculation(double x_h, double x_k, double dx)
Copy link
Copy Markdown
Collaborator

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

@jskonst
Copy link
Copy Markdown
Collaborator

jskonst commented Nov 25, 2019

@RinOttawa

  1. Не работают тесты
  2. Не поправлены review points
  3. Build упал

@jskonst
Copy link
Copy Markdown
Collaborator

jskonst commented Nov 25, 2019

🔧

Comment thread 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);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Само вычисление следует вынести в отдельный метод

Comment thread CourseApp/Program.cs Outdated
public static void Сalculation2()
{
double y2;
double[] b = { 0.1, 0.35, 0.4, 0.55, 0.6 };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Эти параметры должны передаваться снаружи

Comment thread 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 + " ");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Используйте форматированные строки

Comment thread CourseApp/Program.cs Outdated
public static void Сalculation2()
{
double y2;
double[] b = { 0.1, 0.35, 0.4, 0.55, 0.6 };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Используйте списки вместо массивов

@RinOttawa
Copy link
Copy Markdown
Author

@jskonst добавила юнит тест к задаче на вычисления

Comment thread CourseApp/Program.cs
Comment thread CourseApp/Program.cs
{
int i = 0;
List<double> output = new List<double>();
for (double x = xH; x <= xK; x = x + dx)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x += dx

Comment thread CourseApp/Program.cs Outdated
for (double x = xH; x <= xK; x = x + dx)
{
output.Add(Mathhh(x));
Console.WriteLine(Mathhh(x));
Copy link
Copy Markdown
Collaborator

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

Comment thread CourseApp/Program.cs Outdated
{
output.Add(Mathhh(x));
Console.WriteLine(Mathhh(x));
i++;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Comment thread CourseApp/Program.cs Outdated
foreach (double i in b)
{
output.Add(Mathhh(i));
Console.WriteLine(Mathhh(i));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here for output

Comment thread 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);
Copy link
Copy Markdown
Collaborator

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 .)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants