Breaking News

5b bitcoin tracker

So this video is a more advanced program with all the concepts that we've learned so far: variables, user input, concatenation and feeding back to the user different outputs depending on the inputs It's not my intention to teach you how to make this program, I would just want to see if you can follow the logic based on what you've learnt so that you can get some ideas on some more advanced programs that are going to be age-appropriate for your students

So I've written this program just to show some regret that I didn't buy Bitcoin when I first heard about it So I've got this chart and it shows a tracking here of the cost of Bitcoin at the crazy peak announced down to 5,000 and starts here at $450 in 2015 However, my regret is that my friend Aaron said to me in about 2010, "Hey here's this new thing, 'Bitcoin', we should buy some, it's only eight cents!" Let's just say I put $100 on it back there, let's track through the program and see what would have happened So I would have bought $100 because I'm fairly risk adverse and it was eight cents, forgetting brokerage, so I would have had 1,250 bitcoins So what was it worth when I sold it? Well, just for the sake of a good story, let's just say somehow I knew when the top was well 25,000 let's say it's worth 25 because we all know when the top of the market is so I can't even fathom how much that is so that's the program run

Now, it could have gone the other way of course So let's run it again and let's say we bought it at the peak So let's say I put $25,000 on the line it was worth 25,000 so I've got one Bitcoin and I had to sell up now for 5,000 and it would have lost $20,000 So let's have a look at the logic here Now this looks like a lot

All this is over here is declaring the variables and setting them to zero so that when I click on the green flag I haven't got the values from last time So they're all empty So let's break this apart and look at the logic So let's just start here So how many dollars worth of Bitcoin did you buy? So we've got this variable called 'dollar start', which is the user input and let's say 100 so that's stored in that variable

The next part says let's just run through it so $100 worth and what was it worth so for my story I'm gonna say 08 and we can see here we have this variable called 'how many bitcoins', which is simply how many dollars divided by the cost of Bitcoin Then you can just respond with the concatenation of the text and the value of that variable, okay then there's a little pause in the program for the next part So let's just run this again, five hundred dollars worth 008 so would have had 1250 and what was it worth when I sold it – it could be varying amounts e

g it could be the five hundred dollars back in 2015 So we've got the user input of 500 and then we've got this concatenation here to tell the user how much did they have at this point and at the end we're saying you would have had $625,000 and then the last part is just working out the profit or loss so we've got this profit or loss variable and it's simply the 'dollars finish' deducted from the 'dollars at the start', so if profit or loss is bigger than zero then you made money, otherwise if it's less then you lost money So we haven't got into branching a lot yet – branching is coming up However I'm sure you can follow this: that if the money at the end is more than zero then run this block of code otherwise, if the money at the end is are less than zero you run this block of code

Okay so let's run it again So let's say I had five thousand dollars worth/ they were worth about $5,000 and let's just say now again it's worth $5,000 Again, this video wasn't designed to teach you how to make this program, I'm just giving you the mindset of all this work we're doing with concatenating and variables and having to convert integers and words not so much in Scratch but if we made this in Python we would have to do that and I just wanted to give you a more advanced application that we can do with these ideas, so that you can think about something that you can make Make it in Scratch first by all means and then try and make it in Python and make it in a Java Script and obviously the smaller the better to start with The more that you can practice as a teacher the better outcome for your students, or when you have to a debug something for your students the more experience you will have and the easier you can find that error