Hello everyone, welcome back to coding mastero and in todays video we are going to see how to create an age calculator in code.org. Here are the steps: Open code.org Login with your account Click on create Click on app lab Click on design Click on label Type “your age in years” in the label Click on text input In the placeholder type “Type Your age in years” Add a button Type “calculate” in the button Copy the first label and type “Your age in hours” Next copy the same label and delete all the test in it. Click on the third label and click code and copy this code. onEvent("button1", "click", function( ) { setText("label3", 365 * (24 * getText("Inputinyears"))); }); Java Script for the following is:- onEvent("button1", "click", function( ) {
setText("label3", 365 * (24 * getText("Inputinyears")));
}); Now our calculator is ready lest us see the results:- 157680 hours I have typed my age as 18 years and you can see the results. Let us see it the calculator and our answer match. 157680 hours As you can see the answers have matched and our code is correct 😊😊😊 Thanks for dropping in on our website hope to see you soon. 😊😊😊😊
Comentarios