This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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?
The string data type should be used.
The enum data type should be used.
The integer data type should be used.
The container composite data type should be used.
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?
Error handling
A ternary operation
If statement
Switch statement
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?
The throw statement should be used in the catch statement to rerun the try block.
The finally statement should be used in the catch statement to rerun the try block.
The retry statement could be used in the catch statement to rerun the try block.
A business system function should be used in the catch statement to rerun the try block.
You must answer all questions before checking your work.
Continue
Was this page helpful?