setu

Love Calculator with JavaScript

Sep 8th, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Love Calculator Practice by Saidur Rahman Setu (@srsetu)
  2.  
  3. // Names
  4. var firstName = prompt("What is your Name?");
  5. var secondName = prompt("What is partner Name?");
  6.  
  7. //Calculation
  8. var n = Math.random();
  9. n = n * 100;
  10. n = Math.floor(n) + 1;
  11.  
  12. //Result in alert box
  13. alert(firstName + " and " + secondName +"'s love percentage is: " + n + "%");
Advertisement
Add Comment
Please, Sign In to add comment