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
marishachu [46]
3 years ago
11

(1) Prompt the user to enter a string of their choosing. Output the string.

Computers and Technology
1 answer:
barxatty [35]3 years ago
6 0

Answer:

See solution below

See comments for explanations

Explanation:

import java.util.*;

class Main {

 public static void main(String[] args) {

   //PrompT the User to enter a String

   System.out.println("Enter a sentence or phrase: ");

   //Receiving the string entered with the Scanner Object

   Scanner input = new Scanner (System.in);

   String string_input = input.nextLine();

   //Print out string entered by user

   System.out.println("You entered: "+string_input);

   //Call the first method (GetNumOfCharacters)

   System.out.println("Number of characters: "+ GetNumOfCharacters(string_input));

   //Call the second method (OutputWithoutWhitespace)

   System.out.println("String with no whitespace: "+OutputWithoutWhitespace(string_input));

   }

 //Create the method GetNumOfCharacters

   public static int GetNumOfCharacters (String word) {

   //Variable to hold number of characters

   int noOfCharactersCount = 0;

   //Use a for loop to iterate the entire string

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

     //Increase th number of characters each time

     noOfCharactersCount++;

   }

   return noOfCharactersCount;

 }

 //Creating the OutputWithoutWhitespace() method

 //This method will remove all tabs and spaces from the original string

 public static String OutputWithoutWhitespace(String word){

   //Use the replaceAll all method of strings to replace all whitespaces

   String stringWithoutWhiteSpace = word.replaceAll(" ","");

   return stringWithoutWhiteSpace;

 }

}

You might be interested in
What is the correct sequence of the phases in the systems development life cycle?
HACTEHA [7]
1. Requirements gathering/analysis.
2. Design.
3. Development.
4. Testing.
5. Maintenance.
7 0
4 years ago
(MCQ question). Which of the following files stores information about a local Google Drive installation such as User email ID, L
Harlamova29_29 [7]

Answer:

Sync_config.db

Explanation:

With the help of this file we can find the following information of our google drive.

  1. Google Drive version  
  2. local sync root path  
  3. User email address
8 0
3 years ago
PI
siniylev [52]

Explanation:

As the qn was copy pasted from another document...the qn seems incorrect... and incomplete..

pls see to it and attach the correct qn...

sorry

4 0
3 years ago
The theory advanced by Adam Smith,
tester [92]

Answer:

Definition: The unobservable market force that helps the demand and supply of goods in a free market to reach equilibrium automatically is the invisible hand. Description: The phrase invisible hand was introduced by Adam Smith in his book 'The Wealth of Nations'.

so ans is the invisible hand

hope help full thnk u❤️❤️❤️

3 0
3 years ago
Which symbols identify cpt codes that are also listed in specific cpt appendices?
aksik [14]

The symbols which  identify CPT codes that exist also listed in specific CPT appendices are plus, forbidden, star.

<h3>What is CPT codes?</h3>

Current Procedural Terminology (CPT) exists as a medical code set that is used to report medical, surgical, and diagnostic techniques and services to entities such as physicians, health insurance companies, and accreditation institutions.

Appendix N exists a list of CPT codes that do not emerge in their respective numerical sequence in the listing in the CPT book. The sequenced codes will be located close but not in proper numerical sequence. This appendix is included to avoid deleting and including to renumber a series of codes to fit in a new one.

The Current Procedural Terminology (CPT®) codes offer doctors and health care professionals a uniform terminology for coding medical services and techniques to streamline reporting, and increase accuracy and efficiency.

Hence, The symbols which  identify CPT codes that exist also listed in specific CPT appendices are plus, forbidden, star.

To learn more about CPT codes refer to:

brainly.com/question/12596394

#SPJ4

8 0
2 years ago
Other questions:
  • A smart refrigerator can use _____ to detect when you are running low on milk, and then send a reminder to you on a wireless net
    14·1 answer
  • Using caller id is part of which step in an effective time management plan
    10·1 answer
  • Queue is the LIFO structure.<br><br> o True<br><br> o False
    8·1 answer
  • In an oligopolistic market, consumer choice is?
    12·2 answers
  • Google Glass, glasses that allow you to take pictures and search online by speaking commands, are introduced at a technology tra
    8·1 answer
  • To access documents stored on a "cloud", you'll
    12·1 answer
  • IF ANYONE ANSWERS YOUR QUESTION WITH SOMETHING LIKE THIS:
    10·2 answers
  • ________is one of the most popular payment gateways founded in in December 1998​
    8·1 answer
  • 6. Write a C++ program to print the largest three elements in an array. <br>​
    10·1 answer
  • If you have created users with administrator privileges on your windows 7 or linux systems, why bother creating other user accou
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!