The hardest part about programming is figuring out how to get the computer to do what you want it to do. Once you determine how you would solve a task, you must then specify statements in the computer's programming language that would do the same thing. The problem here is that you must specify EVERYTHING down to the smallest detail to the computer. Humans are smarter than computers, because we can make and understand assumptions about the smaller details.
For this lab assignment, complete the following:
The display is to have 2 buttons and five text fields.
Last coin flip was:
There have been in a row.
Total number of flips:
Total number of heads:
Total number of tails:
This will be done by using the Math.random() method in JavaScript. This method returns a value from 0 to 1. We will use the values < 0.5 to indicate heads and those values >= 0.5 to represent tails.
Every time the button is pressed a new random value is gotten and it is determined whether the "coin flip" was heads or tails. At each coin flip we will update the 5 text fields.
Verify that your link and the file are viewable via a web browser from the URL of:
http://www.cs.uic.edu/~USERID where USERID is your CS account login name.You can check this out via the link to your home page on the CS 101 Student List page. Once you are at your home page, follow the link you added to your home page for this lab assignment.
To use the UNIX turnin command to electronically hand-in your html file using the project name of lab8. To submit the file in <filename> for lab8, the turnin command is entered as:
turnin -c cs101 -p lab8 <filename>To verify what you submitted using the turnin command type:
turnin -c cs101 -p lab8 -v