This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Programa Calculadora Abordagem ou Paradigma Estruturado | |
void main() { | |
//Entrada | |
int numero1=1; | |
int numero2=2; | |
//Processamento | |
int resultado = numero1+numero2; | |
//Saida |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// lista01pag01prog01 | |
void main() { | |
//Entrada | |
int a = 11; | |
int b = 2; | |
//Solucao | |
int maior; | |
if (a > b) { | |
maior = a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// lista01pag04prog06a | |
void main() { | |
//Entrada | |
int inicio = 1; | |
int fim = 5; | |
//Solucao | |
for (var i = inicio; i <= fim; i++) { | |
print('$i'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Funcao que calcula a soma | |
int soma(int num1, int num2) { | |
return num1 + num2; | |
} | |
/// Programa Calculadora Abordagem ou Paradigma Procedural | |
void main() { | |
//Entrada | |
int numero1 = 1; | |
int numero2 = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Classe que define uma calculadora. | |
class Calculadora { | |
final int numero1; | |
final int numero2; | |
Calculadora(this.numero1, this.numero2); | |
/// Funcao que calcula a soma | |
int soma() { | |
return numero1 + numero2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Produto { | |
String nome; | |
Produto(this.nome); | |
static int visto = 0; | |
@override | |
String toString() { | |
return 'Produto $nome Visto: $visto'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Animal { | |
String nome; | |
Animal(this.nome); | |
String voz(); | |
@override | |
String toString() { | |
return '$nome ${voz()}'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pessoa { | |
String nome; | |
Pessoa(this.nome); | |
String mostrar() { | |
return '$nome'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mamifero { | |
String mover(){return '';} | |
} | |
class Macaco extends Mamifero { | |
@override | |
String mover() { | |
return 'pulando'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
// Para outras funções do math veja neste link: | |
// https://api.dart.dev/stable/2.10.5/dart-math/dart-math-library.html | |
void main() { | |
print('raiz quadrada: ${sqrt(9)}'); | |
print('ln: ${log(10)}'); | |
print('potência: ${pow(2,3)}'); | |
} |
OlderNewer