讲解:CSE 110、Java、Linear Search、JavaR|SQL

Lab 12CSE 110: Principles of ProgrammingArizona State UniversityTopics● Linear Search.● Bubble Sort.Lab 12 - Arrays1. Please copy the following code into your IDE and ensure it compiles.public class Lab12{ public static void main(String[] args) {String[] array = {“John”,”Thomas”,”Alex”,”Tyler”,”Elizabeth”}; }}2. Make a method to print a String array that accepts the array as a parameter.3. Create a method which accepts a String array, and a string to search for as parameters,which returns the index of the first occurrence of the given string as an integer.4. Create a boolean method which accepts a 代写CSE 110作业、代做Java编程设计作业、代写Linear Search作业、代做Java留学生作业 代做R语言sorted string array in alphabetical order. Themethod either confirms that the array is sorted and returns true or returns false if the arraywasn’t sorted.5. Create a bubbleSort method which takes an array of Strings and sorts it in place. Thebubble sort algorithm works by comparing each element in the array to the next elementand swapping them if the first is higher than the next one. Remember, String has acompareTo method which will be helpful here.6. Please upload your Lab12.java file to the Lab 12 assignment under the Labs tab onBlackboard. Make sure you talk to your lab TA before you leave to ensure they markedyou as present.转自:http://ass.3daixie.com/2018111948271982.html

你可能感兴趣的:(讲解:CSE 110、Java、Linear Search、JavaR|SQL)