Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help with this program please. 1. Your program must have an array of words

ID: 3679814 • Letter: N

Question

Need help with this program please.
1. Your program must have an array of words (Strings) from which one of the words is randomly chosen to play a round of the game. Please don’t include more that 5 words so that I can easily test your program: String [ ] words = { “javascript”, “declaration”, “object”, “class”, “failing” }; 2. Your program must contain at least one character array such as: char [ ] alphabet; 3. Your program must contain at least 3 method definitions not including the main method definition. 4. One of the method definitions must be a method called: explode The explode method is sent a string such as: “javascript” and returns an array of characters containing the letters that appear in the words: ‘j’ ‘a’ ‘v’ ‘a’ ‘s’ ‘c’ ‘r’ ‘I’ ‘p’ ‘t’ When the user is asked to make a letter guess, you can assume that the user will type a valid character and you do not need to check this.

Need help with this program please.
1. Your program must have an array of words (Strings) from which one of the words is randomly chosen to play a round of the game. Please don’t include more that 5 words so that I can easily test your program: String [ ] words = { “javascript”, “declaration”, “object”, “class”, “failing” }; 2. Your program must contain at least one character array such as: char [ ] alphabet; 3. Your program must contain at least 3 method definitions not including the main method definition. 4. One of the method definitions must be a method called: explode The explode method is sent a string such as: “javascript” and returns an array of characters containing the letters that appear in the words: ‘j’ ‘a’ ‘v’ ‘a’ ‘s’ ‘c’ ‘r’ ‘I’ ‘p’ ‘t’ When the user is asked to make a letter guess, you can assume that the user will type a valid character and you do not need to check this.


1. Your program must have an array of words (Strings) from which one of the words is randomly chosen to play a round of the game. Please don’t include more that 5 words so that I can easily test your program: String [ ] words = { “javascript”, “declaration”, “object”, “class”, “failing” }; 2. Your program must contain at least one character array such as: char [ ] alphabet; 3. Your program must contain at least 3 method definitions not including the main method definition. 4. One of the method definitions must be a method called: explode The explode method is sent a string such as: “javascript” and returns an array of characters containing the letters that appear in the words: ‘j’ ‘a’ ‘v’ ‘a’ ‘s’ ‘c’ ‘r’ ‘I’ ‘p’ ‘t’ When the user is asked to make a letter guess, you can assume that the user will type a valid character and you do not need to check this.

Explanation / Answer

import java.util.*;  

class TestCollection2{  

public static void main(String args[]){  

  ArrayList<String> al=new ArrayList<String>();  

  al.add("Ravi");  

  al.add("Vijay");  

  al.add("Ravi");  

  al.add("Ajay");  

  for(String obj:al)  

    System.out.println(obj);  

}  

}  

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////