Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 206 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
# Download this file using PowerShell v3 under Windows with the following comand:
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
# or wget:
# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# OS generated files #
.DS_Store*
Icon?

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
*.Cache
ClientBin/
# [Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
modulesbin/
tempbin/

# EPiServer Site file (VPP)
AppData/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# vim
*.txt~
*.swp
*.swo

# svn
.svn

# Remainings from resolvings conflicts in Source Control
*.orig

# SQL Server files
**/App_Data/*.mdf
**/App_Data/*.ldf
**/App_Data/*.sdf


#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml

# =========================
# Windows detritus
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac desktop service store files
.DS_Store

# SASS Compiler cache
.sass-cache

# Visual Studio 2014 CTP
**/*.sln.ide

# Visual Studio temp something
.vs/

# VS 2015+
*.vc.vc.opendb
*.vc.db

# Rider
.idea/

**/node_modules/*

# Added by Jskonst
.vscode/
Properties/

#####
# End of core ignore list, below put you custom 'per project' settings (patterns or path)
#####
30 changes: 30 additions & 0 deletions CourseApp.Tests/CourseApp.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<NoWarn>1573,1591,1701;1702;1705</NoWarn>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CourseApp\CourseApp.csproj" />
</ItemGroup>

<PropertyGroup>
<CodeAnalysisRuleSet>../_stylecop/stylecop.ruleset</CodeAnalysisRuleSet>
<GenerateFullPaths>true</GenerateFullPaths>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="../_stylecop/stylecop.json" />
</ItemGroup>

</Project>
28 changes: 28 additions & 0 deletions CourseApp.Tests/DemoTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using Xunit;

namespace CourseApp.Tests
{
public class DemoTest
{
[Fact]
public void Test1()
{
Assert.True(true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Тесты обновить!

}

[Fact]
public void TestSummPositive()
{
var res = Program.Summ(2, 3);
Assert.Equal(5, res);
}

[Fact]
public void TestSummPositiveNegative()
{
var actualRes = Program.Summ(-2, 2);
Assert.Equal(0, actualRes);
}
}
}
23 changes: 23 additions & 0 deletions CourseApp/CourseApp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<NoWarn>1573,1591,1701;1702;1705;</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="all" />
</ItemGroup>

<PropertyGroup>
<CodeAnalysisRuleSet>../_stylecop/stylecop.ruleset</CodeAnalysisRuleSet>
<GenerateFullPaths>true</GenerateFullPaths>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="../_stylecop/stylecop.json" />
</ItemGroup>

</Project>
62 changes: 62 additions & 0 deletions CourseApp/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CourseApp
{
public class Program
{
public static double FuncthionZnach(double x)
{
double a = 1.2;
Copy link
Collaborator

Choose a reason for hiding this comment

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

a b - должны передаваться в качестве параметров функции

double b = 0.28;
double result = (Math.Pow(b, 3) + Math.Pow(Math.Sin(a * x), 2)) / (Math.Asin(x * b * x) + Math.Exp(-x / 2));
return result;
}

public static double[] FuncthionForShag(double x_natch, double x_konch, double x_shag)
Copy link
Collaborator

Choose a reason for hiding this comment

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

не используйте snake_case - замените на camelCase

{
var result = new double[(int)((x_konch - x_natch) / x_shag) + 1];
int kolch = 0;
for (double i = x_natch; i <= x_konch; i += x_shag)
{
result[kolch] = FuncthionZnach(i);
kolch++;
}

return result;
}

public static double[] FuncthionForMass(double[] x)
{
var y = new double[x.Length];
for (var i = 0; i < x.Length; i++)
{
y[i] = FuncthionZnach(x[i]);
}

return y;
}

public static void Main(string[] args)
{
Console.WriteLine($"Задание A:");
foreach (double element in FuncthionForShag(0.7, 2.2, 0.3))
{
Console.WriteLine(element);
}

Console.WriteLine($"\nЗадание B:");
var x = new double[] { 0.25, 0.36, 0.56, 0.94, 1.28 };
foreach (var element in FuncthionForMass(x))
{
Console.WriteLine($"y = {element}");
}

Console.WriteLine();
Console.ReadLine();
}
}
}
12 changes: 12 additions & 0 deletions _stylecop/stylecop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"documentationRules": {
"documentExposedElements": false,
"documentInterfaces": false,
"companyName": "Test Company",
"copyrightText": "This source code is Copyright © {companyName} and MAY NOT be copied, reproduced,\npublished, distributed or transmitted to or stored in any manner without prior\nwritten consent from {companyName} (www.yourcompany.com).",
"xmlHeader":false
}
}
}
14 changes: 14 additions & 0 deletions _stylecop/stylecop.ruleset
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="StyleCopeRules" Description="StyleCopeRules custom ruleset" ToolsVersion="14.0">
<IncludeAll Action="Warning" />
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1101" Action="None" />
<Rule Id="SA0001" Action="None" />
<Rule Id="SA1210" Action="None" />
<Rule Id="SA1200" Action="None" />
<Rule Id="SA1633" Action="None" />
<Rule Id="SA1600" Action="None" />
<Rule Id="SA1652" Action="None" />
<Rule Id="AD0001" Action="None" />
</Rules>
</RuleSet>
11 changes: 11 additions & 0 deletions courseworkspace.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"folders": [
{
"path": "CourseApp"
},
{
"path": "CourseApp.Tests"
}
],
"settings": {}
}