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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file not shown.
22 changes: 22 additions & 0 deletions ChuhaloArtem/1/HomeWork1/HomeWork1.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HomeWork1", "Условные конструкции\HomeWork1.csproj", "{0D1A8F26-881C-44D0-A8C0-6AF804CF975A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0D1A8F26-881C-44D0-A8C0-6AF804CF975A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D1A8F26-881C-44D0-A8C0-6AF804CF975A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D1A8F26-881C-44D0-A8C0-6AF804CF975A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D1A8F26-881C-44D0-A8C0-6AF804CF975A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added ChuhaloArtem/1/HomeWork1/HomeWork1.v12.suo
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeWork1
{
class Animals
{
public void Pets()
{
string kind;
Console.Write("\nWhat say your pet? мяу/гав: ");
kind = Console.ReadLine();
if (kind == "мяу")
Console.WriteLine("\nПокорми кота.");
else
if (kind == "гав")
Console.WriteLine("\nПогуляй с собакой");
else
if (kind != "мяу" || kind != "гав")
Console.WriteLine("\nInvalid selection. Please select proposed item");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeWork1
{
class Biger
{
public void Match()
{
Console.WriteLine("\nEnter first item: ");
int first = int.Parse(Console.ReadLine());
Console.WriteLine("Enter second item: ");
int second = int.Parse(Console.ReadLine());

if (first > second)
Console.WriteLine("\n"+first);
else
Console.WriteLine("\n"+second);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeWork1
{
class Chanse
{
public void Function()
{
Random realrnd = new Random();
string y="n";
int bounse;

Console.Write("\nEnter your start money: ");
int money=Convert.ToInt32(Console.ReadLine());
do
{
Console.Write("\nСделайте ставку (у вас {0} очков): ", money);
int step = Convert.ToInt32(Console.ReadLine());
bounse = realrnd.Next(1, 12);
Console.WriteLine("На кубике: {0}", bounse);
if(bounse<=5 && bounse>=1)
{
money = money - step;
Console.WriteLine("Вы проиграли.");
}
if (bounse <= 8 && bounse >= 6)
{
Console.WriteLine("Вы получаете ставку назад.");
}
if (bounse <= 11 && bounse >= 9)
{
money = money + step;
Console.WriteLine("Вы удвоили свою ставку.");
}
if (bounse == 12)
{
money = money + step * 9;
Console.WriteLine("Вы умножили свою ставку в 10 раз.");
}
Console.WriteLine("\nНа вашем счету {0} очков", money);
if (money == 0)
Console.WriteLine("Вы банкрот. До свидания.");
else
{
Console.Write("\nПовторить бросок? y/n: ");
y = Console.ReadLine();
}
} while (y == "y");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeWork1
{
class FIO
{
public void Print()
{
string surname;
string name;
string secname;
string i;

Console.WriteLine("\nPrint author FIO? y/n : ");
i = Console.ReadLine();

if (i == "y")
{
Console.WriteLine("+-------------------------+\n|Chuhalo Artem Ruslanovich|\n+-------------------------+");
}

Console.WriteLine("Print ayour FIO? y/n : ");
i = Console.ReadLine();
if (i == "y")
{
Console.WriteLine("Enter your surname: ");
surname = Console.ReadLine();
Console.WriteLine("Enter your name: ");
name = Console.ReadLine();
Console.WriteLine("Enter your second name: ");
secname = Console.ReadLine();

Console.WriteLine("+-------------------------+\n|{0} {1} {2}|\n+-------------------------+", surname, name, secname);
Console.ReadKey();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0D1A8F26-881C-44D0-A8C0-6AF804CF975A}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Условные_конструкции</RootNamespace>
<AssemblyName>Условные конструкции</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Animals.cs" />
<Compile Include="Biger.cs" />
<Compile Include="Chanse.cs" />
<Compile Include="FIO.cs" />
<Compile Include="Money.cs" />
<Compile Include="Month.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Simple.cs" />
<Compile Include="Taxi.cs" />
<Compile Include="ThreeOp.cs" />
<Compile Include="Week.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeWork1
{
class Money
{
public void Function()
{
double courseDtoE=0.5;
double courseDtoG=5;
double courseEtoG=10;

Console.Write("\nChoose money type (grn, dollar, euro): ");
string kind = Console.ReadLine();
Console.Write("How much: ");
double sum = Convert.ToInt32(Console.ReadLine());

switch(kind)
{
case "grn":
double sumE = sum / courseEtoG;
double sumD = sum / courseDtoG;
Console.WriteLine("\nGRN - {0}, DOLLAR - {1}\nGRN - {0}, EURO - {2}", sum, sumD, sumE);
break;

case "dollar":
sumE = sum * courseDtoE;
double sumG = sum*courseDtoG ;
Console.WriteLine("\nDOLLAR - {0}, GRN - {1}\nDOLLAR - {0}, EURO - {2}", sum, sumG, sumE);
break;

case "euro":
sumD = sum / courseDtoE;
sumG = sum * courseEtoG;
Console.WriteLine("\nEURO - {0}, GRN - {1}\nEURO - {0}, DOLLAR - {2}", sum, sumG, sumD);
break;

default:
Console.WriteLine("Invalid selection. Please select proposed item");
break;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeWork1
{
class Month
{
public void Time()
{
Console.Write("\nEnter month number (1-12): ");
int number = int.Parse(Console.ReadLine());

if (number == 1 || number == 2 || number == 12)
Console.WriteLine("Зима!");
if (number == 3 || number == 4 || number == 5)
Console.WriteLine("Весна!");
if (number == 6 || number == 7 || number == 8)
Console.WriteLine("Лето!");
if (number == 9 || number == 10 || number == 11)
Console.WriteLine("Осень!");
if (number < 1 && number > 12)
Console.WriteLine("\nInvalid selection. Please select proposed item");
}
}
}
Loading