diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b956f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,133 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.svclog +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml +*.azurePubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +packages/ +## TODO: If the tool you use requires repositories.config, also uncomment the next line +!packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +![Ss]tyle[Cc]op.targets +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml + +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store + +_NCrunch* \ No newline at end of file diff --git a/.vs/ConsoleApp3/FileContentIndex/7a270604-982f-4674-9f70-18686ca64b0d.vsidx b/.vs/ConsoleApp3/FileContentIndex/7a270604-982f-4674-9f70-18686ca64b0d.vsidx new file mode 100644 index 0000000..8c2f874 Binary files /dev/null and b/.vs/ConsoleApp3/FileContentIndex/7a270604-982f-4674-9f70-18686ca64b0d.vsidx differ diff --git a/.vs/ConsoleApp3/FileContentIndex/c7ba8a92-0130-42d3-a920-0fe299838c98.vsidx b/.vs/ConsoleApp3/FileContentIndex/c7ba8a92-0130-42d3-a920-0fe299838c98.vsidx new file mode 100644 index 0000000..d3d1aaa Binary files /dev/null and b/.vs/ConsoleApp3/FileContentIndex/c7ba8a92-0130-42d3-a920-0fe299838c98.vsidx differ diff --git a/.vs/ConsoleApp3/FileContentIndex/read.lock b/.vs/ConsoleApp3/FileContentIndex/read.lock new file mode 100644 index 0000000..e69de29 diff --git a/Calibration Cube.stl b/Calibration Cube.stl new file mode 100644 index 0000000..0c45269 Binary files /dev/null and b/Calibration Cube.stl differ diff --git a/ConsoleApp3.sln b/ConsoleApp3.sln new file mode 100644 index 0000000..bc54269 --- /dev/null +++ b/ConsoleApp3.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp3", "ConsoleApp3\ConsoleApp3.csproj", "{66C6A0CC-DB6F-4457-BE38-C539BB053528}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {66C6A0CC-DB6F-4457-BE38-C539BB053528}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66C6A0CC-DB6F-4457-BE38-C539BB053528}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66C6A0CC-DB6F-4457-BE38-C539BB053528}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66C6A0CC-DB6F-4457-BE38-C539BB053528}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F63105BC-918C-4438-A47B-E5BA3B82499E} + EndGlobalSection +EndGlobal diff --git a/ConsoleApp3/App.config b/ConsoleApp3/App.config new file mode 100644 index 0000000..5754728 --- /dev/null +++ b/ConsoleApp3/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ConsoleApp3/ConsoleApp3.csproj b/ConsoleApp3/ConsoleApp3.csproj new file mode 100644 index 0000000..fa9323d --- /dev/null +++ b/ConsoleApp3/ConsoleApp3.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {66C6A0CC-DB6F-4457-BE38-C539BB053528} + Exe + ConsoleApp3 + ConsoleApp3 + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ConsoleApp3/Participante.cs b/ConsoleApp3/Participante.cs new file mode 100644 index 0000000..9fb6d9d --- /dev/null +++ b/ConsoleApp3/Participante.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp3 +{ + public class Participante + { + public string Nickname { get; set; } + public string Nome { get; set; } + public int Idade { get; set; } + public string Cpf { get; set; } + public string Endereco { get; set; } + public string Estado { get; set; } + public string Bairro { get; set; } + public string NomeResponsavel { get; set; } + public string CpfResponsavel { get; set; } + public int idadeResponsavel { get; set; } + } +} \ No newline at end of file diff --git a/ConsoleApp3/Program.cs b/ConsoleApp3/Program.cs new file mode 100644 index 0000000..5e0b14f --- /dev/null +++ b/ConsoleApp3/Program.cs @@ -0,0 +1,253 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.AccessControl; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp3 +{ + internal class Program + { + + static Participante[] listaParticipantes = { }; + static void Main(string[] args) + { + Menu(); + Console.ReadKey(); + } + + static void Menu() + { + int opcao; + Console.WriteLine("Bem vindo ao Diretório Participantes"); + Console.WriteLine("Selecione uma opção: \n"); + Console.WriteLine("1- Novo Cadastro"); + Console.WriteLine("2- Listar Cadastros"); + Console.WriteLine("3- Listar Cadastros com Responsavéis"); + Console.WriteLine("4- Consultar por ID"); + Console.WriteLine("5- Consultar por Nickname"); + Console.WriteLine("6- Sair"); + opcao = int.Parse(Console.ReadLine()); + + switch (opcao) + { + case 1: + { + NovoCadastro(); + break; + } + case 2: + { + ListarCadastros(); + break; + } + case 3: + { + ListarCadastrosComResponsaveis(); + break; + } + case 4: + { + EncontrarPorID(); + break; + } + case 5: + { + PesquisaNick(); + break; + } + case 6: + { + System.Environment.Exit(0); + break; + } + default: + { + Console.WriteLine("Opção Inválida!"); + Menu(); + break; + } + } + } + + static void NovoCadastro() + { + Participante novoParticipante = new Participante(); + + Console.WriteLine("\nOlá, seja bem vindo!\nAntes de iniciarmos o seu cadastro, como você gostaria de ser chamado?"); + novoParticipante.Nickname = Console.ReadLine(); + Console.WriteLine("Seja bem vindo, " + novoParticipante.Nickname + "\n"); + + Console.WriteLine(novoParticipante.Nickname + ", preencha os dados corretamente para validar sua inscrição."); + Console.WriteLine("\nNome Completo:"); + novoParticipante.Nome = Console.ReadLine(); + Console.WriteLine("\nQual é a sua idade?"); + novoParticipante.Idade = int.Parse(Console.ReadLine()); + + if (novoParticipante.Idade > 18) + { + Console.WriteLine("Você está elegivel para o cadastro, vamos continuar com o processo!\n"); + Console.WriteLine("Qual o seu CPF? (Digite apenas números, sem pontos e barra.)"); + novoParticipante.Cpf = Console.ReadLine(); + } + else + { + Console.WriteLine("\nPor ser menor de idade, é necessário o cadastro de um responsável por você.\n"); + Console.WriteLine("\nNome do Responsável:"); + novoParticipante.NomeResponsavel = Console.ReadLine(); + Console.WriteLine("\nIdade do Responsável:"); + novoParticipante.idadeResponsavel = int.Parse(Console.ReadLine()); + if (novoParticipante.idadeResponsavel < 18) + { + Console.WriteLine("\nInfelizmente, não podemos continuar devido ao seu responsável ser de menor.\n"); + Menu(); + } + else + { + Console.WriteLine("\nCPF do Resposável: (Digite apenas números, sem pontos e barra.)"); + novoParticipante.CpfResponsavel = Console.ReadLine(); + Console.WriteLine("\nTudo certo, agora vamos continuar com o seu cadastro.\n"); + } + } + + Console.WriteLine("\nVamos agora conferir o local onde você mora!"); + Console.WriteLine("Qual é o seu endereço?"); + novoParticipante.Endereco = Console.ReadLine(); + Console.WriteLine("Digite seu Bairro:"); + novoParticipante.Bairro = Console.ReadLine(); + Console.WriteLine("Digite seu Estado:"); + novoParticipante.Estado = Console.ReadLine(); + + Console.WriteLine("\nMuito bem, vamos agora conferir os seus dados!"); + Console.WriteLine("Nickname: " + novoParticipante.Nickname); + Console.WriteLine("Nome Completo: " + novoParticipante.Nome); + Console.WriteLine("Idade: " + novoParticipante.Idade); + if (novoParticipante.Idade < 18) + { + Console.WriteLine("Nome do Responsável: " + novoParticipante.NomeResponsavel); + Console.WriteLine("Idade do Responsável: " + novoParticipante.idadeResponsavel); + Console.WriteLine("CPF do Responsável: " + novoParticipante.CpfResponsavel); + } + Console.WriteLine("Endereço: " + novoParticipante.Endereco); + Console.WriteLine("Bairro: " + novoParticipante.Bairro); + Console.WriteLine("Estado: " + novoParticipante.Estado); + + Console.WriteLine("Confirma que os dados estão corretos? S / N"); + + bool confirma = (string.Equals(Console.ReadLine(), "s", StringComparison.OrdinalIgnoreCase) ? true : false); + if (confirma) + { + listaParticipantes = listaParticipantes.Append(novoParticipante).ToArray(); + Console.WriteLine(""); + Menu(); + } + else + { + NovoCadastro(); + } + } + + static void ListarCadastros() + { + foreach (Participante participante in listaParticipantes) + { + Console.WriteLine("ID: " + Array.IndexOf(listaParticipantes, participante)); + Console.WriteLine("Nickname: " + participante.Nickname); + Console.WriteLine("Nome Completo: " + participante.Nome); + Console.WriteLine("Idade: " + participante.Idade); + Console.WriteLine("Endereço: " + participante.Endereco); + Console.WriteLine("Bairro: " + participante.Bairro); + Console.WriteLine("Estado: " + participante.Estado); + Console.WriteLine(""); + } + + if (listaParticipantes.Length < 1) + { + Console.WriteLine("\nLista vazia."); + } + + Console.WriteLine(""); + Menu(); + } + + static void ListarCadastrosComResponsaveis() + { + foreach (Participante participante in listaParticipantes.Where(p => !(p.NomeResponsavel is null)).ToArray()) + { + Console.WriteLine("ID: " + Array.IndexOf(listaParticipantes, participante)); + Console.WriteLine("Nickname: " + participante.Nickname); + Console.WriteLine("Nome Completo: " + participante.Nome); + Console.WriteLine("Idade: " + participante.Idade); + Console.WriteLine("Endereço: " + participante.Endereco); + Console.WriteLine("Bairro: " + participante.Bairro); + Console.WriteLine("Estado: " + participante.Estado); + Console.WriteLine("Nome do Responsável: " + participante.NomeResponsavel); + Console.WriteLine("Idade do Responsável: " + participante.idadeResponsavel); + Console.WriteLine("CPF do Responsável: " + participante.CpfResponsavel); + Console.WriteLine(""); + } + + if (listaParticipantes.Length < 1) + { + Console.WriteLine("\nLista vazia."); + } + + Console.WriteLine(""); + Menu(); + } + + static void EncontrarPorID() + { + foreach (Participante participante in listaParticipantes) + { + Console.WriteLine("ID: " + Array.IndexOf(listaParticipantes, participante)); + Console.WriteLine("Nickname: " + participante.Nickname); + Console.WriteLine(""); + } + + Console.WriteLine("Qual ID você deseja consultar?"); + int id = int.Parse(Console.ReadLine()); + Console.WriteLine("Nickname: " + listaParticipantes[id].Nickname); + Console.WriteLine("Nome Completo: " + listaParticipantes[id].Nome); + Console.WriteLine("Idade: " + listaParticipantes[id].Idade); + Console.WriteLine("Endereço: " + listaParticipantes[id].Endereco); + Console.WriteLine("Bairro: " + listaParticipantes[id].Bairro); + Console.WriteLine("Estado: " + listaParticipantes[id].Estado); + Console.WriteLine(""); + + if (listaParticipantes.Length < 1) + { + Console.WriteLine("\nLista vazia."); + } + + Console.WriteLine(""); + Menu(); + } + + static void PesquisaNick() + { + Console.WriteLine("Qual nickname você gostaria de consultar?"); + var pesquisa = Console.ReadLine(); + var resultados = listaParticipantes.Where(p => string.Equals(pesquisa, p.Nickname, StringComparison.OrdinalIgnoreCase)).ToArray(); + foreach (Participante participante in resultados) + { + Console.WriteLine("Nickname: " + participante.Nickname); + Console.WriteLine("Nome Completo: " + participante.Nome); + Console.WriteLine("Idade: " + participante.Idade); + Console.WriteLine("Endereço: " + participante.Endereco); + Console.WriteLine("Bairro: " + participante.Bairro); + Console.WriteLine("Estado: " + participante.Estado); + Console.WriteLine(""); + } + + if (resultados.Length < 1) + { + Console.WriteLine("\nResultado não encontrado."); + } + + Console.WriteLine(""); + Menu(); + } + } +} diff --git a/ConsoleApp3/Properties/AssemblyInfo.cs b/ConsoleApp3/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..952f945 --- /dev/null +++ b/ConsoleApp3/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// As informações gerais sobre um assembly são controladas por +// conjunto de atributos. Altere estes valores de atributo para modificar as informações +// associadas a um assembly. +[assembly: AssemblyTitle("ConsoleApp3")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ConsoleApp3")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Definir ComVisible como false torna os tipos neste assembly invisíveis +// para componentes COM. Caso precise acessar um tipo neste assembly de +// COM, defina o atributo ComVisible como true nesse tipo. +[assembly: ComVisible(false)] + +// O GUID a seguir será destinado à ID de typelib se este projeto for exposto para COM +[assembly: Guid("66c6a0cc-db6f-4457-be38-c539bb053528")] + +// As informações da versão de um assembly consistem nos quatro valores a seguir: +// +// Versão Principal +// Versão Secundária +// Número da Versão +// Revisão +// +// É possível especificar todos os valores ou usar como padrão os Números de Build e da Revisão +// usando o "*" como mostrado abaixo: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")]