JSFiddle - React, Tailwind, and code Playground

by Nidhi Patel

HTML

<!--7. Assume that you are developing an ATM machine, Prompt the user to enter amount he/she wants to withdraw.-->

JavaScript

var amount = prompt("Eneter the amount you want to withdraw: ");

function withdrawSomeAmount(amount){
if(isNaN(amount) ){ 
alert("Please enter a valid number..");
} else
			if(amount % 20 == 0){
//if ( amount % 20 == 0 ){
			alert("You're amount is ready");
						} else {
			alert("Please enter multiple of 20s.. ");
					}
return amount;
}

var withdrawAmount = withdrawSomeAmount(amount);