1
0
mirror of https://github.com/danog/informatica.git synced 2024-11-30 04:29:02 +01:00

Added new exercises

This commit is contained in:
Daniil Gentili 2016-11-15 14:36:59 +01:00
parent 142b0d8c98
commit ad05015b01
82 changed files with 842 additions and 4 deletions

View File

@ -21,10 +21,11 @@ static void Main(string[] args)
ConsoleColor[,] mappa = new ConsoleColor[Console.WindowWidth, Console.WindowHeight - 1];
Console.TreatControlCAsInput = true;
char matita = '\0';
ConsoleKey colore = ConsoleColor.Black;
ConsoleKeyInfo input = new ConsoleKeyInfo('W', ConsoleKey.W, false, false, false);
printmenu(new string[] { "^X: Exit", "^C Change color", "^L Load", "^O Save", "x: " + Console.CursorLeft + ", y: " + Console.CursorTop }, true);
Char matita = ' ';
while (!(input.Key == ConsoleKey.X && input.Modifiers == ConsoleModifiers.Control))
{
@ -120,7 +121,7 @@ static void align()
Console.SetCursorPosition(left, top);
}
static bool printtofile(ref char[,] mappa, string dest)
static bool printtofile(ref ConsoleColor[,] mappa, string dest)
{
// x is width (oriz), y is height (vert), index 0 is x, index 1 is y
@ -169,7 +170,7 @@ static bool printtofile(ref char[,] mappa, string dest)
}
static bool readfromfile(ref char[,] mappa, string dest)
static bool readfromfile(ref ConsoleColor[,] mappa, string dest)
{
// x is width (oriz), y is height (vert), index 0 is x, index 1 is y
@ -359,7 +360,7 @@ static void checkmaxmin(ref int c, int max)
c--;
}
}
static void printTo(ref int x, ref int y, char print, ref char[,] mappa)
static void printTo(ref int x, ref int y, char print, ref ConsoleColor[,] mappa)
{
checkmaxmin(ref x, Console.WindowWidth - 1);

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MassimoFraN", "MassimoFraN\MassimoFraN.csproj", "{76FAC2CB-1943-4E1E-BBAE-1F8A76018235}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{76FAC2CB-1943-4E1E-BBAE-1F8A76018235}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76FAC2CB-1943-4E1E-BBAE-1F8A76018235}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76FAC2CB-1943-4E1E-BBAE-1F8A76018235}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76FAC2CB-1943-4E1E-BBAE-1F8A76018235}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>{76FAC2CB-1943-4E1E-BBAE-1F8A76018235}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MassimoFraN</RootNamespace>
<AssemblyName>MassimoFraN</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.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>

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MassimoFraN
{ class Program
{
static void Main(string[] args)
{
double max = 0;
double n = 0;
int count = 0;
do
{
Console.Write("Inserire un numero (scrivere una lettera per uscire): ");
try
{
n = Convert.ToDouble(Console.ReadLine());
if (n > max) {
max = n;
}
}
catch (FormatException e)
{
if (count < 2)
{
Console.WriteLine("Dovete inserire almeno 2 numeri.");
continue;
}
break;
}
count++;
} while (true);
Console.WriteLine("Il massimo numero tra quelli che avete inserito è {0}", max);
Console.Read();
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MassimoFraN")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MassimoFraN")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5de58aee-7570-4402-8aa5-407121e43381")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@ -0,0 +1,5 @@
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\MassimoFraN\MassimoFraN\bin\Debug\MassimoFraN.exe.config
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\MassimoFraN\MassimoFraN\bin\Debug\MassimoFraN.exe
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\MassimoFraN\MassimoFraN\bin\Debug\MassimoFraN.pdb
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\MassimoFraN\MassimoFraN\obj\Debug\MassimoFraN.exe
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\MassimoFraN\MassimoFraN\obj\Debug\MassimoFraN.pdb

Binary file not shown.

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoligoniRegolari", "PoligoniRegolari\PoligoniRegolari.csproj", "{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PoligoniRegolari</RootNamespace>
<AssemblyName>PoligoniRegolari</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.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>

View File

@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoligoniRegolari
{
class Program
{
static void Main(string[] args)
{
int lati = 0;
double area, apotema, perimetro, lato = -1, numeroFisso = 0;
string tipoPoligono = "";
Console.WriteLine("Poligoni regolari.\n");
Console.Write("Inserire il numero di lati del poligono: ");
try
{
lati = Convert.ToInt32(Console.ReadLine());
}
catch (FormatException e)
{
}
switch (lati)
{
case 3:
numeroFisso = 0.289;
tipoPoligono = "triangolo";
break;
case 4:
numeroFisso = 0.5;
tipoPoligono = "quadrato";
break;
case 5:
numeroFisso = 0.688;
tipoPoligono = "pentagono";
break;
default:
Exit("Il numero di lati inserito non è valido.");
break;
}
Console.WriteLine();
Console.Write("Inserire la lunghezza del lato: ");
try
{
lato = Convert.ToDouble(Console.ReadLine());
}
catch (FormatException e)
{
}
if (lato < 0)
{
Exit("La lunghezza inserita non è valida.");
}
Console.WriteLine();
apotema = lato * numeroFisso;
perimetro = lato * lati;
area = perimetro * apotema / 2;
Console.WriteLine("Tipo poligono: {0}\nNumero lati: {1}\nLunghezza lato: {2}\nNumero fisso: {3}\nValore apotema: {4}\nValore perimetro: {5}\nValore area: {6}", tipoPoligono, lati, lato, numeroFisso, apotema, perimetro, area);
Console.Read();
}
public static void Exit(string error)
{
Console.WriteLine(error + "\a");
Console.Read();
System.Environment.Exit(1);
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PoligoniRegolari")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PoligoniRegolari")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2df6ec82-a36b-4923-ab5d-8e918492855c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@ -0,0 +1,6 @@
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\bin\Debug\PoligoniRegolari.exe.config
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\obj\Debug\PoligoniRegolari.csprojResolveAssemblyReference.cache
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\bin\Debug\PoligoniRegolari.exe
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\bin\Debug\PoligoniRegolari.pdb
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\obj\Debug\PoligoniRegolari.exe
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\obj\Debug\PoligoniRegolari.pdb

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoligoniRegolari", "PoligoniRegolari\PoligoniRegolari.csproj", "{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>{2034B6DE-7160-45B6-BFFE-04A16CF8E69A}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PoligoniRegolari</RootNamespace>
<AssemblyName>PoligoniRegolari</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.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>

View File

@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoligoniRegolari
{
class Program
{
static void Main(string[] args)
{
byte lati = 0;
double area, apotema, perimetro, lato = -1;
float numeroFisso = 0f;
string tipoPoligono = "";
Console.WriteLine("Poligoni regolari.\n");
do
{
Console.Write("Inserire il numero di lati del poligono: ");
try
{
lati = Convert.ToByte(Console.ReadLine());
}
catch (FormatException e)
{
}
catch (OverflowException e)
{
}
switch (lati)
{
case 3:
numeroFisso = 0.289f;
tipoPoligono = "triangolo";
break;
case 4:
numeroFisso = 0.5f;
tipoPoligono = "quadrato";
break;
case 5:
numeroFisso = 0.688f;
tipoPoligono = "pentagono";
break;
default:
Console.WriteLine("Il numero di lati inserito non è valido.\a");
break;
}
} while (lati < 3 || lati > 5);
Console.WriteLine();
do
{
Console.Write("Inserire la lunghezza del lato: ");
try
{
lato = Convert.ToDouble(Console.ReadLine());
}
catch (FormatException e)
{
}
if (lato < 0)
{
Console.WriteLine("La lunghezza inserita non è valida.\a");
}
} while (lato < 0);
Console.WriteLine();
apotema = lato * numeroFisso;
perimetro = lato * lati;
area = (perimetro * apotema) / 2;
Console.WriteLine("Tipo poligono: {0}\nNumero lati: {1}\nLunghezza lato: {2}\nNumero fisso: {3}\nValore apotema: {4}\nValore perimetro: {5}\nValore area: {6}", tipoPoligono, lati, lato, numeroFisso, apotema, perimetro, area);
Console.Read();
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PoligoniRegolari")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PoligoniRegolari")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2df6ec82-a36b-4923-ab5d-8e918492855c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@ -0,0 +1,12 @@
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\bin\Debug\PoligoniRegolari.exe.config
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\obj\Debug\PoligoniRegolari.csprojResolveAssemblyReference.cache
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\bin\Debug\PoligoniRegolari.exe
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\bin\Debug\PoligoniRegolari.pdb
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\obj\Debug\PoligoniRegolari.exe
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolari\PoligoniRegolari\obj\Debug\PoligoniRegolari.pdb
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolariv2\PoligoniRegolari\bin\Debug\PoligoniRegolari.exe.config
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolariv2\PoligoniRegolari\obj\Debug\PoligoniRegolari.exe
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolariv2\PoligoniRegolari\obj\Debug\PoligoniRegolari.pdb
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolariv2\PoligoniRegolari\bin\Debug\PoligoniRegolari.exe
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolariv2\PoligoniRegolari\bin\Debug\PoligoniRegolari.pdb
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\PoligoniRegolariv2\PoligoniRegolari\obj\Debug\PoligoniRegolari.csprojResolveAssemblyReference.cache

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mediaDINNumeri", "mediaDINNumeri\mediaDINNumeri.csproj", "{52BA96E6-8C9A-4494-AB65-9E44E54A626D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{52BA96E6-8C9A-4494-AB65-9E44E54A626D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{52BA96E6-8C9A-4494-AB65-9E44E54A626D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{52BA96E6-8C9A-4494-AB65-9E44E54A626D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{52BA96E6-8C9A-4494-AB65-9E44E54A626D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mediaDINNumeri
{
class Program
{
static void Main(string[] args)
{
double somma = 0;
int count = 0;
do
{
Console.Write("Inserire un numero (scrivere una lettera per uscire): ");
try
{
somma += Convert.ToDouble(Console.ReadLine());
}
catch (FormatException e)
{
if (count < 2)
{
Console.WriteLine("Dovete inserire almeno 2 numeri.");
continue;
}
break;
}
count++;
} while (true);
Console.WriteLine("La media dei numeri inseriti è {0}", somma/count);
Console.Read();
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("mediaDINNumeri")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("mediaDINNumeri")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7f352dc4-9a8a-45bb-9d0d-b496d8f946cd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>{52BA96E6-8C9A-4494-AB65-9E44E54A626D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>mediaDINNumeri</RootNamespace>
<AssemblyName>mediaDINNumeri</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.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>

View File

@ -0,0 +1,6 @@
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\mediaDINNumeri\mediaDINNumeri\bin\Debug\mediaDINNumeri.exe.config
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\mediaDINNumeri\mediaDINNumeri\obj\Debug\mediaDINNumeri.csprojResolveAssemblyReference.cache
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\mediaDINNumeri\mediaDINNumeri\bin\Debug\mediaDINNumeri.exe
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\mediaDINNumeri\mediaDINNumeri\bin\Debug\mediaDINNumeri.pdb
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\mediaDINNumeri\mediaDINNumeri\obj\Debug\mediaDINNumeri.exe
C:\Users\Daniil\Dropbox\DANIIL LICEO ANNO 2015-2016\informatica\visual_new\mediaDINNumeri\mediaDINNumeri\obj\Debug\mediaDINNumeri.pdb