Check your knowledge

Completed

Answer the following questions to see what you've learned

1.

You need to create and assign a data type to a variable. The variable should only have access to a defined list of values “Invent,” “Sale,” and “Purchase.” Which data type should you use?

2.

You need a conditional statement that checks if a variable equals “In progress,” “Completed,” or “Canceled.” Different code needs to run, depending on what the variable equals. A default block of code needs to run if the variable does not equal any of the values. What conditional statement is most appropriate?

3.

An error is sometimes thrown in a certain try…catch block. You know that the issue can be fixed within the code during the error handling code block. What statement could you use when the error is found to run the code again?