How do I fix my code, so it passes all of the test in the testmethod Number 1)**********************

FIRST GRADER essay writing company is the ideal place for homework help. If you are looking for affordable, custom-written, high-quality and non-plagiarized papers, your student life just became easier with us. Click the button below to place your order.

Order a Similar Paper Order a Different Paper

How do I fix my code, so it passes all of the test in the testmethod Number 1)****************************testmethod****************************************** public void testIsValidWord() {

assertFalse(Hangman.isValidWord(“Cool”));//false because only 4letters


assertFalse(Hangman.isValidWord(“aapaple”));//false because thereare 3 As

assertFalse(Hangman.isValidWord(“renovate the room”));//fallbecause there are spaces

} ************************************************************************* my code *************************************************************8 public static boolean validW(String word) { int alphOccur=0; boolean flag=true; for(int i=0;i

=’a’&&word.charAt(i+1)<=’z’||word.charAt(i)>=’A’&&word.charAt(i+1)<=’Z’){ flag = true; } if(alphOccur+1 >=3) { flag=false; } for(int j=i+1;j

=6) { flag=true; } System.out.println(flag); return flag; } ————–Number2——————————————————————————————————— //how do i //test method public void testMakeGuess() {

assertEquals(“optio_”, Hangman.makeGuess(“g”, “option”,”optio_”));

assertEquals(“option”, Hangman.makeGuess(“n”, “option”,”optio_”));

assertEquals(“opt___”, Hangman.makeGuess(“opt”, “option”,”______”));

assertEquals(“_p_ion”, Hangman.makeGuess(“ion”, “option”,”_p____”));

assertEquals(“option”, Hangman.makeGuess(“pt”, “option”,”op_ion”));

} //my code /*the disguisedWord is the blank string with underscores like __ _ _ _ _ _, everytime a user guess a letter, if the letter is inthe secretWord, it it assign the letter at the spot of the word inthe blank space, like the test method. */ public static String mGuess(String guess, String secretWord,String disguisedWord) { String newWord=disguisedWord; if(secretWord.contains(guess)) { for(int i=0;i . . .

Got stuck with another paper? We can help! Use our paper writing service to score better grades and meet your deadlines.

Get 15% discount for your first order

Order a Similar Paper Order a Different Paper