Question: 1. Write a program named StateGame . The program should: load in the following states into an array (must be an array): Virginia, Arizona, Texas,

1. Write a program named StateGame. The program should:

load in the following states into an array (must be an array): Virginia, Arizona, Texas, Iowa, California, Nevada, Utah, Texas

Have method calls (each needs to be a separate method) that

prints out the states

prints out the list of states backwards

randomly picks two states and print those two out alphabetically.

asks the user for the name of a state. Print out whether the animal is in the list or not.

Sample output:

The states are: Virginia Arizona Texas Iowa California Nevada Utah Texas

The states backwards are: Texas Utah Nevada California Iowa Texas Arizona Virginia

Your two randomly picked states alphabetically are: Arizona and Virginia

Give me the name of a state

Ohio

Your state is not in the list

Second run:

The states are: Virginia Arizona Texas Iowa California Nevada Utah Texas

The states backwards are: Texas Utah Nevada California Iowa Texas Arizona Virginia

Your two randomly picked states alphabetically are: Texas and Utah

Give me the name of a state

Arizona

I found your state!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!