subject

HELP ASAP PLEASE AP Computer Science (JAVA)

You are working with a team of programmers to write a program for a Wheel of Fortune game. Your task is to write a method that will return how many times a letter is found in a String puzzle. For example, if the puzzle is "Last Minute Gift Shopping" and a player chose the letter "s", the value 2 would be returned.

In another class, you are given the statements

WheelOfFortune puzzle1 = new WheelOfFortunePuzzle("Last Minute Gift Shopping");
String letter = "s";
System. out. println("The letter " + letter + " is found: " + puzzle1.howMany(letter) + " times");

That outputs: The letter s is found 2 times

Fill in the missing code to complete the method howMany() for the WheelOfFortune class:

public class WheelOfFortune
{
private String puzzle;

public WheelOfFortune (String p)
{
puzzle = p;
}

public static howMany(String letter)
{
int count = 0;
for (int i = ; i puzzle. length(); i++)
{
if( .substring(i, i+1).equalsIgnoreCase( ))
{
;

}
}
return ;
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
question
Computers and Technology, 23.06.2019 16:10
What is the ooh? a. omaha occupation handbook b. online occupational c. occupations online d. occupational outlook handbook select the best answer from the choices provided
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
What are the 12 colors of the spectrum called?
Answers: 1
You know the right answer?
HELP ASAP PLEASE AP Computer Science (JAVA)

You are working with a team of programmers...
Questions
question
History, 08.02.2021 23:40
question
Mathematics, 08.02.2021 23:40