Minor corrections

This commit is contained in:
La Programmatrice Verde 2025-03-13 09:38:16 +01:00
parent 764a338306
commit 09af3b7ba5
8 changed files with 25 additions and 22 deletions

View File

@ -9,7 +9,6 @@ class Program {
Console.Clear();
int scelta;
int[,] matrix1 = null, matrix2 = null;
int[] array = null;
do {
Console.WriteLine();
@ -39,30 +38,30 @@ class Program {
case 2:
Console.Clear();
if (matrix1 != null) {
Console.WriteLine($"La somma degli elementi della diagonale principale è {SommaMatriceDiagonale2(matrix1)}");
Console.WriteLine($"La somma degli elementi della diagonale secondaria è {SommaMatriceDiagonale2(matrix1)}");
}
else {
Console.WriteLine("È necessario creare la matrice prima di calcolare la somma della diagonale principale.");
Console.WriteLine("È necessario creare la matrice prima di calcolare la somma della diagonale secondaria.");
}
Pausa();
break;
case 3:
Console.Clear();
if (matrix1 != null) {
Console.WriteLine($"La media degli elementi della diagonale principale è {SommaMatriceDiagonale2(matrix1) / matrix1.GetLength(0)}");
Console.WriteLine($"La media degli elementi della diagonale secondaria è {SommaMatriceDiagonale2(matrix1) / matrix1.GetLength(0)}");
}
else {
Console.WriteLine("È necessario creare la matrice prima di calcolare la media della diagonale principale.");
Console.WriteLine("È necessario creare la matrice prima di calcolare la media della diagonale secondaria.");
}
Pausa();
break;
case 4:
Console.Clear();
if (matrix1 != null) {
Console.WriteLine($"Il prodotto degli elementi della diagonale principale è {ProdottoMatriceDiagonale2(matrix1)}");
Console.WriteLine($"Il prodotto degli elementi della diagonale secondaria è {ProdottoMatriceDiagonale2(matrix1)}");
}
else {
Console.WriteLine("È necessario creare la matrice prima di calcolare il prodotto della diagonale principale.");
Console.WriteLine("È necessario creare la matrice prima di calcolare il prodotto della diagonale secondaria.");
}
Pausa();
break;
@ -73,7 +72,7 @@ class Program {
MostraMinimoMassimoMatrice(MinimoMassimoMatriceDiagonale2(matrix1, 1), 1);
}
else {
Console.WriteLine("È necessario creare la matrice prima di calcolare il prodotto della diagonale principale.");
Console.WriteLine("È necessario creare la matrice prima di calcolare il prodotto della diagonale secondaria.");
}
Pausa();
break;
@ -126,6 +125,7 @@ class Program {
}
return ritorno;
}
static void MostraMatrice(int[,] p_matrice) {
for (int r = 0; r < p_matrice.GetLength(0); r++) {
for (int c = 0; c < p_matrice.GetLength(1); c++) {
@ -142,6 +142,7 @@ class Program {
}
return ritorno;
}
static int ProdottoMatriceDiagonale2(int[,] p_matrice) {
int ritorno = 1;
for (int r = 0; r < p_matrice.GetLength(0); r++) {
@ -199,6 +200,7 @@ class Program {
}
}
}
static void MostraMinimoMassimoMatrice(int[,] p_matrice, int p_scelta) {
bool trovato = false;
string stringa = "";
@ -261,4 +263,5 @@ class Program {
}
return ritorno;
}
}

View File

@ -13,10 +13,10 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("matrix_3")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+539f1a7b8c9a68722f7a1fe86ab352245f0386bf")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+764a338306bd0fd4208e95b81f172c6a5f04781d")]
[assembly: System.Reflection.AssemblyProductAttribute("matrix_3")]
[assembly: System.Reflection.AssemblyTitleAttribute("matrix_3")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generato dalla classe WriteCodeFragment di MSBuild.
// Generated by the MSBuild WriteCodeFragment class.

View File

@ -1 +1 @@
75d0e1c096fd43eafc2a6b5b20efe325c46b0abfa9de25105e4bd04279227414
b0dc84113e8a93b37e0f4e4c454bb81a3bc8215e5b8f965afc6f5e66014a4397

View File

@ -8,7 +8,7 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = matrix_3
build_property.ProjectDir = /home/Verde/git/matrix_3/
build_property.ProjectDir = /home/BrainTheBest5/git/matrix_3/
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 9.0

View File

@ -1,17 +1,17 @@
{
"format": 1,
"restore": {
"/home/Verde/git/matrix_3/matrix_3.csproj": {}
"/home/BrainTheBest5/git/matrix_3/matrix_3.csproj": {}
},
"projects": {
"/home/Verde/git/matrix_3/matrix_3.csproj": {
"/home/BrainTheBest5/git/matrix_3/matrix_3.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/home/Verde/git/matrix_3/matrix_3.csproj",
"projectUniqueName": "/home/BrainTheBest5/git/matrix_3/matrix_3.csproj",
"projectName": "matrix_3",
"projectPath": "/home/Verde/git/matrix_3/matrix_3.csproj",
"projectPath": "/home/BrainTheBest5/git/matrix_3/matrix_3.csproj",
"packagesPath": "/home/Verde/.nuget/packages/",
"outputPath": "/home/Verde/git/matrix_3/obj/",
"outputPath": "/home/BrainTheBest5/git/matrix_3/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/Verde/.nuget/NuGet/NuGet.Config"

View File

@ -13,11 +13,11 @@
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/home/Verde/git/matrix_3/matrix_3.csproj",
"projectUniqueName": "/home/BrainTheBest5/git/matrix_3/matrix_3.csproj",
"projectName": "matrix_3",
"projectPath": "/home/Verde/git/matrix_3/matrix_3.csproj",
"projectPath": "/home/BrainTheBest5/git/matrix_3/matrix_3.csproj",
"packagesPath": "/home/Verde/.nuget/packages/",
"outputPath": "/home/Verde/git/matrix_3/obj/",
"outputPath": "/home/BrainTheBest5/git/matrix_3/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/Verde/.nuget/NuGet/NuGet.Config"

View File

@ -1,8 +1,8 @@
{
"version": 2,
"dgSpecHash": "x6rXj9DqFEk=",
"dgSpecHash": "LbKVebMzYzQ=",
"success": true,
"projectFilePath": "/home/Verde/git/matrix_3/matrix_3.csproj",
"projectFilePath": "/home/BrainTheBest5/git/matrix_3/matrix_3.csproj",
"expectedPackageFiles": [],
"logs": []
}