This page has a bunch of problem statements which describe programs that you can implement for the joy of practicing your craft. Remember that when you implement them, several things should happen; DON'T JUST JUMP INTO THE CODE RIGHT AWAY unless the problem is so trivial that you can do it in a line or two of code.
isSmallInteger()
which returns
true
if its sole parameter is an integer between -128 and 127, inclusive, and
false
otherwise.
Examples:sumOfCodepoints
which takes a string
and returns the sum of each of the codepoints in the string. Hint: The method you are looking
for is charCodeAt. We covered code points in chapter 3 - review if you need to do so.var x = 1; var f = function (y) {alert(x + y);} f(2);
split("")
to turn a string into an array of characters to which
you can apply the filter.Hello, world! Hello, world! Hello, world! Hello, world! Hello, world! Hello, world! Hello, world!
....and the phrase "blah blah" will produce:HOTEL ECHO LIMA LIMA OSCAR
There is no distinction required for upper or lower case letters, so you may treat them however you want. For a complete listing of the NATO alphabet, see the web page at: http://en.wikipedia.org/wiki/NATO_phonetic_alphabetbravo lima alpha hotel bravo lima alpha hotel
A listing of the Morse code is on the same page as the wikipedia link above.*** ~~~ ***
Don't forget error checking the input values. You can decide for yourself whether to accept military time formats (i.e., "13:24:35" is 24 minutes and 35 seconds past 1 PM).Hours: 0 0 1 1 0 0 Minutes: 1 0 0 0 1 0 Seconds: 1 1 1 0 0 0
Thus for D0 = "Fa", we get D1 = "FaRbFR" and D2 = "FaRbFRRLFaLbFR". This process is known as grammar production in some circles."a" -> "aRbFR" "b" -> "LFaLb"
D3 -> "FaRbFRRLFaLbFRRLFaRbFRLLFaLbFR" "R" count = 7
What is the output for the 15th prime number? The 23rd? What is the sum of the first 37 primes? You may wish to write a "helper" function to determine if a number is prime (if you haven't already done so!).2, 3, 5, 7, 11, 13, 17, 19 .....which has the sum 77
Initial balance: 1000 Annual interest rate in percent: 6.0 After first month: 1005.00 After second month: 1010-03 After third month: 1015.08
Enter the number of movie rentals: 56 Enter the number of members referred: 3 The discount is equal to: 59.00 percent
Td = (b * f(T, RH)) / (a - f(T, RH)) where: f(T, RH) = ((a * T) / (b + T)) + ln( RH ) a = 17.27 b = 237.7 degrees C
Write a program that reads the relative humidity (a value between 0 and 1) and the temperature in degrees Celcius, and prints the dew point value. Use the Python function "log()" to compute the natural logarithm (the "ln" in the equation). Check your calculation with a few of the values located at this page.