Skip to content

Instantly share code, notes, and snippets.

@bhflm
Created October 29, 2018 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhflm/7eee6ef7980c013d716daa847f1fe21b to your computer and use it in GitHub Desktop.
Save bhflm/7eee6ef7980c013d716daa847f1fe21b to your computer and use it in GitHub Desktop.
ejemplo 1
pragma solidity ^0.4.25;
contract Ejemplo1{
uint256 notaFinal;
constructor(){}
function calcularNotaFinal(uint256 notaContenido, uint256 notaGrupal, uint256 notaIndividual) public{
notaFinal = ((notaContenido*70) + (notaGrupal * 20) + (notaIndividual * 10))/100;
}
function obtenerNotaFinal() public view returns(uint256){
return notaFinal;
}
}
[
{
"constant": false,
"inputs": [
{
"name": "notaContenido",
"type": "uint256"
},
{
"name": "notaGrupal",
"type": "uint256"
},
{
"name": "notaIndividual",
"type": "uint256"
}
],
"name": "calcularNotaFinal",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": true,
"inputs": [],
"name": "obtenerNotaFinal",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment