Skip to content
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
2 changes: 0 additions & 2 deletions modulo3/projeto-labex/projeto-labex/src/App.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from "react";
import { Router } from "./Routes/Router";
// import ApplicationFormPage from "./Pages/ApplicationFormPage";


const App =()=> {
return (
<div>
<Router/>
{/* <ApplicationFormPage/> */}
</div>
);
}
Expand Down
1 change: 1 addition & 0 deletions modulo4/intro-typescript/template-typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
35 changes: 35 additions & 0 deletions modulo4/intro-typescript/template-typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions modulo4/intro-typescript/template-typescript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "introducao-typescript",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {

"start": "clear && tsc && node ./build/index.js",
"exercicio1":"clear && tsc && node ./build/exercicio1.js",
"exercicio2":"clear && tsc && node ./build/exercicio2.js",
"exercicio3":"clear && tsc && node ./build/exercicio3.js",
"exercicio4":"clear && tsc && node ./build/exercicio4.js",
"exercicio5":"clear && tsc && node ./build/exercicio5.js"

},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"typescript": "^4.5.4"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function checaTriangulo(a:number, b:number, c:number) {
if (a !== b && b !== c) {
return "Escaleno";
} else if (a === b && b === c) {
return "Equilátero";
} else {
return "Isósceles";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function imprimeTresCoresFavoritas(cor1:string, cor2:string, cor3:string): Array <string> {
return[cor1, cor2, cor3]
}
console.log(imprimeTresCoresFavoritas("Laranja","Amarelo", "Azul" ));

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function checaAnoBissexto(ano:number) {
const cond1 = ano % 400 === 0
const cond2 = (ano % 4 === 0) && (ano % 100 !== 0)
return cond1 || cond2
}
16 changes: 16 additions & 0 deletions modulo4/intro-typescript/template-typescript/src/exercicio4.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function comparaDoisNumeros(num1:number, num2:number) {
let maiorNumero:number
let menorNumero:number

if (num1 > num2) {
maiorNumero = num1;
menorNumero = num2;
} else {
maiorNumero = num2;
menorNumero = num1;
}

const diferenca = maiorNumero - menorNumero;

return diferenca
}
2 changes: 2 additions & 0 deletions modulo4/intro-typescript/template-typescript/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//escreva o seu código aqui

11 changes: 11 additions & 0 deletions modulo4/intro-typescript/template-typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "es6", /* Specify ECMAScript target version */
"module": "commonjs", /* Specify module code generation */
"sourceMap": true, /* Generates corresponding '.map' file. */
"outDir": "./build", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. */
"removeComments": true, /* Do not emit comments to output. */
"noImplicitAny": true /* Raise error on declarations with an implied 'any' type. */
}
}