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
Prior to the world wide web as we know it today, the internet was chaotic, without any ____.
atroni [7]
Search engines - there was no single way to ask a question
5 0
4 years ago
Consider this program segment: int newNum = 0, temp; int num = k; // k is some predefined integer value 0 while (num &gt; 10) {
Doss [256]

Answer:

All of these statements are true.

Explanation:

Since the while loop is reversing the integer number and leaving the highest order digit in the num and stores the reversed number in the newNum variable.

It skips one digit so if the num is in the range of [100,1000] it will result in a number between 10 and 100.

This loop can never go in infinite loop for any initial value of num because the loop will run as many times as the number of digits.

and if the value of the num is <=10 the while loop will never run and the value of newNum will be 0.

6 0
4 years ago
What is the shortcut key to apply /remove the subscript effect?<br> Ctrl+=<br><br> Ctrl-+
telo118 [61]

Answer:

Press "Ctrl, "Shift" and "=" on your keyboard to turn off superscript formatting.

5 0
3 years ago
Which one of the following sstatements suggests a good method
PilotLPTM [1.2K]
The 2nd onnnnneeeeeee
7 0
3 years ago
The illustration shows different types of text language.
Dvinal [7]

nawww dude im good look it up

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which statement is unnecessary inside the unit test for the custom controller?
    9·1 answer
  • For most applications, saving sound files at the _____ bit resolution provides a good balance of sound quality and file size.
    15·2 answers
  • On a camera,what does focus tracking do?
    6·1 answer
  • Jacob would like to include an arrow in his newsletter to point to some important information. He should _____.
    14·2 answers
  • PHP Create a for loop that initialize with the variable $i = 10 The loop outputs $i as long as $i is greater than 1 using for lo
    9·1 answer
  • How does an individual's access to a wide range of online services affects their ability to operate safely in the digital world.
    5·1 answer
  • In a non-price rationing system, consumers receive goods and services first-come, first served. Give me an example of a time whe
    8·1 answer
  • Randy is concerned about his company’s data security on the Internet. Because cellular signals are not encrypted, he is concerne
    8·1 answer
  • Released in 1976, the Apple I was Apple Computer's first product.<br><br> O True<br> O False
    6·1 answer
  • Prior to the 1996 NEC, ____ receptacles and cords were permitted. However, now it is mandatory that a separate equipment groundi
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!