From 40869a84ab1d12ec6ecffa39bd546c14cb660dee Mon Sep 17 00:00:00 2001 From: ConanGoodwin Date: Wed, 11 Jan 2023 18:31:29 -0300 Subject: [PATCH 1/2] inicio do conteudo 001 --- Md03_Dev_Back_end/Bloco26/26.1/conteudo001.ts | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Md03_Dev_Back_end/Bloco26/26.1/conteudo001.ts diff --git a/Md03_Dev_Back_end/Bloco26/26.1/conteudo001.ts b/Md03_Dev_Back_end/Bloco26/26.1/conteudo001.ts new file mode 100644 index 00000000..d0fd5847 --- /dev/null +++ b/Md03_Dev_Back_end/Bloco26/26.1/conteudo001.ts @@ -0,0 +1,33 @@ +class Person { + name: string; + height: number; + weight: number; + + constructor(n: string, h: number, w: number) { + console.log(`Creating person ${n}`); + this.name = n; + this.height = h; + this.weight = w; + } + + sleep() { + console.log(`${this.name}: zzzzzzz`); + } +} + +const p1 = new Person('Maria', 171, 58); +const p2 = new Person('João', 175, 66); +console.log(p1.name, p1.height, p1.weight); +console.log(p2.name, p2.height, p2.weight); +p1.sleep(); +p2.sleep(); + +/* +Saída: +Creating person Maria +Creating person João +Maria 171 58 +João 175 66 +Maria: zzzzzzz +João: zzzzzzz +*/ \ No newline at end of file From 9ace235187f8ac7a6a5b1f3ddb8e5f9d0b51067d Mon Sep 17 00:00:00 2001 From: ConanGoodwin Date: Thu, 12 Jan 2023 13:01:07 -0300 Subject: [PATCH 2/2] conteudo 002 --- Md03_Dev_Back_end/Bloco26/26.1/conteudo002.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Md03_Dev_Back_end/Bloco26/26.1/conteudo002.ts diff --git a/Md03_Dev_Back_end/Bloco26/26.1/conteudo002.ts b/Md03_Dev_Back_end/Bloco26/26.1/conteudo002.ts new file mode 100644 index 00000000..ca518491 --- /dev/null +++ b/Md03_Dev_Back_end/Bloco26/26.1/conteudo002.ts @@ -0,0 +1,22 @@ +class Tv { + private brand: string; + private size: number; + private resolution: number; + private connections: string; + private connectedTo?: boolean; + + constructor(brand: string, size: number, resolution: number, connections: string) { + this.brand = brand; + this.size = size; + this.resolution= resolution; + this.connections = connections; + } + + public turnOn() { + return `brand: ${this.brand}, size: ${this.size}, resolution: ${this.resolution}, connections: ${this.connections}` + } +} + +const minhaTv = new Tv('mike', 10, 140, 'sóuma'); + +console.log(minhaTv.turnOn());