Question
I need help with this assignment and I need it done ASAP. I attached the instructions and what I submitted to the teacher. But apparently
I need help with this assignment and I need it done ASAP. I attached the instructions and what I submitted to the teacher. But apparently the StatesDataEntry Class: The java source code was not included, Test StatesDataEntry Class: The java source code was not included and Documentation and Style guide: The java source code was not included. I need to get them in this assignment. So help!!!
Flower 2
Java Data Entry Class Code
// Homework 4 Create a StateData Class and StateData Test Program
// Description: This program constructs a State Data Entry class containing
// State, Capital, Joined Union, Motto, Flower and Bird
// Course:
// Date: 08 Oct 17
// File Name: StateData.java
public class StateData {
private String state [][] = {
{"ALABAMA","Nothern Flicker","Camellia","Montgomery","We Dare to Defend Our Rights","Twenty Second"},
{"ALASKA","Willow Ptarmigan","Forget-me-not","Juneau","North to the Future","Forty Ninth"},
{"ARIZONA","Cactus Wren","Saguaro Cactus Blossom","Phoenix","God Enriches","Forty Eighth"},
{"ARKANSAS","Mockingbird","Apple Blossom","Little Rock","The People Rule","Twenty Fifth"},
{"CALIFORNIA","California Quail","California Poppy","Sacramento","I Have Found It","Thirty First"},
{"COLORADO","Lark Bunting","Rocky Mountain Columbine","Denver","Nothing without Providence","Thirty Eigth"},
{"CONNECTICUT","American Robin","Mountain Laurel","Hartford", "He Who Transplanted Sustains","Fifth"},
{"DELAWARE","Blue Hen","Peach Blossom","Dover","Liberty and Independence","First"},
{"FLORIDA","Northern Mockingbird","Orange Blossom","Tallahassee","In God We Trust","Twenty Seventh"},
{"GEORGIA","Brown Thrasher","Azalea","Atlanta","Wisdom, Justice, and Moderation","Fourth"},
{"HAWAII","Hawaiian Goose","Hawaiian Hibiscus","Honolulu","The Life of the Land is Perpetuated in Righteousness","Fiftieth"},
{"IDAHO","Mountain Bluebird","Mock Orange","Boise","Let It Be Perpetual","Forty Third"},
{"ILLINOIS","Northern Cardinal","Violet","Springfield","State Sovereignty, National Union","Twenty First"},
{"INDIANA","Cardinal","Peony","Indianapolis","The Crossroads of America","Nineteenth"},
{"IOWA","Eastern Goldfinch","Wild Rose","Des Moines","Our Liberties We Prize and Our Rights We Will Maintain","Twenty Ninth"},
{"KANSAS","Western Meadowlark","Sunflower","Topeka","To the Stars Through Adversity","Thirty Fourth"},
{"KENTUCKY","Northern Cardinal","Goldenrod","Frankfort","Let Us Give Thanks to God","Fifteenth"}, 3
{"LOUISIANA","Brown Pelican","Magnolia","Baton Rouge","Union, Justice, and Confidence","Eighteenth"},
{"MAINE","Black-capped Chickadee","White Pine Cone and Tassel","Augusta","I Direct","Twenty Third"},
{"MARYLAND","Baltimore Oriole","Black-eyed Susan","Annapolis","Manly Deeds, Womanly Words","Seventh"},
{"MASSACHUSETTS","Black-capped Chickadee","Mayflower","Boston","By the Sword We Seek Peace, but Peace Only Under Liberty","Sixth"},
{"MICHIGAN","American Robin","Apple Blossom","Lansing","If You Seek a Pleasant Peninsula, Look About You","Twenty Sixth"},
{"MINNESOTA","Common Loon","Pink and White Lady's Slipper","Saint Paul","The Star of the North","Thirty Second"},
{"MISSISSIPPI","Northern Mockingbird","Magnolia","Jackson","By Valor and Arms","Twentieth"},
{"MISSOURI","Eastern Bluebird","Hawthorn","Jefferson City","The Welfare of the People Is the Highest Law","Twenty Fourth"},
{"MONTANA","Western Meadowlark","Bitterroot","Helena","Gold and Silver","Forty First"},
{"NEBRASKA","Western Meadowlark","Goldenrod","Lincoln","Equality Before the Law","Thirty Seventh"},
{"NEVADA","Mountain Bluebird","Sagebrush","Carson City","All of Our Country","Thirty Sixth"},
{"NEW HAMPSHIRE","Purple Finch","Purple Lilac","Concord","Live Free or Die","Ninth"},
{"NEW JERSEY","Eastern Goldfinch","Violet","Trenton","Liberty and Prosperity","Third"},
{"NEW MEXICO","Roadruner","Yucca Flower","Santa Fe","It Grows as It Goes","Forty Seventh"},
{"NEW YORK","Eastern Bluebird","Rose","Albany","Ever Upward!","Eleventh"},
{"NORTH CAROLINA","Northern Cardinal","Flowering Dogwood","Raleigh","To Be, Rather than to Seem","Twelfth"},
{"NORTH DAKOTA","Western Meadowlark","Wild Prairie Rose","Bismarck","Liberty and Union, Now and Forever, One and Inseparable","Thirty Ninth"},
{"OHIO","Northern Cardinal","Scarlet Carnation","Columbus","With God, All Things are Possible","Seventeenth"},
{"OKLAHOMA","Scissor-tailed Flycatcher","Oklahoma Rose","Oklahoma City","Hard Work Conquers All Things","Forty Sixth"},
{"OREGON","Western Meadowlark","Oregon Grape","Salem","She Flies With Her Own Wings","Thirty Third"},
{"PENNSYLVANIA","Ruffed Grouse","Mountain Laurel","Harrisburg","Virtue, Liberty, and Independence","Second"},
{"RHODE ISLAND","Rhode Island Red","Violet","Providence","Hope","Thirteenth"},
{"SOUTH CAROLINA","Carolina Wren","Yellow Jessamine","Columbia","While I Breathe, I Hope","Eight"},
{"SOUTH DAKOTA","Ring-necked Pheasant","Pasque Flower","Pierre","Under God the People Rule","Fortieth"},
{"TENNESSEE","Nothern Mockingbird","Iris","Nashville","Agriculture and Commerce","Sixteenth"}, 4
{"TEXAS","Northern Mockingbird","Bluebonnet","Austin","Friendship","Twenty Eighth"},
{"UTAH","California Gull","Sego Lily","Salt Lake City","Industry","Forty Fifth"},
{"VERMONT","Hermit Thrush","Red Clover","Montpelier","May the 14th Star Shine Bright","Forteenth"},
{"VIRGINIA","Northern Cardinal","American Dogwood","Richmond","Thus Always to Tyrants","Tenth"},
{"WASHINGTON","Willow Goldfinch","Coast Rhodedendron","Olympia","By and By","Forty Second"},
{"WEST VIRGINIA","Northern Cardinal","Rhodedendron","Charleston","Mountaineers are Always Free","Thirty Fifth"},
{"WISCONSIN","American Robin","Wood Violet","Madison","Forward","Thirtieth"},
{"WYONMING","Western Meadolark","Indian Paintbrush","Cheyenne","Equal Rights","Forty Fourth"},
};
// Class Constructor
public StateData() {
}
//Get Method
public String[][] getState() {
return state;
}
//Set Method
public void setState(String[][] state) {
this.state = state;
}
} 5
Java Summary Class Code
// Homework 4 Create a StateData Class and StateData Test Program
// Description: This program constructs a State Summary class to display
// a summary of State, Capital, Joined Union, Motto, Flower and Bird
// Course: CMIS14
// Date: 08 Oct 17
// File Name: StateSum.java
public class StateSummary {
//Declare Variables
private String name;
private String flower;
private String bird;
private String capital;
private String motto;
private String union;
//Constructor
public StateSummary(String name, String flower, String bird, String capital, String motto, String union) {
this.name = name;
this.flower = flower;
this.bird = bird;
this.capital = capital;
this.motto = motto;
this.union = union;
}
//Getters
public String getFlower() {
return flower;
}
public String getBird() {
return bird; 6
}
public String getName() {
return name;
}
public String getCapital() {
return capital;
}
public String getMotto() {
return motto;
}
public String getUnion() {
return union;
}
//Setters
public void setFlower(String flower) {
this.flower = flower;
}
public void setBird(String bird) {
this.bird = bird;
}
public void setName(String name) {
this.name = name;
}
public void setCapital(String capital) {
this.capital = capital;
}
public void setMotto(String motto) {
this.motto = motto;
}
public void setUnion(String union) {
this.union = union;
}
public String toString() {
return name + ", " + capital + ", " + union + ", " + motto + ", " + bird + ", " + flower + " "; 7
}
} 8
Java Test Class Code
// Homework 4 Create a StateData Class and StateData Test Program
// Description: This program constructs a StateData class to display
// State, Capital, Joined Union, Motto, Flower and Bird
// Course: CMIS 141
// Developer: Sluga Anne Judith
// Date: 08 Oct 17
// File Name: TestStateData.java
// Import Utilities
import java.util.Scanner;
import java.util.ArrayList;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class TestStateData {
private static final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm:ss");
public static void main(String[] args) {
ArrayList state1 = new ArrayList<>();
StateData information = new StateData();
String states[][] = information.getState();
Scanner input = new Scanner(System.in);
//Declare Variables
int counter = 0;
// Program Intro
System.out.println(" ");
System.out.println("****************************");
System.out.println("* U.S. State Tidbits *");
System.out.println("****************************");
LocalDateTime now = LocalDateTime.now();
System.out.println("Local Computer Date/Time: " + dtf.format(now));
while (true) {
System.out.print(" Enter a State or 'None' to exit: "); 9
String state = input.nextLine();
if (state.trim().equalsIgnoreCase("None")) {
if (counter == 0) {
System.out.println(" You have decided not to continue.");
System.out.println("Have a great day!");
break;
}
//Program Exit Display
System.out.println(" **** Thank you for using this program! ***** ");
System.out.println("This is a summary report for each State Tidbit you accessed.");
System.out.println("Organized by State, Capital, Joined Union, Motto, Bird, Flower. ");
//Display Summary
for(StateSummary st : state1) {
System.out.print(st.toString());
}
System.out.println(" Have a great day!");
break;
} else {
int index = getStateIndex(state, states);
if (index != -1) {
//Display State User Selection
System.out.print(" ");
System.out.println("State: " + getState(index, states));
System.out.println("State Capital: " + getCapital(index, states));
System.out.println("State Joined Union: " + getUnion(index, states));
System.out.println("State Motto: " + getMotto(index, states));
System.out.println("State Bird: " + getBird(index, states));
System.out.println("State Flower: " + getFlower(index, states));
System.out.print(" ");
state1.add(new StateSummary(getState(index,states),getBird(index, states),getFlower(index, states),getCapital(index, states),getMotto(index, states),getUnion(index,states))); 10
} else {
System.out.println("Please try again, an invalid State was entered.");
} counter ++;
}
}
input.close();
}
private static int getStateIndex(String state, String[][] states) {
for (int i = 0; i < states.length; i++) {
if (state.trim().equalsIgnoreCase(states[i][0])) {
return i;
}
}
return -1;
}
private static String getState(int index, String[][] states) {
return states[index][0];
}
private static String getBird(int index, String[][] states) {
return states[index][1];
}
private static String getFlower(int index, String[][] states) {
return states[index][2];
}
private static String getCapital(int index, String[][] states) {
return states[index][3];
}
private static String getMotto(int index, String[][] states) {
return states[index][4];
}
private static String getUnion(int index, String[][] states) {
return states[index][5];
}
}
Intruction:
ents to date.
Write a Java program the displays the State bird and flower. You should use your IDE for this exercise. You should also use Java classes to their full extent to include multiple methods and at least two classes. The program should prompt the user to enter a State and print both the State bird and flower. The user should be able to enter a State without worrying about case. (e.g. Users could enter Maryland, maryland, MARYLAND or any other possible combination of lower and upper case characters. States may also contain leading and trailing white spaces. Hint: Store the State information in a multi-dimensional array. The program should continue to prompt the user to enter a state until "None" is entered. After all States have been entered by the user, the program should display a summary of the results. You will need to do some research to find the State birds and flowers. Here is a sample run:
Enter a State or None to exit: Maryland Bird: Baltimore Oriole Flower: Black-eyed Susan Enter a State or None to exit: Delaware Bird: Blue Hen Chicken Flower: Peach Blossom Enter a State or None to exit: None
**** Thank you ***** A summary report for each State, Bird, and Flower is: Maryland, Baltimore Oriole, Black-eyed Susan Delaware, Blue Hen Chicken, Peach Blossom Please visit our site again!
Create a test class that constructs at least 3 States objects. For each of the objects constructed, demonstrate the use of each of the methods. Be sure to use your IDE to accomplish this assignment.
The google recommended Java style guide, provided as link in the week 2 content, should be used to format and document your code. Specifically, the following style guide attributes should be addressed:
Header comments include filename, author, date and brief purpose of the program.
In-line comments used to describe major functionality of the code.
Meaningful variable names and prompts applied.
Class names are written in UpperCamelCase.
Variable names are written in lowerCamelCase.
Constant names are in written in All Capitals.
Braces use K&R style.
Submission requirements Deliverables include all Java files (.java) and a single word (or PDF) document. The Java files should be named appropriately for your applications. The word (or PDF) document should include screen captures showing the successful compiling and running of each of the test cases. Each screen capture should be properly labeled clearly indicated what the screen capture represents. The test cases table should be included in your word or PDF document and properly labeled as well.
Submit your files to the Homework 4 assignment area no later than the due date listed in your LEO classroom. You should include your name and HW4 in your word (or PDF) file submitted (e.g. firstnamelastnamehw4.docx or firstnamelastnamehw4.pdf)
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