浏览代码

Расчет зарплаты

Sultan Khasanov 2 年之前
父节点
当前提交
55c6f7991c

+ 4 - 0
.editorconfig

@@ -0,0 +1,4 @@
+[*.{cs,vb}]
+
+# IDE0040: Добавить модификаторы доступа
+dotnet_style_require_accessibility_modifiers = never

二进制
.vs/Laba 4/FileContentIndex/3cde4494-bea6-4789-9fbc-9287eab22dbf.vsidx


二进制
.vs/Laba 4/FileContentIndex/3fb1f38f-f81c-4ed5-a802-b3efec500786.vsidx


二进制
.vs/Laba 4/FileContentIndex/4610d579-69aa-455f-9f45-6f8ac80fd947.vsidx


二进制
.vs/Laba 4/FileContentIndex/7b86196c-dc9f-4a6f-8c17-2675201716ab.vsidx


二进制
.vs/Laba 4/FileContentIndex/8bbd94a8-0502-47ca-85e2-af9870f119b3.vsidx


二进制
.vs/Laba 4/v17/.suo


+ 155 - 0
Laba 4/.cs

@@ -0,0 +1,155 @@
+using System;
+using System.Collections.Generic;
+
+internal static class ProgramHelpers
+{
+    static void Main(string[] args)
+    {
+        //ПРИВЕТ
+        double x, y; //Ввод переменных в программу
+        Console.Write("Введите x: ");//Действие для пользователя
+        x = double.Parse(Console.ReadLine());//Ввод вещественной переменной преобразованной из строки
+        y = 4 * (Math.Pow(x - 3, 6)) - 7 * (Math.Pow(x - 3, 3)) + 2;//Нахождение значения функции
+        Console.WriteLine("Значение функции = {0}", y);//Вывод значения y
+                                                       // некотор214ые ифывзменения кода
+                                                       // некотофыврые изменения кода
+                                                       // некотфвфвыорые измеasнения кода
+                                                       // некоторые asdasddssadизменasdения кода
+                                                       // некотофыврые изменения кодаыфsadadadas
+                                                       // некоторфвые изменения кода
+                                                       // некотофывasdрые изменения кода
+                                                       //Добавили инструкцию
+                                                       // git commit –m “реализовали возможность определить совершеннолетие пользователя”
+                                                       // git commit –m “реализовали возможность определить asdыфвфсовершеннолетие пользователя”
+
+        //Проверка правильности номера телефона
+        Console.WriteLine("Введите номер телефона:");
+
+        string mobileOperator = Console.ReadLine();
+        mobileOperator = mobileOperator.Insert(1, "(");
+        mobileOperator = mobileOperator.Insert(5, ")");
+        mobileOperator = mobileOperator.Insert(9, "-");
+        mobileOperator = mobileOperator.Insert(12, "-");
+        Console.WriteLine(mobileOperator);
+
+        List<int> numbersOperator = new List<int>();
+        numbersOperator.Add(029);
+        numbersOperator.Add(044);
+        numbersOperator.Add(033);
+        numbersOperator.Add(025);
+
+        var startindex = mobileOperator.IndexOf("(") + 1;
+        var endIndex = mobileOperator.IndexOf(")", startindex);
+        var mob = mobileOperator.Substring(startindex, endIndex - startindex);
+        int resulte = Convert.ToInt32(mob);
+        var mobiletelephone = mobileOperator.Remove(0, 6);
+        bool correctOperator = numbersOperator.Contains(resulte);
+
+        if (correctOperator == false)
+        {
+            Console.WriteLine("Введен не правильный номер оператора");
+            Console.ReadLine();
+        }
+        else
+        {
+            var split = mobiletelephone.Split(new Char[] { '-' });
+            for (int f = 0; f < split.Length; f++)
+            {
+                if (split[0].Length != 3)
+                {
+                    Console.WriteLine("Введен не правильный номер телефона");
+                    Console.ReadLine();
+                    break;
+                }
+                if (split[1].Length != 2)
+                {
+                    Console.WriteLine("Введен не правильный номер телефона");
+                    Console.ReadLine();
+                    break;
+                }
+                if (split[2].Length != 2)
+                {
+
+                    Console.WriteLine("Введен не правильный номер телефона");
+                    Console.ReadLine();
+                    break;
+                }
+                Console.WriteLine("Номер телефона и оператора введен корректно");
+                Console.ReadLine();
+            }
+        }
+
+        //Расчет прибыли
+        int a, b, c;
+        a = 0;
+        b = 0;
+        c = a - b;
+
+        Console.WriteLine("dochod:", a);
+        Console.ReadLine();
+
+        Console.WriteLine("raschody:", b);
+        Console.ReadLine();
+
+        if (c > 0)
+        {
+            Console.WriteLine("dochod jest");
+        }
+        else
+        {
+
+            Console.WriteLine("ubytok ");
+        }
+
+
+        //Расчет идеального веса
+
+
+        double rost, ves, index, pol, voz, zap, lor, kup;
+        {
+            Console.WriteLine("Введите свой рост:");
+            rost = double.Parse(Console.ReadLine());
+            Console.WriteLine("Введите свой вес:");
+            ves = double.Parse(Console.ReadLine());
+            Console.WriteLine("Введите свой пол (м=0 или ж=1):");
+            pol = double.Parse(Console.ReadLine());
+            Console.WriteLine("Введите свой возраст:");
+            voz = double.Parse(Console.ReadLine());
+            Console.WriteLine("Введите обхват запястья:");
+            zap = double.Parse(Console.ReadLine());
+
+            ///кетле
+
+            rost = rost / 100;
+            index = ves / (rost * rost);
+            if (index <= 18.5)
+                Console.WriteLine("У Вас дефицит массы тела! Идите жрать, пожалуйста!!!");
+            if (index >= 18.5 && index <= 24.9)
+                Console.WriteLine("Поздравляю, Ваш жирок не привышает нормы)))");
+            if (index >= 25.0 && index <= 29.9)
+                Console.WriteLine("У Вас избыточная масса тела! Пора бы на пробежку :/");
+            if (index >= 30.0 && index <= 34.9)
+                Console.WriteLine("У Вас ожирение 1-й степени! Садитесь ка на диету!!!");
+            if (index >= 35.0 && index <= 39.9)
+                Console.WriteLine("У Вас ожирение 2-й степени! Срочно в качалочку!!!");
+            if (index == 40 || index >= 40)
+                Console.WriteLine("У Вас 3-я степень ожирения! Срочно к диетологу, тут Вам только он поможет!!!");
+            rost = rost * 100;
+            if (pol == 1)
+            {
+                lor = rost - 100 - ((rost - 150) / 4);
+                Console.WriteLine("Ваш идеальный вес по формуле Лоренца:" + lor.ToString("0"));
+                kup = (rost * 0.624 - 0.453);
+                Console.WriteLine("Ваш идеальный вес по формуле Купера:" + kup.ToString("0"));
+            }
+
+            if (pol == 1)
+            {
+                lor = rost - 100 - ((rost - 150) / 2);
+                Console.WriteLine("Ваш идеальный вес по формуле Лоренца:" + lor.ToString("0"));
+                kup = (0.713 * rost - 58.03);
+                Console.WriteLine("Ваш идеальный вес по формуле Купера:" + kup.ToString("0"));
+            }
+        }
+    }
+}

+ 5 - 0
Laba 4/Laba 4.csproj

@@ -44,9 +44,14 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Program.cs" />
+    <Compile Include=".cs" />
+    <Compile Include="ProgramHelpers.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
+    <None Include="..\.editorconfig">
+      <Link>.editorconfig</Link>
+    </None>
     <None Include="App.config" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 3 - 1
Laba 4/Program.cs

@@ -159,8 +159,10 @@ namespace laba4
             }
 
 
-                Console.ReadLine(); //Строка ввода чтобы окно не закрылось
+             Console.ReadKey(); //Строка ввода чтобы окно не закрылось
 
+
+            //изменение 4
         }
     }
 }

+ 3 - 0
Laba 4/ProgramHelpers.cs

@@ -0,0 +1,3 @@
+static class ProgramHelpers
+{
+}

二进制
Laba 4/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


+ 1 - 1
Laba 4/obj/Debug/Laba 4.csproj.CoreCompileInputs.cache

@@ -1 +1 @@
-4fc2481e9a3c0263d44b0a324dc22847d6a96d79
+65774098bde3eebc163ef11f33dad3238a845c83