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
If a user inserts a piece of clip art over some text but does not want the art to block the text, the user should select
Yuri [45]

Answer:

send backward

Explanation:

4 0
3 years ago
Read 2 more answers
A ______________ is a way of taking a screenshot or a picture of your computer screen. ​
andre [41]

Answer:

prt scan+Windows logo

8 0
3 years ago
The entire presentation can be seen at a time in __________
Alenkasestr [34]

Answer:

Rehearse and time or slide view tab

Explanation:

I think it can be seen in slide view tab at the left side of the powerpoint window if you want to see them only but if you want the whole presentation with graphics,animation then Rehearse and time option can be used.

4 0
3 years ago
A queueing system has four crews with three members each. The number of "servers" is:
pentagon [3]

Answer:

The answer is 4.

The number of active servers is four for this four crew queuing system.

Explanation:

 Now what is a queue management system?

As from the name it has some link with queue which means it’s not something used once or twice.

It is a continuous process. In simple words, the number of processes increases and the severs get short and congested on this type of problem this management occurs.

It is always there to solve the problem of congestion the system.

Queuing management is concerned with queuing areas. Where there will a queue this system will be applied. And this queuing system is based on queuing theory.

<u>Now what means by queuing areas? </u>

It’s a place where queues happen.

<u> But what exactly is a queue? </u>

You could say it’s a line of something waiting for services or you can also say it as an application of “demands exceed the supply” problem.

Now consider queuing system where the number of active servers depends upon the the length of the queue.

As the length of the queue increases the number of active servers will increase and if the length of the queue decreases the number of active servers decreases.

On traditional scale the queuing theory, the theory on which this queuing system is based, there are fixed number of servers for each model as 10,25 or 19 servers.  

Now if we see there is a queuing system has four crews with 3 members each.

Each crew will have its own one single active server so, there will be 4 active servers in this queuing system.

6 0
3 years ago
Read 2 more answers
A variation of pronounce is a. Proclaim c. Produce b. Profound d. Pronunciation Please select the best answer from the choices p
Rashid [163]

The answer, according to my knowledge, is (d) <em>pronunciation.</em>

<em />

<em>- Lee Hae :) Have a great day!</em>

3 0
3 years ago
Other questions:
  • Which cloud computing service model gives software developers access to multiple operating systems for testing?
    5·1 answer
  • Jeremy Aronoff has purchased a new laptop. He wants to customize the operating system to meet his
    7·1 answer
  • In an income statement subtracting the cost of goods sold from the net sales provides the?
    11·1 answer
  • Given the following while() loop, which statement is true assuming A,B,C,D are int variables and A &gt; B? while ( ( A &gt;= B)
    8·1 answer
  • What is the purpose of application software
    12·1 answer
  • Discuss two business information systems that are used in two different sectors in a modern economy.
    11·1 answer
  • Write, in your own words, a one-two paragraph summary on the Running Queries and Reports tutorials. Apply critical thinking and
    10·1 answer
  • Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume there's enou
    13·1 answer
  • Consider the following code.
    7·2 answers
  • How to make a Java GUI application? Discuss each step needed.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!