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

Desafio Concluido !!!! #231

Open
wants to merge 1 commit 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
Binary file added .vs/DesafioFundamentos/v17/.suo
Binary file not shown.
41 changes: 41 additions & 0 deletions .vs/DesafioFundamentos/v17/DocumentLayout.backup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"Version": 1,
"WorkspaceRootPath": "D:\\Desafio\\trilha-net-fundamentos-desafio-main\\DesafioFundamentos\\Models\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{57628CBF-3ED7-4BB3-A3A6-48F7A25172BD}|DesafioFundamentos.csproj|d:\\desafio\\trilha-net-fundamentos-desafio-main\\desafiofundamentos\\models\\estacionamento.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{57628CBF-3ED7-4BB3-A3A6-48F7A25172BD}|DesafioFundamentos.csproj|solutionrelative:estacionamento.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Estacionamento.cs",
"DocumentMoniker": "D:\\Desafio\\trilha-net-fundamentos-desafio-main\\DesafioFundamentos\\Models\\Estacionamento.cs",
"RelativeDocumentMoniker": "Estacionamento.cs",
"ToolTip": "D:\\Desafio\\trilha-net-fundamentos-desafio-main\\DesafioFundamentos\\Models\\Estacionamento.cs",
"RelativeToolTip": "Estacionamento.cs",
"ViewState": "AgIAAAkAAAAAAAAAAAAAACAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-15T02:41:53.321Z",
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
}
]
}
]
}
]
}
41 changes: 41 additions & 0 deletions .vs/DesafioFundamentos/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"Version": 1,
"WorkspaceRootPath": "D:\\Desafio\\trilha-net-fundamentos-desafio-main\\DesafioFundamentos\\Models\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{57628CBF-3ED7-4BB3-A3A6-48F7A25172BD}|DesafioFundamentos.csproj|d:\\desafio\\trilha-net-fundamentos-desafio-main\\desafiofundamentos\\models\\estacionamento.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{57628CBF-3ED7-4BB3-A3A6-48F7A25172BD}|DesafioFundamentos.csproj|solutionrelative:estacionamento.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Estacionamento.cs",
"DocumentMoniker": "D:\\Desafio\\trilha-net-fundamentos-desafio-main\\DesafioFundamentos\\Models\\Estacionamento.cs",
"RelativeDocumentMoniker": "Estacionamento.cs",
"ToolTip": "D:\\Desafio\\trilha-net-fundamentos-desafio-main\\DesafioFundamentos\\Models\\Estacionamento.cs",
"RelativeToolTip": "Estacionamento.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAB0AAAApAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-15T02:41:53.321Z",
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
}
]
}
]
}
]
}
25 changes: 25 additions & 0 deletions DesafioFundamentos.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.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesafioFundamentos", "..\DesafioFundamentos.csproj", "{57628CBF-3ED7-4BB3-A3A6-48F7A25172BD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{57628CBF-3ED7-4BB3-A3A6-48F7A25172BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57628CBF-3ED7-4BB3-A3A6-48F7A25172BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57628CBF-3ED7-4BB3-A3A6-48F7A25172BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57628CBF-3ED7-4BB3-A3A6-48F7A25172BD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2E376619-8B55-45FD-A222-9B229575BA94}
EndGlobalSection
EndGlobal
77 changes: 77 additions & 0 deletions Estacionamento.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
namespace DesafioFundamentos.Models
{
public class Estacionamento
{
private decimal precoInicial = 0;
private decimal precoPorHora = 0;
private List<string> veiculos = new List<string>();

public Estacionamento(decimal precoInicial, decimal precoPorHora)
{
this.precoInicial = precoInicial;
this.precoPorHora = precoPorHora;
}

public void AdicionarVeiculo()
{
// Imprementado com sucesso!!

Console.WriteLine("Digite a placa do veículo para estacionar:");
string placa = Console.ReadLine();
veiculos.Add(placa.ToUpper());
Console.WriteLine($"Verificar a placa {placa} do veículo estacionado.");

}

public void RemoverVeiculo()
{
Console.WriteLine("Digite a placa do veículo para remover:");

// Imprementado com sucesso!!

string placa = Console.ReadLine();

// Verifica se o veículo existe
if (veiculos.Any(x => x.ToUpper() == placa.ToUpper()))
{
Console.WriteLine("Digite a quantidade de horas que o veículo permaneceu estacionado:");

// Imprementado com sucesso!!

int horas = int.Parse(Console.ReadLine());
decimal valorTotal = precoInicial + precoPorHora * horas;

// Imprementado com sucesso!!

veiculos.Remove(placa.ToUpper());

Console.WriteLine($"O veículo {placa} foi removido e o preço total foi de: R$ {valorTotal}");
}
else
{
Console.WriteLine("Desculpe, esse veículo não está estacionado aqui. Confira se digitou a placa corretamente");
}
}

public void ListarVeiculos()
{
// Verifica se há veículos no estacionamento
if (veiculos.Any())
{
Console.WriteLine("Os veículos estacionados são:");

// Imprementado com sucesso!!

foreach (var veiculo in veiculos)
{
Console.WriteLine(veiculo.ToUpper());
}

}
else
{
Console.WriteLine("Não há veículos estacionados.");
}
}
}
}