Question: Create a class called CIE106Finals. Inside the class, Implement the two methods; equalInHas(String str) and reOrder56(Int[] nums) described below. Use the main( ) to test

Create a class called CIE106Finals. Inside the class, Implement the two methods; equalInHas(String str) and reOrder56(Int[] nums) described below. Use the main( ) to test each of the two methods by storing there return values Inside a variable and using println( ) to output the values In those variables.

Given a string of characters, write a static method equalInHas(String str) that returns true if the number of occurrences of "in" anywhere in the string is equal to the number of occurrences of "has" anywhere in the string (case sensitive). e.g equalInHas ("inside the vessel it has to be or not in") false equalInHas ("Thin has ") true equalInHas("hasviooininhshastyion") true Note: only a single loop is allowed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!