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

Projeto concluido #143

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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

*.sln
# User-specific files
*.rsuser
*.suo
Expand Down
2 changes: 1 addition & 1 deletion DesafioPOO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>
Expand Down
9 changes: 8 additions & 1 deletion Models/Iphone.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
namespace DesafioPOO.Models
{
// TODO: Herdar da classe "Smartphone"
public class Iphone
public class Iphone : Smartphone
{
public Iphone(string numero, string modelo, string imei,int memoria): base(numero,modelo,imei,memoria)
{
// TODO: Passar os parâmetros do construtor para as propriedades
}
// TODO: Sobrescrever o método "InstalarAplicativo"
public override void InstalarAplicativo(string nomeApp){
Console.WriteLine($"{nomeApp} instalado no Iphone");
}
}
}
9 changes: 8 additions & 1 deletion Models/Nokia.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
namespace DesafioPOO.Models
{
// TODO: Herdar da classe "Smartphone"
public class Nokia
public class Nokia: Smartphone
{
public Nokia(string numero, string modelo, string imei,int memoria): base(numero,modelo,imei,memoria)
{

}
// TODO: Sobrescrever o método "InstalarAplicativo"
public override void InstalarAplicativo(string nomeApp){
Console.WriteLine($"{nomeApp} instalado no Nokia");
}
}
}
10 changes: 8 additions & 2 deletions Models/Smartphone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ public abstract class Smartphone
{
public string Numero { get; set; }
// TODO: Implementar as propriedades faltantes de acordo com o diagrama

public Smartphone(string numero)
private string Modelo ;
private string IMEI;
private int Memoria;

public Smartphone(string numero, string modelo, string imei,int memoria)
{
Numero = numero;
Modelo= modelo;
IMEI= imei;
Memoria= memoria;
// TODO: Passar os parâmetros do construtor para as propriedades
}

Expand Down
15 changes: 14 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
using DesafioPOO.Models;

// TODO: Realizar os testes com as classes Nokia e Iphone
// TODO: Realizar os testes com as classes Nokia e Iphone

Smartphone nokia=new Nokia("123","1","2",4);

Smartphone iphone=new Iphone("321","412323","34545",4);

nokia.InstalarAplicativo("Whatsapp");
nokia.Ligar();
nokia.ReceberLigacao();


iphone.InstalarAplicativo("Whatsapp");
iphone.Ligar();
iphone.ReceberLigacao();
25 changes: 25 additions & 0 deletions trilha-net-poo-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}") = "DesafioPOO", "DesafioPOO.csproj", "{E4C4E06B-D99D-41E3-8D2C-0FD412668CFF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E4C4E06B-D99D-41E3-8D2C-0FD412668CFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E4C4E06B-D99D-41E3-8D2C-0FD412668CFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4C4E06B-D99D-41E3-8D2C-0FD412668CFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4C4E06B-D99D-41E3-8D2C-0FD412668CFF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8F8D012F-D8FD-4E3C-846C-FA4CD3793144}
EndGlobalSection
EndGlobal