Coding that you can assume has been created already and which you do not need to write:
Fantastic news! We've Found the answer you've been seeking!
Question:
Coding that you can assume has been created already and which you do not need to write:
- An int variable namedstateCodehas been declared and has a valid value.
- A String variable named stateRegionhas been declared and initialized to the empty string.
Code you are to write:
an if-else structure to store the text name of a US region in the variable namedstateRegionbased upon the value of stateCode. This question is testing your knowledge of if-else structures. You are required to use ONE if-else structure for this question.
- if the code is 12 the stateRegion is "Florida"
- if the code is 1 or 13 the stateRegionis "Borders Florida"
- if the code is 33 - 35 the stateRegion is "Not Near Florida"
- For all other valid state codes place "State Not Used for this Example" in thestateRegion
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date: