Cursor etc. in Oracle

Problem #1: Write a PL/SQL program that includes the following:

For example:

You might decide to only process records where the state = MA. That selection could be handled with the cursor. You then might decide that if the city is Fall River you are going to do a calculation and write to the Fall River table. Other cities call for another calculation and get written to another table.

Problem #2: Write a PL/SQL program that uses TYPETABLE in some way.