jhylands

econ fail

Jan 20th, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. <html>
  2. <head>
  3. <style>
  4.  
  5. </style>
  6. <script src="http://calander.site90.net/Questions.js"></script>
  7. <script>
  8. //Marcro economic variables
  9. var intrest = 0.5;
  10. var inflation = 3;
  11. var unemplyment = 5;
  12. //Liniar regression values
  13. //inflation
  14. var inflationinflation = 0.1;
  15. var inflationintrest = 0.8;
  16. var inflationconstant = 0.1;
  17. //Unemployment
  18. var unemploymentintrest = 0.6;
  19.  
  20. function Run(){
  21. if (inflation > 3){
  22. inflation = Math.round(10*((2* inflation)/intrest + Math.random()))/10;
  23. }
  24. else{
  25. inflation = Math.round(10*(4/intrest + Math.random()))/10;
  26. }
  27. unemployment = Math.round(10*( 2*intrest + Math.random()))/10;
  28. update();
  29. }
  30.  
  31. function update(){
  32. var x = document.getElementById('intrestrates');
  33. x.innerHTML = intrest + "%";
  34. var y = document.getElementById('generalpricelevel');
  35. y.innerHTML = inflation + "%";
  36. if (inflation > 3 || inflation < 1){y.style.color = "red"; Qinflation();}
  37. else{y.style.color = "black";}
  38. var z = document.getElementById('unemployment');
  39. z.innerHTML = unemployment + "%";
  40. if (unemployment > 5){z.style.color = "red";}
  41. else{z.style.color = "black";}
  42. }
  43. function Qinflation(){
  44. alert(inflation1());
  45. }
  46. function increaseintrest(){ intrest = intrest + 0.5; update(); }
  47. function decreaseintrest(){ if (intrest > 0 ){intrest = intrest - 0.5;} update(); }
  48. </script>
  49. </head>
  50. <body>
  51. <div style="position:absolute;top:10px;right:100px;">
  52. <input type="button" value="Next" onclick="Run();">
  53. </div>
  54. <center> <h1>Economics</h1></center>
  55. <p id="ab" ><b>Notes</b> - The macro economic dependent variables; inflation, unemployment, <br />
  56. - The macro economic independent variables; Intrest rates;</p>
  57.  
  58. <table id="eco" border="1" ><tr>
  59. <td><h3>Intrest rates</h3></td><td><h3>Inflation</h3></td><td><h3>Unemployment</h3></td></tr>
  60. <tr><td><x id="intrestrates">0.5%</x> <div style="text-align:right;" ><input type="button" value ="-" onclick="decreaseintrest();"><input type="button" value="+" onclick="increaseintrest();"></div></td><td id="generalpricelevel">3%</td><td><x id="unemployment" >5%</x></td></tr>
  61. </table>
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment