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

CONCLUSÃO PROJETO #124

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
12 changes: 11 additions & 1 deletion Models/Iphone.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
namespace DesafioPOO.Models
{
public class Iphone : Smartphone
{
public Iphone(string numero, string modelo, string imei, int memoria) : base(numero, modelo, imei, memoria)
{

}

// TODO: Herdar da classe "Smartphone"
public class Iphone
public override void InstalarAplicativo(string nome)
{
Console.WriteLine($"Instalando {nome} no Iphone.");
// TODO: Sobrescrever o método "InstalarAplicativo"
}
}

}
13 changes: 12 additions & 1 deletion Models/Nokia.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
using System.ComponentModel;
using System.Security.Cryptography.X509Certificates;
namespace DesafioPOO.Models
{


public class Nokia : Smartphone
{
// TODO: Herdar da classe "Smartphone"
public class Nokia
public Nokia(string numero, string modelo, string imei, int memoria) : base(numero, modelo, imei, memoria)
{
}
public override void InstalarAplicativo(string nome)
{
Console.WriteLine($"Instalando {nome} no Nokia.");
}
// TODO: Sobrescrever o método "InstalarAplicativo"
}
}
10 changes: 9 additions & 1 deletion Models/Smartphone.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
using System.Dynamic;

namespace DesafioPOO.Models
{
public abstract class Smartphone
{
public string Numero { get; set; }
private string Modelo { get; set;}
private string IMEI {get; set;}
private int Memoria {get; set;}
// TODO: Implementar as propriedades faltantes de acordo com o diagrama

public Smartphone(string numero)
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
17 changes: 17 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
using DesafioPOO.Models;

public class Program
{
public static void Main(string[] args)
{
// Criando um objeto do tipo Nokia
Nokia nokia = new Nokia("123456789", "Nokia 3310", "123456789IMEI", 64);
nokia.Ligar();
nokia.ReceberLigacao();
nokia.InstalarAplicativo("WhatsApp");

// Criando um objeto do tipo Iphone
Iphone iphone = new Iphone("987654321", "iPhone X", "987654321IMEI", 128);
iphone.Ligar();
iphone.ReceberLigacao();
iphone.InstalarAplicativo("Instagram");
}
}
// TODO: Realizar os testes com as classes Nokia e Iphone
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", "{78FB3313-EDD8-424A-ACC9-18815D78749D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{78FB3313-EDD8-424A-ACC9-18815D78749D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78FB3313-EDD8-424A-ACC9-18815D78749D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78FB3313-EDD8-424A-ACC9-18815D78749D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78FB3313-EDD8-424A-ACC9-18815D78749D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3090D4C-6C20-427A-B542-D09C14421325}
EndGlobalSection
EndGlobal