Quiz: Number Types
Rearrange the following lines of code to produce variable declarations for
- the number of visitors to a small doctor's office today
- the number of gallons of water used per day
- the number of page views of a website viewed by users this quarter
- how long it takes a radioactive oxygen isotope to decrease by half
Initialize each variable with one of
123123E2123L123.
Type of visitorCount |
int |
The doctor won't have a billion visitors, nor fractional visitors. |
Initial value of visitorCount |
123 |
|
Type of gallons |
double |
You can have fractional gallons. |
Initial value of gallons |
123. |
123E2 or 123 would have worked too. |
Type of pageViews |
long |
Youtube has billions of page views. |
Initial value of pageViews |
123L |
123 would have worked too. |
Type of halfLife |
double |
As it happens, 15O has a half life of close to 123 seconds. |
Initial value of halfLife |
123. |
123 would have worked too. |
Where the slide says "radioactively tagged oxygen", It should say "radioactive oxygen isotope"
Note: Udacity was opposed to requiring a book with the course and put a few facts onto a “fact sheet”. It didn't work well. Get a book!