Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Coding that you can assume has been created already and which you do not need to write: An int variable named stateCode has been declared

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

if stateCode 12 stateRegion ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Programming questions