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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started