daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <meta charset="utf-8">
  5.   <meta name="viewport" content="width=device-width">
  6.   <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. // "for" loop method ...as payWeek=payWeek+1 and payRate = payRate*2;
  12. let payAccum=0;
  13. let payRate=1;
  14. for(let payWeek=1;payWeek<=52;payWeek++){
  15.   payRate=payRate*2;
  16.   payAccum=payAccum+payRate;
  17.   console.log("Payrate on week "+payWeek+" = "+payRate+" dollars, accumulating total earnings of ..."+payAccum+" dollars");
  18. }
  19. console.log("Total earnings for the previous 52 weeks =  "+payAccum+ "time to buy a small island or 2:)" );
  20. </script>
  21.  
  22.  
  23.  
  24. <script id="jsbin-source-javascript" type="text/javascript">// "for" loop method ...as payWeek=payWeek+1 and payRate = payRate*2;
  25. let payAccum=0;
  26. let payRate=1;
  27. for(let payWeek=1;payWeek<=52;payWeek++){
  28.   payRate=payRate*2;
  29.   payAccum=payAccum+payRate;
  30.   console.log("Payrate on week "+payWeek+" = "+payRate+" dollars, accumulating total earnings of ..."+payAccum+" dollars");
  31. }
  32. console.log("Total earnings for the previous 52 weeks =  "+payAccum+ "time to buy a small island or 2:)" );</script></body>
  33. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top