Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use OCaml to write a program that returns one of four string values for each street number: N / A when the street
Use OCaml to write a program that returns one of four string values for each street
number:
NA when the street doesn't exist. We only consider st
through th Streets.
N when the street goes north.
S when the street goes south.
NS when the street is twoway.
Hints:
You may find the infix 'mod' modulo function useful: for example,
mod evaluates to if is even and otherwise.
Sometimes there is no simpleclever way of writing down a
complex case analysis: you just have to write out all the cases.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started