Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. pragma solidity ^0.4.24;
  2.  
  3. contract Arithmetic{
  4. uint256 public storedValue; //256 bits unsigned integer
  5. // Constructor function. Runs once when the contract is deployed
  6. // Add any initialization operations here.
  7.  
  8. constructor() public{
  9. storedValue = 100;
  10. }
  11.  
  12. function add(uint256 number) public {
  13. storedValue = storedValue + number;
  14. }
  15.  
  16. function subtract(uint256 number) public {
  17. storedValue = storedValue - number;
  18. }
  19.  
  20. function multiplication(uint256 number) public {
  21. storedValue = storedValue * number;
  22. }
  23.  
  24. function division(uint256 number) public {
  25. storedValue = storedValue / number;
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement