Im abit confused about the problem im solving right now.
it says that i will create a program that would let me input any word, and count how many letters are there.
and afterwards i will also make another statement letting me input any letter,then the program would determine if the letter i entered is part of the word i entered.
im only until the input of the word and the letter count.
here's my unfinished code
import java.util.*;
class array
{
public static void main(String[]args)
{
Scanner input=new Scanner(System.in);
String a;
int x;
boolean[]word=new boolean[52];
System.out.println("Please enter a word: ");
a=input.next();
System.out.println("There word "+a+" has "+a.length()+" letters");
for(x=0;x<a.length();x++)
{
word[x]=true;
}
}
}
heres the expected complete output
Please enter a word: notebook
The word notebook has 8 letters
Please enter any letter: k
Letter k is part of the word notebook
i need help :( i really know nothing about boolean arrays.