Good Monday everyone!
This time we will not disturb our accountant from previous challenges. This Challenge will mainly prove your skills with json and some basic math! Strain your brain!
Goal of the challenge
Calculate return of investments of certain amount of $ to Bitcoins. Imagine you bought some amount of Bitcoins, at some date in past, and you would like to know, how much would you get back if you sell your Bitcoins today. (Let’s ignore transaction fees, taxes etc.)
Input data
Robot should prompt for two inputs: (use Input Dialog)
- Amount of USD that has been invested.
- Date of investment.
Outputs
We want to output the value in $ that we would get today if we sell our bitcoin bought in the past. Use Message box.
So:
Where to get the data
You are free to source the value of Bitcoin from anywhere, however the easiest way is to use advantage of Bitcoin Price Index API that generates values we need in a structured json format.
Study how it works here.
If you are in doubts… click below…
Show hints
To get the current price:
https://api.coindesk.com/v1/bpi/currentprice.json
To get BPI (in USD) for the investment day:
https://api.coindesk.com/v1/bpi/historical/close.json?start=2020-03-05&end=2020-03-05
Challenge difficulty: medium
How to participate
When you are happy with your robot:
- post output file here
- send .xaml file as a private message directly to me (click my profile picture → Message)
First three correct, original solvers earn 3 robopoints, next get 1 robopoint.
I will hold a leaderboard with your score and update it. Those on top positions will be badged by a special challenger badge
Challenge deadline is 11.4. by the end of the day. You can still submit your projects after the deadline but you cannot earn robopoints. New challenge is published every week or 2 weeks so don’t worry if you did not catch this one. Keep in mind, your submitted files may be published after the deadline so others can learn from solutions.
PS: Are you having a specific issue in your other projects? Do not hesitate to Ask in our Ask category!