Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fernando Lima DEVFAL #225

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions DesafioFundamentos/Models/Estacionamento.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public void AdicionarVeiculo()
// TODO: Pedir para o usuário digitar uma placa (ReadLine) e adicionar na lista "veiculos"
// *IMPLEMENTE AQUI*
Console.WriteLine("Digite a placa do veículo para estacionar:");
string veiculoAdicionado = Console.ReadLine();
veiculos.Add(veiculoAdicionado);
}

public void RemoverVeiculo()
Expand All @@ -26,6 +28,7 @@ public void RemoverVeiculo()
// Pedir para o usuário digitar a placa e armazenar na variável placa
// *IMPLEMENTE AQUI*
string placa = "";
placa = Console.ReadLine();

// Verifica se o veículo existe
if (veiculos.Any(x => x.ToUpper() == placa.ToUpper()))
Expand All @@ -38,8 +41,12 @@ public void RemoverVeiculo()
int horas = 0;
decimal valorTotal = 0;

horas = Convert.ToInt32(Console.ReadLine());
valorTotal = precoInicial + precoPorHora * horas;

// TODO: Remover a placa digitada da lista de veículos
// *IMPLEMENTE AQUI*
veiculos.Remove(placa);

Console.WriteLine($"O veículo {placa} foi removido e o preço total foi de: R$ {valorTotal}");
}
Expand All @@ -57,6 +64,10 @@ public void ListarVeiculos()
Console.WriteLine("Os veículos estacionados são:");
// TODO: Realizar um laço de repetição, exibindo os veículos estacionados
// *IMPLEMENTE AQUI*
foreach (var veiculo in veiculos)
{
Console.WriteLine(veiculo);
}
}
else
{
Expand Down
25 changes: 25 additions & 0 deletions trilha-net-fundamentos-desafio.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesafioFundamentos", "DesafioFundamentos\DesafioFundamentos.csproj", "{D5732BC8-B46B-43C0-B908-7BB55DF4E5D6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D5732BC8-B46B-43C0-B908-7BB55DF4E5D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D5732BC8-B46B-43C0-B908-7BB55DF4E5D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5732BC8-B46B-43C0-B908-7BB55DF4E5D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5732BC8-B46B-43C0-B908-7BB55DF4E5D6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {22DE2CEA-2549-4620-8D68-11E238DBAC75}
EndGlobalSection
EndGlobal