COP 3804 Intermediate Java - COP3804pgm2b_4 Professor: Michael Robinson e-mail : michael.robinson@cs.fiu.edu Web Page : cs.fiu.edu/~mrobi002 - At the beginning of your program add the following: /********************************************************************* Author : Your Name Course : Java section. Example Java-1, Java-2, Java-3, or Java-4 Professor : Michael Robinson Program # : Program Purpose/Description { A brief description of the program } Due Date : MM/DD/YYYY Certification: I hereby certify that this work is my own and none of it is the work of any other person. ..........{ your signature }.......... *********************************************************************/ ********************* * Worth 10 points * ********************* ********************************************************** * ONLY the tools taught in this class will be accepted * ********************************************************** *********************************************************************** * YOU MUST FOLLOW MY JAVA RULES AT: * * https://users.cs.fiu.edu/~mrobi002/includes/JAVA_programmingRules * *********************************************************************** *************************************************** * Use System.out.printf ONLY to do all printing * *************************************************** *********************************************************************************** * No IDEs can be used. All programs MUST be done in TERMINAL MODE using editors * *********************************************************************************** Purpose of this program: ------------------------ 1) Parallel Arrays (page 152 Chapter 7) 2) Enhanced For Loops (Page 154 Chapter 7) 3) String Tokenizers (Page 156 Chapter 7) 4) ArrayLists (Page 167 Chapter 8) 5) ArrayList of Objects (Page 188 Chapter 8) - Program must be named: yourLastNameFirstLetterOfYourFirstNamePgm2.java ex: robinsonMpgm2.java - Make sure the program is properly documented and aligned uniformally, according to our "JAVA Programming Rules", discussed in class and located at: http://users.cis.fiu.edu/~mrobi002/includes/JAVA_programmingRules I will take points off if you do not follow the programming instructions. 1) Parallel Arrays (page 152 Chapter 7) --------------------------------------- a) In the main method create the following 3 (three) single dimension arrays: int carsWeight[] = { 50102, 23908, 12098 }; //carsWeight String owner[] = { "Michael Hall", "Maria Lopez", "Mo Freeman" }; //owers name double totalMiles[] = { 104.45, 232.78, 153.07 }; //total miles b) From the main method call a new method named parallel, passing the 3 arrays created in question 1a above. c) In the new parallel method accept and display the data received using Parallel Arrays as explained in class. 2) Enhanced For Loops (Page 154 Chapter 7) ------------------------------------------ a) In the main method create an array of Object data type named objectArray. b) From the main method call a method named theEnhanceForLoop passing the objectArray. c) In the theEnhanceForLoop search and display all data in the objectArray using an enhanced for loops. 3) String Tokenizers (Page 156 Chapter 7) ----------------------------------------- a) From the main method call a method named: tokens. In the tokens method, do the following: b) Display the following string delimited by [$%*&] String str1 = "Jill$Billy%Becky*Tara&Mary"; c) Display the following string delimited by [:.] String str2 = "http://gaddisbooks.com"; d) Display the following string delimited by ' ' (this means one space) String str3 = "blue one red three yellow"; 4) ArrayLists (Page 167 Chapter 8) ---------------------------------- a) From the main method call a method named: theArrayList, that will: b) Create an ArrayList of Object data type named theList. c) Add the following data: 123, "Java", 3.75, "Fall C", 2099 into the theList data structure. d) Display all data in the theList data structure. e) Delete second and fifth records from the theList data structure. f) Display all data left in the theList data structure. 5) ArrayList of Object Data Type (Page 188 Chapter 8) ----------------------------------------------------- a) From the main method call a new method named theObjects passing the following data: 1, "one", 1.4, 0.25, "COP3804", "Java Language", 100 b) In the method theObjects accept the data and load it into an arraylist of Object data type named theObjectList. c) Using printf display/print the data inside the theObjectList. Submitting your program ----------------------- - For all Classes: Upload your source Java code for program2 ONLY to Canvas. - Turn in a printed and stapled copy of the program at the beginning of class. for face 2 face classes ONLY. - Make sure the program is properly documented and aligned uniformally, looking professionally, I will take points off if it not. NOTE: If you have any question, please email me at michael.robinson@cs.fiu.edu Please remember that we are here to help you succeed in your classes We have FREE tutoring from Monday thru Saturday, please visit us at PG6 #102 and our Office Hours