Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago

Question

How would you assess the value of an approach like this?

Answered: 1 week ago