Advertisement
Guest User

Untitled

a guest
Mar 1st, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1.  
  2. var peopleAmount = [0,0,0,0,0,0,0,0,0];
  3.  
  4. function makeList(calculation) {
  5. for(i=0; i<peopleAmount.length; i++) {
  6. if(calculation >200 && calculation < 300) {
  7. peopleAmount[0] += 1;
  8. }
  9. else if(calculation > 300 && calculation < 400) {
  10. peopleAmount[1] += 1;
  11. }
  12. ....so on and so forth
  13. }
  14. }
  15.  
  16. function calculate() {
  17. var salesAmount = document.getElementById("salesAmount");
  18. var salesAmount = parseInt(salesAmount.value);
  19. var calculation = salesAmount *.09;
  20. var calculation = calculation + 200;
  21.  
  22. makeList(calculation);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement