1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Fittoniya [83]
3 years ago
6

9.17 LAB: Acronyms An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose input is

a phrase and whose output is an acronym of the input. If a word begins with a lower case letter, don't include that letter in the acronym. Assume there will be at least one upper case letter in the input.
Computers and Technology
1 answer:
AlexFokin [52]3 years ago
6 0

Answer:

Hence the code is given as follows,

import java.util.Scanner;

public class LabProgram {

   public static String createAcronym(String userPhrase){

       String result = "";

       String splits[] = userPhrase.split(" ");

       for(int i = 0;i<splits.length;i++){

           if(splits[i].charAt(0)>='A' && splits[i].charAt(0)<='Z')

               result += splits[i].charAt(0);

       }

       return result;

   }

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       String s = scan.nextLine();

       System.out.println(createAcronym(s));

   }

}

You might be interested in
You check the ip address on a host on the network. the address is 122.16.155.71 with a mask of 255.0.0.0. what is the broadcast
Sveta_85 [38]
122.255.255.255






--------------------------------
8 0
4 years ago
Most wheel/tire assemblies are balanced using lead weights which should be removed and segregated from other metals
crimeas [40]
The answer is true. I took the test.
6 0
3 years ago
Read 2 more answers
Size of a MAN can range from ​
Dovator [93]

Answer:

According to the latest CDC stats, these are the average heights for U.S. adult men based on age:

Ages 20 to 39: 176.1 centimeters

Ages 40 to 59: 175.8 centimeters

Age 60 and older: 173.4 centimeters

6 0
4 years ago
State five differences between selecting and highlighting ​
exis [7]

Answer: The difference between highlighting the text and selecting the text is highlighting is when you change the highlight/back color of the text and selecting is when you temporarily highlight it to change a certain part.

Explanation:

5 0
3 years ago
What are the two parts of a cell reference? column intersection and row range column range and row intersection column letter an
Natasha_Volkova [10]

Answer:

C - Column letter & row number

7 0
3 years ago
Read 2 more answers
Other questions:
  • A(n) _____ is the highest educational degree available at a community college. master bachelor associate specialist
    13·2 answers
  • Given a scanner reference variable named input that has been associated with an input source consisting of a sequence of integer
    14·2 answers
  • If you print a document with red green or blue underlines will they show up on printed pages
    14·1 answer
  • What does the shell of an operating system do
    14·1 answer
  • Which of the following best describes a group?
    13·1 answer
  • Toby has lost valuable data on his computer a number of times due to system crashes caused by viruses. He decides to invest in a
    13·1 answer
  • Which of the following is considered a modern method of communication?
    7·2 answers
  • Generally speaking, the _______ the risk, the _______ the potential return or loss
    8·2 answers
  • Does anyone know what i did wrong?
    13·1 answer
  • What is the missing line of code? &gt;&gt;&gt; &gt;&gt;&gt; math.sqrt(16) 4.0 &gt;&gt;&gt; math.ceil(5.20) 6
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!