How to Generate a Random Number / Dollar Amount (w videos)

blockeditor
donation
randomnumber
tutorial
beginner

#1

I’m combining two tutorials in this post so that whether you are a beginner or an advanced coder this is a great coding challenge for you.


Beginner Challenge :angel:

Generate a Random Number

Generating a random number is used in coding more often than you would think. Because of this, it is actually a lot easier than you would think!

The challenge is to have the user enter a number and then have the app generate a random number between 1 and the number the user entered.

Tutorial

Blocks


Advanced Challenge :muscle:

Generate a Random Dollar Amount

This challenge takes the concept of generating a random number a bit further by adding some additional formatting to the random number.

The challenge is to generate a random dollar amount (ie. $43.96) every time a button is clicked.

Tutorial

Blocks

After watching the tutorial, I thought of a simpler way to block this challenge out :blush:


Happy Coding!