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
sesenic [268]
3 years ago
10

Given a line of text as input, output the number of characters excluding spaces, periods, or commas.

Computers and Technology
2 answers:
Flauer [41]3 years ago
7 0

Answer:

<em>import java.util.Scanner;</em>

<em>public class ANot {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        System.out.println("Please enter a string of words");</em>

<em>        String n = in.nextLine();</em>

<em>        int count = 0;</em>

<em>        for (int i=0; i<n.length(); i++){</em>

<em>            if((n.charAt(i) != '.') &&(n.charAt(i) != ',') && (n.charAt(i) != ' ')){</em>

<em>                count++;</em>

<em>            }</em>

<em>        }</em>

<em>        System.out.println(count);</em>

<em>    }</em>

<em>}</em>

Explanation:

  1. Prompt User to input the string and assign to a variable
  2. SET count =0.
  3. Using a for loop iterate over the string
  4.  if((n.charAt(i) != '.') &&(n.charAt(i) != ',') && (n.charAt(i) != ' ')) then count =count +1.
  5.     PRINT count.

myrzilka [38]3 years ago
7 0

Answer:

user_text = input()

import re

str1= input("21 ")

pattern = '[a-zA-Z]'

count=0

i=0

while(i<=len(str1)-1):

  result = re.match(pattern, str1)

  if (result):

      count+=1

  else:

      continue

  i+=1

print("String Length:",count)

Explanation:

You might be interested in
Which of the following information is most important to include in a timeline
hoa [83]
The answer is C - or your third choice
6 0
3 years ago
Read 2 more answers
What are the two protocols used most often with iot devices? (select two. )
makkiz [27]

Z-Wave and Zigbee are the two protocols that are used most often with IOT devices.

<h3>What is a protocol?</h3>

A protocol can be defined as a formatted blocks of data that have been designed and established by professionals to obey a set of standard rules (conventions) such as Z-Wave and Zigbee.

In Computer networking, the two protocols that are used most often with Internet of Things (IOT) devices include the following:

  • Z-Wave
  • Zigbee

Read more on protocols here: brainly.com/question/17387945

#SPJ12

4 0
2 years ago
The first step to keeping your home safe is to minimize the overall amount of _______________ materials you store in your home.
Bingel [31]

Answer: The valuable, precious, or expensive items.

Explanation:

4 0
3 years ago
A cyber community is different than a physical community because _________________. A.people can go to restaurants to meet frien
jeka94
I believe the question is asking which of the options is true about a cyber community. In that case, only D is true, as a cyber community, such as facebook or instagram, gives you that ability. The rest of the options only apply to a physical community.
7 0
3 years ago
Choose the term that best matches the definition.
Y_Kistochka [10]

Answer: it’s network protocol

Explanation:

4 0
3 years ago
Other questions:
  • What is the purpose of inserting SmartArt in a Microsoft Office program? (1 point)
    11·2 answers
  • Karen has opened a new business and is using Google Display Ads to build awareness of her new products. How does Google Display
    6·1 answer
  • What kind of information B2B SaaS companies wish to know about their competition, apart from information about their competitors
    15·1 answer
  • When planning a presentation, there are several factors you need to consider. Which of the following is one factor you should co
    8·1 answer
  • Write a program to complete the task given below: Ask the user to enter any 2 numbers in between 1-10 and add both of them to an
    8·1 answer
  • Write a Python program that prompts the user for the cost of two items to be purchased. Then prompt the user for payment. If the
    11·1 answer
  • Generalized goals are more likely to be achieved than specific goals. True or False
    7·1 answer
  • You use a Windows desktop system to edit and produce audio files. Your system has two hard disks installed. Your applications ar
    10·1 answer
  • Helppppppppppppppp me please Can i have help for a ggogle class room
    5·1 answer
  • How to clear a function in functional component react.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!