Table 4 Exercises

< CS101

For these exercises, write code to print the names which meet certain conditions. Syntax reminder: "standalone" rule for boolean tests -- each test must be syntactically complete before being combined with other tests via "&&" or "||".

1. Write code to print all the rows where the name starts with "A" and does not end with "y". As with all these problems, you should be able to eyeball your results to confirm that your code is working correctly.


table-4-ex1

2. Write code to print all the rows where the name starts with "O" and does not end with "r".


table-4-ex2

3. (Variation on the problem above.) Write code to print all the rows where the name starts with "O" and does not end with "r" and the gender is "boy".


table-4-ex3


Each click of a Run button saves that code to disk on the computer running the browser. The button below retrieves the code exercises listed to the right of the button.

count 3 : table-4-ex1 table-4-ex2 table-4-ex3

(code appears here)