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
34 changes: 34 additions & 0 deletions exam/exercise 11/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;

namespace exercise_11
{
public class Program
{
public static int Summa(int a, int b, int c)
{
return a + b + c;
}

public static void Main()
{
int[] Massiv = new int[10];
Massiv[0] = 4;
Massiv[1] = 2;
Massiv[2] = 7;

for (int i = 3; i < 10; i++)
{
Massiv[i] = Summa(Massiv[i - 3], Massiv[i - 2], Massiv[i - 1]);
}

Console.Write("Первые 10 элементов ряда: ");

foreach (int j in Massiv)
{
Console.Write($"{j} ");
}

Console.ReadLine();
}
}
}
9 changes: 9 additions & 0 deletions exam/exercise 11/exercise 11.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RootNamespace>exercise_11</RootNamespace>
</PropertyGroup>

</Project>
24 changes: 24 additions & 0 deletions exam/exercise 14/Car.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace exercise_14
{
class Car
{
public string start()
{
return $"Машина стартует";
}

public string stop()
{
return $"Машина останавливается";
}

public int drive(int howlong)
{
return howlong * 60;
}
}
}
17 changes: 17 additions & 0 deletions exam/exercise 14/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

namespace exercise_14
{
class Program
{
static void Main()
{
Car car = new Car();
double howlong = 200;
Console.WriteLine(car.start());
Console.WriteLine($"За время равное {howlong} минутам, расстроение пройденное машиной будет равно {car.drive(200)}");
Console.WriteLine(car.stop());
Console.ReadKey();
}
}
}
9 changes: 9 additions & 0 deletions exam/exercise 14/exercise 14.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RootNamespace>exercise_14</RootNamespace>
</PropertyGroup>

</Project>
18 changes: 18 additions & 0 deletions exam/exercise 16/LengthConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace exercise_16
{
class LengthConverter
{
public double ConvertMilesToKm(double length)
{
return length * 1.609;
}
public double ConvertKmToMiles(double length)
{
return length / 1.609;
}
}
}
20 changes: 20 additions & 0 deletions exam/exercise 16/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;

namespace exercise_16
{
class Program
{
public static void Main()
{
LengthConverter converter = new LengthConverter();
double length;
Console.Write("Введите длину: ");
length = Convert.ToDouble(Console.ReadLine());

Console.WriteLine($"Перевести {length} милей в километры: {converter.ConvertMilesToKm(length)}");
Console.WriteLine($"Перевести {length} километров в мили: {converter.ConvertKmToMiles(length)}");

Console.ReadLine();
}
}
}
9 changes: 9 additions & 0 deletions exam/exercise 16/exercise 16.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RootNamespace>exercise_16</RootNamespace>
</PropertyGroup>

</Project>