-- Does check phono area code -- Name A N Onymous Function properAreaStr (phono) ofType bool Slot phono ofClass Str Box result ofType bool -- Does check string phono for proper area code Box mid ofClass Str Set mid = phono.substring (2,3) -- mid of area code If ( (mid.equals ("0")) or (mid.equals ("1")) ) then Set result = true Else Set result = false EndIf EndFunction properAreaStr Function properAreaInt (phono) ofType bool Slot phono ofType int Box result ofType bool -- Does check int phono for proper area code Box mid ofType int -- mid digit of area code Set mid = (phono / 10000000) % 10 Set result = ((mid == 0) or (mid == 1)) EndFunction properAreaInt Routine mainTest (none) -- Does test phone checker Box phoneNum ofType int Box phoneStr ofClass Str Start Outputln "Enter phone number in form (ddd)-ddd-dddd" Input phoneStr Outputln phoneStr If ( properAreaStr (phoneStr) ) then Outputln "Phone number is proper " Else Outputln "Phone number is improper" EndIf Outputln " " Outputln "Enter phone number; digits only " Input phoneNum Outputln phoneNum If ( properAreaInt(phoneNum) ) then Outputln "Phone number is proper " Else Outputln "Phone number is improper" EndIf -- Can do same for string part EndRoutine mainTest Enter phone number in form (ddd)-ddd-dddd (123)-456-7890 Phone number is improper Enter phone number; digits only 1112223333 Phone number is proper