Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome. Let's consider a word too long if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation. This abbreviation is made like this: we write down the first and the last letter of a word and between them, we write the number of letters between the first and the last letters. That number is in decimal system and doesn't contain any leading zeroes. Thus, "localization" will be spelled as "10n", and "internationalization» will be spelled as "il8n". You are suggested to automatize the process of changing the words with abbreviations by using the Java program that implements the static method capitalization(). At that, all too long words should be replaced by the abbreviation and the words that are not too long should not undergo any changes. Input The first line contains an integer n (1sns100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

(Consider the structure that the code must have. It is shown at the end of the task and the code must have the same structure)

Examples
Input
4
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
Output
word
110n
i18n
p43s
Requested files
Solution.java
1- public class Solution {
public static void main(String[] args) {
// add your code here
// code must use abbreviate() method as part of solution
}
2 -
4
6.
private static String abbreviate(String word) {
// add your code here
}
8
9
10
Transcribed Image Text:Examples Input 4 word localization internationalization pneumonoultramicroscopicsilicovolcanoconiosis Output word 110n i18n p43s Requested files Solution.java 1- public class Solution { public static void main(String[] args) { // add your code here // code must use abbreviate() method as part of solution } 2 - 4 6. private static String abbreviate(String word) { // add your code here } 8 9 10
Instructions:
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.
Let's consider a word too long if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.
This abbreviation is made like this: we write down the first and the last letter of a word and between them, we write the number of letters between the first and
the last letters. That number is in decimal system and doesn't contain any leading zeroes.
Thus, "localization" will be spelled as "1On", and "internationalization» will be spelled as "il8n".
You are suggested to automatize the process of changing the words with abbreviations by using the Java program that implements the static method
capitalization((). At that, all too long words should be replaced by the abbreviation and the words that are not too long should not undergo any changes.
Input
The first line contains an integer n (1sns100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the
lengths of from 1 to 100 characters.
Output
Print n lines. The i-th line should contain the result of replacing of the ith word from the input data.
Examples
Input
4
word
Transcribed Image Text:Instructions: Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome. Let's consider a word too long if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation. This abbreviation is made like this: we write down the first and the last letter of a word and between them, we write the number of letters between the first and the last letters. That number is in decimal system and doesn't contain any leading zeroes. Thus, "localization" will be spelled as "1On", and "internationalization» will be spelled as "il8n". You are suggested to automatize the process of changing the words with abbreviations by using the Java program that implements the static method capitalization((). At that, all too long words should be replaced by the abbreviation and the words that are not too long should not undergo any changes. Input The first line contains an integer n (1sns100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. Output Print n lines. The i-th line should contain the result of replacing of the ith word from the input data. Examples Input 4 word
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY