Question
Java write a single function, method, procedure, subroutine, etc., that can be called to solve it. 1 Given a list containing strings of text, determine
Java
write a single function, method, procedure, subroutine, etc., that can be called to solve it.
1
Given a list containing strings of text, determine the longest string (i.e., the string that contains the largest number of characters).
2
Read input from a user that is intended to be a consist of a license number (such as a driver's license number). If the input is not a valid license number, then ask again, and continue asking until the input is valid.
We'll say, for the purposes of this problem, that a license number must follow these rules in order to be valid:
It must consist only of uppercase letters and digits; anything else (including spaces) would make it invalid.
The first and last characters must be uppercase letters.
There must be at least one digit (and any number of uppercase letters) in between.
By these rules, the following are all valid license numbers: A123B, ABC1DEF, A1B2C3D4E. These would all be invalid: A123, 123B, ABCDEF, A1B2C3D4.
3
Given a string of text and a character to search for, count the number of times that the search character occurs in that string. For example, in the string Boo is not boolean, the search character appears five times, while the search character b appears once (because upper- and lowercase are considered distinct).
4
Given a string of text, determine whether it is a palindrome. A palindrome is text that consists of letters that would look the same whether you printed them in order or in reverse order. So, for example, HANNAH is a palindrome, but HELLO HELLO is not.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started