Created
October 29, 2018 23:49
-
-
Save bhflm/7eee6ef7980c013d716daa847f1fe21b to your computer and use it in GitHub Desktop.
ejemplo 1
This file contains hidden or 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
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