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
telo118 [61]
2 years ago
15

. Write a short program that asks the user to input a string, and then outputs the

Computers and Technology
1 answer:
Mice21 [21]2 years ago
7 0

Answer:

// program in java.

// package

import java.util.*;

// class definition

class Main

{

// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // object to read input from user

Scanner scr=new Scanner(System.in);

System.out.print("Enter a string:");

 // read input

String myString=scr.nextLine();

 // variable to store characters count

int char_count=0;

 // count the characters

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

           if(myString.charAt(i) != ' ')

               char_count++;

       }

       // print the number of character

System.out.println("total characters in the String: "+char_count);

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read a string from user with the help of Scanner object and assign it to variable "myString".Iterate over the string and if character is not space (' ') then char_count++. After the loop print the number of characters in the string.

Output:

Enter a string:hello world

total characters in the String: 10

You might be interested in
You are a desktop administrator for nutex corporation. Your organization uses ethernet cable to connect network resources. A use
anygoal [31]

Answer:

A. replace the network cable

Explanation:

Based on the information provided within the question it can be said that in this scenario the best option would be to replace the network cable. The network cable refers to the Ethernet cable that is connected to the individuals personal computer. This cable being faulty is most likely the reason as too why the individual is not able to connect. Since it is displaying that signals return too early it means that there is most likely information being lost in transit.

4 0
3 years ago
Choose all items that represent HTML characteristics.
hram777 [196]

Answer:

A,C,D,E are the answers at least on the test i took

Explanation:

3 0
3 years ago
Read 2 more answers
How does a cloud-first strategy differ from other approaches to cloud?
Irina18 [472]

Cloud-first strategy differ from other approaches as It keeps all the services performed by legacy systems while moving to the Cloud in a staggered approach.

<h3>What is a cloud first strategy?</h3>

The change of cloud computing has brought about  “cloud-first” strategy.

This  is known to be a way to computing that tells that a firm should look first to cloud solutions when creating new processes or taking in old processes before taking in non-cloud-based solutions.

Note that Cloud-first strategy differ from other approaches as It keeps all the services performed by legacy systems while moving to the Cloud in a staggered approach.

See options below

it enables an organization to completely move to the cloud without infrastructure or support requirement

it keeps all the services performed by legacy systems while moving to the cloud in a staggered approach.

it partners technology with multiple other disciplines for comprehensive business transformation.

it uses artificial intelligence to automate all business processes and completely eliminate human error.

Learn more about cloud from

brainly.com/question/19057393

#SPJ1

6 0
2 years ago
Select the correct answer.
irinina [24]

Answer:

A

Explanation:

6 0
3 years ago
When computer users have trouble with their machines or software, Roland is the first person they call for help. Roland helps us
Schach [20]

Answer:

The correct answer is A) Support Analyst

Explanation:

From the question, we can see that Roland is familiar with both machines and software. He is familiar with the operations of both parts of a computer to the end that he can attempt a fix. And if he can't he knows who to refer the end-users to. Usually, some IT personnel that is more experienced.

From the above points, we can safely say that Roland is an IT Support Analyst. He cannot be the Systems analyst because Systems Analysts are usually at the top of the Pyramid. They take on problems that are referred upwards to them from support analysts.

Cheers

3 0
2 years ago
Other questions:
  • Why will the standard replacement algorithms (LRU, FIFO, clock) not be effective in handling this workload for a page allocation
    11·1 answer
  • Which are malicious codes? <br><br> JavaScript <br> Key loggers <br> Scrum <br> Spyware <br> Worms
    12·1 answer
  • For conditional formatting, a formula must be in the form of a(n) _____ test that results in a true or false value. Question 1 o
    8·1 answer
  • What allows people to create their own radio shows over the internet?
    14·1 answer
  • Your manager asks you to calculate the sale price if the product is marked down 20 percent. You enter the original price in cell
    9·1 answer
  • Differences between Quality of Services and a Service of Quality approach
    9·1 answer
  • Please help me answer this question
    14·1 answer
  • Adobe reader is a type of​
    14·2 answers
  • To excel at these professions, you need to be able to combine an eye for elegant design with a mind that delights in efficient o
    8·1 answer
  • What type of dns record holds the dnssec public signing key?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!