Could You Code?

Test your aptitude for programming with the Blockly tool below

A car factory offers Luxury sedans and Budget three-wheelers, making 50 Luxury and 100 Budget cars per month. Construct a function that returns the yearly cost of wheels for the factory, if a Luxury wheel costs 500 units, and a Budget wheel costs 100.

For inspiration, take a look at an example, and for help click the ? icon.

 
1
Start by creating a function "to do something" and return the result, by dragging it from the Functions menu.
2
Drag the "do something" bar from the Functions menu, to actually execute the function. Leave the bar unconnected.
3
Using other Code Blocks and Variables, construct the function to perform the required calculations.
4
Click the blue button to run the code. You will get a warning on errors and a badge on success. Good luck!

Your function returns the
correct result: 1560000.

CLOSE
CLOSE

It appears you are using a mobile device. Unfortunately the Blockly tool that this page employs does not work well on small devices. For best results, try this page on a large tablet, laptop or desktop.

CLOSE