ranges and functions
June 28th, 2023
You have functions that you wish to call for various individual year values, as well as ranges of years, and you are deciding on whether to use an if statement or a switch statement. The ranges and functions are:
o 1900 to 1969 – functionA()
o 1969 to 2000 – functionB()
o 2001 – functionC()
o 2002, 2003 – functionD()
o 2004 and beyond – functionE()
Do you think it would be better to set this up as an if statement, a switch statement, or a combination? Write the code if it helps to explain your answer.