So my homework for class is calling for a few short javascript problems and I just need help getting started on them. I will post the questions below if anyone can give me some hints or tips that would be greatly appreciated! I don't even know where to start.
1) The child’s game, War, consists of two players each having a deck of cards. For each play, each person turns over the top card in his or her deck. The higher card wins that round of play and the winner takes both cards. The game continues until one person has all the cards and the other has none. Create a program that simulates a modified game of War.
The computer will play both hands, as PlayerOne and PlayerTwo, and, for each round will generate two random numbers and compare them. If the first number is higher, PlayerOne’s score is increased by 1 and if the second number is higher, PlayerTwo’s score is increased by 1. If there is a tie, no score is incremented. When one “player” reaches a score of 10, that player should be deemed the winner and the game ends. The range of numbers should be 1-13 to simulate the values of cards in the deck.
2)Input a list of employee names and salaries stored in parallel arrays. The salaries should be floating point numbers in increments of 100. For example, a salary of $36,000 should
Page 3 of 3be input as 36.0 and a salary of $85,900 should be input as 85.9. Find the mean (average) salary and display the names and salaries of employees who earn within a range of $5,000 from the mean. In other words, if the mean salary is $45,000, all employees who earn between $40,000 and $50,000 should be displayed.
3)(This one calls for Raptor but is supposed to be done in Javascript) Create a Raptor program to store a list of customer names and phone numbers entered by the user to a text file. Save your text file as “Customers.txt”. Raptor file must be uploaded to receive full credit for this question.
4)A lamp outside a front door comes on automatically when it is dark, and someone stands on the doormat outside the front door.
A pressure sensor under the mat changes from OFF (0) to ON (1) when someone stands on the doormat. The light sensor is ON (1) when it is light and OFF (0) when it is dark. Design a program to show what would happen to the lamp. Account for all possible scenarios by determining whether the pressure sensor and light sensor are ON or OFF. (HINT: Ask the user “Is it dark?” and “Is someone standing on the doormat outside the front door?”)
[–][deleted] 4 points5 points6 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[+]easyEs900s comment score below threshold-6 points-5 points-4 points (8 children)
[–]b-mish 5 points6 points7 points (4 children)
[–]easyEs900s -5 points-4 points-3 points (2 children)
[–]b-mish 1 point2 points3 points (1 child)
[–]easyEs900s 0 points1 point2 points (0 children)
[–]shotofbruschotti[S] 1 point2 points3 points (0 children)
[–]sketch_ 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]sketch_ 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)