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
//exemplo 1 | |
let quantidadeMesJaneiro = 130; | |
let quantidadeMesFevereiro = 115; | |
let totalBimestre = quantidadeMesJaneiro + quantidadeMesFevereiro; | |
//exemplo 2 | |
let valorUnitario = 450; | |
let quantidade = 7; | |
let valorTotal = valorUnitario * quantidade; |
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
int quantidade = 20; | |
string nome = "antonio"; | |
decimal salario = 1400.50m; | |
bool ativo = true; |
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
let idade = 10; | |
let nome = "antonio"; | |
let salario = 1400.50; | |
let ativo = true; |
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
string ObterNomeCliente() | |
{ | |
string nomeCliente = "James Hetfield"; | |
return nomeCliente; | |
} |
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
function ObterNomeCliente() | |
{ | |
let nomeCliente = "James Hetfield"; | |
return nomeCliente; | |
} |
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
def ObterNomeCliente(): | |
nomeCliente = "James Hetfield" | |
return nomeCliente |
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
func ObterNomeCliente() string | |
{ | |
nomeCliente := "James Hetfield" | |
return nomeCliente | |
} |
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
//retorna alguma informação do tipo inteiro. | |
int ObterQuantidadeComprada(int codigoPedido) | |
{ | |
//... | |
return 4; | |
} | |
//não retorna valor. | |
void ExecutaCompra(int codigoPedido) | |
{ |
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
//não há uma palavra chave na assinatura que indica se irá retornar valor ou não. | |
function ObterQuantidadeComprada(codigoPedido) | |
{ | |
//... | |
return 4; | |
} | |
//não retorna valor. | |
function ExecutaCompra(codigoPedido) | |
{ |
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
int codigoPedido = 5; | |
//métodos mudos não retornam valor, apenas realizamos a chamada. | |
ExecutaCompra(codigoPedido); | |
//podemos usar variáveis para armazenar o valor de retorno de um método. | |
int qtdeComprada = ObterQuantidadeComprada(codigoPedido); |
OlderNewer