JavaScript Required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
csHjavaA-2019
about this document
revision
traverse and process
standard algorithms
Parallel Arrays
read text files
write text files
CSV files
Letter frequency
development workflow
indices
More
Share
Explore
traverse and process
adding some processing to the traverse of an array
pre-standard algorithm
omit need for updating variable for result
nested IF within loop
pre-search: display matched items
use comparators to identify large, small values
use updating variable with n5: running total
Data lists
Text
names
"Chenai", "Balraj", "Vincent", "Prisha", "Maiya", "Juliette", "Jayce", "Bilal", "Mared", "Humera", "Woody", "Ema", "Tracey", "Zayn", "Vikki", "Warwick", "Cairo", "Lauren", "Wasim", "Estelle", "Tyreke", "Adelaide", "Shanaya", "Collette", "Shannon", "Kacy", "Bessie", "Mercy", "Romana", "Ines"
"Edmonds", "Sandoval", "Mullen", "Bennett", "Warren", "Castillo", "Baker", "Butt", "Hubbard", "Wallace", "Cooke", "Winters", "Lynch", "Bowler", "Holden", "Broughton", "Camacho", "Wolf", "Williamson", "Juarez", "Brennan", "Finnegan", "Gilbert", "Metcalfe", "Irving", "Myers", "Wilkinson", "Garrison", "Bridges", "Blaese"
produce initials, initial + surname, surname first, full name, username, email address
Phone numbers
"07507-304671", "07574-522632", "07451-596374", "07715-346302", "07538-254623", "07395-367314", "07435-139456", "07600-278531", "07911-037574", "07419-877121", "07872-075511", "07777-343856", "07903-791470", "07590-011396", "07666-213580", "07499-712468", "07873-758202", "07465-206886", "07758-023034", "07659-527498", "07710-757829", "07526-176025", "07910-227286", "07644-504638", "07840-773947", "07479-935404", "07963-605366", "07427-618981", "07746-842316", "07818-193588"
convert format: international, remove -, use ()
post codes
"BS4 1SY", "HD9 7NP", "TS22 5HA", "B30 3EG", "SS8 7NG", "TQ13 9PY", "IP24 2TY", "PE20 3AD", "ME10 3QE", "KY8 5FL", "SL8 5NB", "NN17 1SZ", "DY1 1LT", "LA14 4DS", "ST4 4DL", "BH17 9HL", "NE23 7LF", "EX7 0BY", "CM17 0GH", "PO11 0AG", "SW2 2QR", "N14 4HU", "CH7 6AE", "CF46 6ST", "PE1 1XL", "RH11 9DB", "RG14 2JG", "M15 4DN", "M45 8GH", "BS16 4QX"
extract outer code and inner code, use length
NATO alphabet
"Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", "Yankee", "Zulu"
display character and word
convert car reg plate to NATO alphabet
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
convert letters to characters, casting
elements - single letter names
"N/A", "Boron", "Carbon", "N/A", "N/A", "Fluorine", "N/A", "Hydrogen", "Iodine", "N/A", "Potassium", "N/A", "N/A", "Nitrogen", "Oxygen", "Phophorus", "N/A", "N/A", "Sulfur", "N/A", "Uranium", "Vanadium", "Tungsten", "N/A", "Yttrium", "N/A"
display symbol and element name
Integer
Primes (<100)
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
choose a prime at random
costs
(pence, convert to £ and pence using modulo)
1270, 2088, 1837, 1616, 2069, 1321, 1772, 2005, 1501, 2311, 1382, 1607, 2045, 1907, 1853, 1807, 1670, 1941, 2053, 1865, 2293, 1648, 1546, 1936, 1462, 2295, 1366, 2231, 2135, 2293
triathlon
calculate total seconds, display as hours, minutes, seconds
swim
(seconds)
1080, 1407, 1367, 1404, 1526, 1625, 1898, 1949, 1343, 1625, 1816, 1387, 1311, 1390, 1188, 1940, 1484, 1975, 1323, 1401, 1718, 1574, 1470, 1171, 1872, 1252, 1423, 1224, 1109, 1520
bike
(seconds)
3360, 3362, 3415, 3409, 3378, 3408, 3439, 3399, 3353, 3386, 3371, 3404, 3421, 3382, 3436, 3412, 3375, 3358, 3422, 3358, 3381, 3363, 3410, 3435, 3375, 3397, 3437, 3377, 3410, 3374
run
(seconds)
1920, 1946, 2018, 1925, 1996, 1981, 1970, 1932, 1950, 1999, 2004, 1964, 2016, 1921, 1944, 1926, 1933, 1995, 1964, 1982, 1989, 2002, 2021, 1945, 1999, 1956, 1983, 1964, 1957, 2015
Real values
Note frequencies (Hz)
"A4", "B4", "C4", "D4", "E4", "F4", "G4", "A5", "B5", "C5", "D5", "E5", "F5", "G5", "A6"
440, 493.88, 523.25, 587.33, 659.25, 698.46, 783.99, 880, 987.77, 1046.5, 1174.66, 1318.51, 1396.91, 1567.98, 1760
for a given note, its frequency is half that of the note 1 octave higher
square roots (0-39)
0.0000, 1.0000, 1.4142, 1.7321, 2.0000, 2.2361, 2.4495, 2.6458, 2.8284, 3.0000, 3.1623, 3.3166, 3.4641, 3.6056, 3.7417, 3.8730, 4.0000, 4.1231, 4.2426, 4.3589, 4.4721, 4.5826, 4.6904, 4.7958, 4.8990, 5.0000, 5.0990, 5.1962, 5.2915, 5.3852, 5.4772, 5.5678, 5.6569, 5.7446, 5.8310, 5.9161, 6.0000, 6.0828, 6.1644, 6.2450
exploring rounding, int and double type, casting
Boolean
Character
' ', '!', '"', '#', '$', '%', '&', ''', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@'
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
casting, int, char and String
Data lists
Text
names
post codes
NATO alphabet
elements - single letter names
Integer
costs
triathlon
Real values
Note frequencies (Hz)
square roots (0-39)
Boolean
Character
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.