|
@@ -22,7 +22,7 @@ namespace ExamSergeichev
|
|
|
string thickness = "Соответствует";
|
|
|
|
|
|
int[] diameters = new int[] { 20, 25, 32, 40, 50, 63 };
|
|
|
- Console.WriteLine("В данном списке указываются трубы, которые не соответствуют обозначенным параметрам. Указанные значения в списке являются неверными");
|
|
|
+ Console.WriteLine("Внимание! Обнаружены дефекты!!! В данном списке указываются трубы, которые не соответствуют обозначенным параметрам. Указанные значения в списке являются неверными");
|
|
|
Console.WriteLine("");
|
|
|
for (int i = 0; i<arr.Length;i++)
|
|
|
{
|
|
@@ -50,25 +50,25 @@ namespace ExamSergeichev
|
|
|
|
|
|
if (arr[i].name == "PN10" && diameter == "Соответствует")
|
|
|
{
|
|
|
- if (arr[i].thickness < arr[i].diameter * 0.1 && arr[i].thickness > arr[i].diameter * 0.11) thickness = Convert.ToString(arr[i].thickness);
|
|
|
+ if (arr[i].thickness < arr[i].diameter * 0.1 || arr[i].thickness > arr[i].diameter * 0.11) thickness = Convert.ToString(arr[i].thickness);
|
|
|
checkAll = true;
|
|
|
}
|
|
|
|
|
|
if (arr[i].name == "PN16" && diameter == "Соответствует")
|
|
|
{
|
|
|
- if (arr[i].thickness < arr[i].diameter * 0.135 && arr[i].thickness > arr[i].diameter * 0.14) thickness = Convert.ToString(arr[i].thickness);
|
|
|
+ if (arr[i].thickness < arr[i].diameter * 0.135 || arr[i].thickness > arr[i].diameter * 0.14) thickness = Convert.ToString(arr[i].thickness);
|
|
|
checkAll = true;
|
|
|
}
|
|
|
|
|
|
if (arr[i].name == "PN20" && diameter == "Соответствует")
|
|
|
{
|
|
|
- if (arr[i].thickness < arr[i].diameter * 0.165 && arr[i].thickness > arr[i].diameter * 0.17) thickness = Convert.ToString(arr[i].thickness);
|
|
|
+ if (arr[i].thickness < arr[i].diameter * 0.165 || arr[i].thickness > arr[i].diameter * 0.17) thickness = Convert.ToString(arr[i].thickness);
|
|
|
checkAll = true;
|
|
|
}
|
|
|
|
|
|
if (arr[i].name == "PN25" && diameter == "Соответствует")
|
|
|
{
|
|
|
- if (arr[i].thickness < arr[i].diameter * 0.165 && arr[i].thickness > arr[i].diameter * 0.17) thickness = Convert.ToString(arr[i].thickness);
|
|
|
+ if (arr[i].thickness < arr[i].diameter * 0.165 || arr[i].thickness > arr[i].diameter * 0.17) thickness = Convert.ToString(arr[i].thickness);
|
|
|
checkAll = true;
|
|
|
}
|
|
|
|
|
@@ -79,15 +79,55 @@ namespace ExamSergeichev
|
|
|
Console.WriteLine($"Номер в списке: {i+1} Наименование трубы: {nameMarriagePipes[iterationForNameArray]}, Длина трубы: {length}, Диаметр трубы: {diameter}, Толщина трубы: {thickness}");
|
|
|
checkAll = false;
|
|
|
checkDiameter = false;
|
|
|
- i++;
|
|
|
+
|
|
|
iterationForNameArray++;
|
|
|
Array.Resize(ref nameMarriagePipes, nameMarriagePipes.Length + 1);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- i++;
|
|
|
+ arr[i].isDefective = "Соответствует";
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Console.WriteLine("Процент брака по каждому изделию в партии: ");
|
|
|
+ int countDefectivePN10 = 0;
|
|
|
+ int countDefectivePN16 = 0;
|
|
|
+ int countDefectiveAPN16 = 0;
|
|
|
+ int countDefectivePN20 = 0;
|
|
|
+ int countDefectiveAPN20 = 0;
|
|
|
+ int countDefectivePN25 = 0;
|
|
|
+ for (int i = 0; i < arr.Length; i++)
|
|
|
+ {
|
|
|
+ if (arr[i].name == "PN10" && arr[i].isDefective == "Не соответствует") countDefectivePN10++;
|
|
|
+ if (arr[i].name == "PN16" && arr[i].isDefective == "Не соответствует") countDefectivePN16++;
|
|
|
+ if (arr[i].name == "PN16" && arr[i].isReinforced == "А" && arr[i].isDefective == "Не соответствует") countDefectiveAPN16++;
|
|
|
+ if (arr[i].name == "PN20" && arr[i].isDefective == "Не соответствует") countDefectivePN20++;
|
|
|
+ if (arr[i].name == "PN20" && arr[i].isReinforced == "А" && arr[i].isDefective == "Не соответствует") countDefectiveAPN20++;
|
|
|
+ if (arr[i].name == "PN25" && arr[i].isDefective == "Не соответствует") countDefectivePN25++;
|
|
|
+ }
|
|
|
+
|
|
|
+ int countPN10 = 0;
|
|
|
+ int countPN16 = 0;
|
|
|
+ int countAPN16 = 0;
|
|
|
+ int countPN20 = 0;
|
|
|
+ int countAPN20 = 0;
|
|
|
+ int countPN25 = 0;
|
|
|
+ for (int i = 0; i < arr.Length; i++)
|
|
|
+ {
|
|
|
+ if (arr[i].name == "PN10") countPN10++;
|
|
|
+ if (arr[i].name == "PN16") countPN16++;
|
|
|
+ if (arr[i].name == "PN16" && arr[i].isReinforced == "А") countAPN16++;
|
|
|
+ if (arr[i].name == "PN20") countPN20++;
|
|
|
+ if (arr[i].name == "PN20" && arr[i].isReinforced == "А") countAPN20++;
|
|
|
+ if (arr[i].name == "PN25") countPN25++;
|
|
|
}
|
|
|
+ Console.WriteLine();
|
|
|
+ Console.WriteLine($"PN10 = {(countDefectivePN10 * 100)/ countPN10}%, PN16 = {(countDefectivePN16*100)/countPN16}%, APN16 = {(countDefectiveAPN16 * 100) / countAPN16}%, PN20 = {(countDefectivePN20 * 100) / countPN20}%, APN20 = {(countDefectiveAPN20 * 100) / countAPN20}%, PN15 = {(countDefectivePN25 * 100) / countPN25}%");
|
|
|
+ Console.WriteLine();
|
|
|
}
|
|
|
}
|
|
|
}
|