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
Get step-by-step solutions from verified subject matter experts
