This is java In this program, you are going to read in a post secondary educatio
ID: 3864998 • Letter: T
Question
This is java
In this program, you are going to read in a post secondary education data set file, Post Secondary Education.txt. You are going to create a Education object which keeps track of the SchoolID, Name of the School, the State Abbreviation their Web address.
You are going to store it into an array of Education objects. The default starting size is 10. You are going mimic an ArrayList, and when you add items you will use an add method that you create. If you run out of space, you need to expand the array (double its size) and copy all the previous items into the new array when you run out of space.
Finally, you should print out each of the objects by using a get method that you create.
Use the Post Secondary Education.txt file in Moodle.
Specifics:
1. Read in the education file and create Education objects. 2. Store each object into the array you created. 3. Initialize the array size to 10. Please do not use an actual ArrayList. 4. Create an expand method when the number of items read in exceeds the size of the array. 5. Create a size method to keep track of how large your “ArrayList.” 6. Create an add method to add items to your “ArrayList.” 7. Create a get method to get items out of your “ArrayList.” 8. Print out all the students in your “ArrayList” at the end.
Post Secondary Education.txt file
UNITID INSTNM STABBR WEBADDR
100654 Alabama A & M University AL www.aamu.edu/
100663 University of Alabama at Birmingham AL www.uab.edu
100690 Amridge University AL www.amridgeuniversity.edu
100706 University of Alabama in Huntsville AL www.uah.edu
100724 Alabama State University AL www.alasu.edu/email/index.aspx
100733 University of Alabama System Office AL www.uasystem.ua.edu
100751 The University of Alabama AL www.ua.edu/
100760 Central Alabama Community College AL www.cacc.edu
100812 Athens State University AL www.athens.edu
100830 Auburn University at Montgomery AL www.aum.edu
100858 Auburn University AL www.auburn.edu
100937 Birmingham Southern College AL www.bsc.edu/
101028 Chattahoochee Valley Community College AL www.cv.edu
101073 Concordia College Alabama AL www.ccal.edu/
101116 South University-Montgomery AL southuniversity.edu
101143 Enterprise State Community College AL www.escc.edu
101161 James H Faulkner State Community College AL www.faulknerstate.edu
101189 Faulkner University AL www.faulkner.edu
101240 Gadsden State Community College AL www.gadsdenstate.edu
101277 New Beginning College of Cosmetology AL www.nbccosmetology.com
101286 George C Wallace State Community College-Dothan AL www.wallace.edu
101295 George C Wallace State Community College-Hanceville AL www.wallacestate.edu
101301 George C Wallace State Community College-Selma AL www.wccs.edu
101365 Herzing University-Birmingham AL www.herzing.edu/birmingham
101435 Huntingdon College AL www.huntingdon.edu
101453 Heritage Christian University AL www.hcu.edu
101462 J F Drake State Community and Technical College AL www.drakestate.edu
101471 J F Ingram State Technical College AL www.istc.edu
101480 Jacksonville State University AL www.jsu.edu/
101499 Jefferson Davis Community College AL www.jdcc.edu
101505 Jefferson State Community College AL www.jeffstateonline.com
101514 John C Calhoun State Community College AL www.calhoun.edu
101541 Judson College AL www.judson.edu
101569 Lawson State Community College-Birmingham Campus AL www.lawsonstate.edu
101587 University of West Alabama AL www.uwa.edu
101602 Lurleen B Wallace Community College AL www.lbwcc.edu
Explanation / Answer
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class HelloWorld{
public String readFile(String filename)
{
String content = null;
File file = new File(filename);
FileReader reader = null;
try {
reader = new FileReader(file);
char[] chars = new char[(int) file.length()];
reader.read(chars);
content = new String(chars);
reader.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if(reader !=null){reader.close();}
}
return content;
}
public static void main(String []args){
System.out.println("Hello World");
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.