Question: Problem 1: STRINGS Given two strings of lowercase English letters, A and B, perform the following operations: Sum the lengths of A and B. Determine
Problem 1: STRINGS
Given two strings of lowercase English letters, A and B, perform the following operations:
- Sum the lengths of A and B.
- Determine if A is lexicographically larger than B (i.e.: does B come before A in the dictionary?).
- Capitalize the first letter in A and B and print them on a single line, separated by a space.
Problem 2: Java Method Overrriding
class Sports{
String getName(){
return "Generic Sports";
}
void getNumberOfTeamMembers(){
System.out.println( "Each team has n players in " + getName() );
}
}
Write an overridden getNumberOfTeamMembers method that prints the same statement as the superclass' getNumberOfTeamMembers method, except that it replaces n with 11 (the number of players on a Soccer team).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
