title: Method to check if the string contains certain elements that accepts a parameter String
body: <p>I am a student and kind of new to Java. For my homework I have to:</p>
  <ul>
  <li><p>Ask the user to input a number (at least 7) using a do while loop.</p>
  </li>
  <li><p>Using a for loop I am required to ask the user to input <code>that</code> number of words.</p>
  </li>
  <li><p>Then I have to check if one of the words fulfills the given conditions:</p>
  </li>
  </ul>
  <p><em>The word must:</em></p>
  <ol>
  <li>Start with an uppercase letter</li>
  <li>End with a number</li>
  <li>Contain the word &quot;cse&quot;.</li>
  </ol>
  <p>I am asked to create a method inside some code homework that does a specific task, the method should check all the required conditions, the name of the method should be <code>countTest</code> and <em>it accepts the String as a parameter</em>.</p>
  <p>I will show you my code but I don't know how to create this specific method.</p>
  <hr />
  <p><strong>Output format</strong></p>
  <pre><code>System.out.println(&quot;There as a total number of words &quot; + count + &quot; and 
  the ones that fulfill the condition are: &quot; + condition);
  </code></pre>
  <hr />
  <p>The problem is, I dont know how to create the method or constructor or whatever it is called that calls all of the 3 methods inside it, and then connect that particular method to the main method!
  I hope you guys can understand I am new to this, thank you in advance!</p>
  <p><a href="https://i.stack.imgur.com/s3DW6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s3DW6.png" alt="enter image description here" /></a></p>
  <pre><code>public class D6_6 {
      public static void main(String[]args){
          Scanner sc = new Scanner(System.in);
          System.out.println(&quot;Type a number that is at least 7&quot;);
          int number = sc.nextInt();
          int count = 0;
          int condition = 0;
          do{
              if(number&lt;7){
                  System.out.println(&quot;You should type a number that is at least 7 or higher&quot;);
                  number = sc.nextInt();
              }
  
          }
          while(number&lt;7);
          sc.nextLine();
          String str;
          for(int i =0; i&lt;number; i++){
              System.out.println(&quot;Type a word&quot;);
              str = sc.nextLine();
              count++;
          }
      }
      public boolean countTest(String str)    {
  
  }```
  </code></pre>