Solidity-A001 Variables


pragma solidity >= 0.7.0 < 0.9.0

//Variables:Variables are used to store information to be referenced and mutipule in a conputer program.

//pseudo code example code example of staring information into variables.
//store-owner = 300 - integer
//chocolate-bar = 30 -integer
//totalValue = store-owner + chocolate-bar = 310
//totalValue = 310 -integer

//learning variables and types
//three main types of variables: Booleans, Integers, Strings.

//lieDetector = boolearn to check wheterher what they say is true or false.
//walletAmount = integer that would hold the amount.
//erroMessageText = string that would say 'Error! There has been a mistake :C"

contract learnVariables{
    //all our solidity code goes here
    unit chocolateBar = 10;
    unit storeOwner = 300;
    bool lieDetecotr = true;
    string errorMessageText = "Error! There has been a mistake :C";
    
    unit wallet = 500;
    bool spend = false;
    string notifySpend = "you have to spend money";

}

//exercise: 1 create a new variable called wallet as an integer.
//          2 create a boolearn called spend
//          3 create a string give it the name notifyspend.
//          4 initialize the wallet to 500.
//          5 set the value of spend to false.
//          6 add the string listral (the sring value)'you have spent money' to notifyspend.

  • 17
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值