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
Random access memory is the portion of a computer's primary storage that does not lose its contents when one switches off the po
brilliants [131]

Answer:

False

Explanation:

The RAM does lose its memory when you turn off the computer, unlike hard drive which is slower but keeps memory

4 0
3 years ago
Read 2 more answers
Two system administrators who work in two different buildings for the same company want to open a communication channel between
xz_007 [3.2K]

Bridge communication is the best solution to continue two different building for the same company.

<u>Explanation:</u>

Bridge communication to be placed in both building.master device should be placed in one building where should be connected to a high-end server and the slave device should be placed in another device.

Both the master device and salve should have a subsequent TCPIP address. For example, if the master  TCPIP address is 192.168.1.51 and the salve Tcpip address should be 192.168.1.52.

Very easy configure and communication is established. Both devices should be connected with nonstop current interruption. Once communication established speed depends on device capacity.

8 0
3 years ago
Why is statistics important?
kenny6666 [7]

The answer is A.؜؜؜؜؜؜؜؜؜؜؜؜؜؜؜؜؜؜

7 0
3 years ago
Given two objects represented by the tuples (22, 1, 42, 10) and (20, 0, 36, 8):
Rudik [331]

Answer:

Given,

P = (22, 1, 42, 10)

Q = (20, 0, 36, 8)

a. Formula for Euclidean Distance :

distance = ((p1-q1)^2 + (p2-q2)^2 + ... + (pn-qn)^2)^(1/2)

Now,

distance = ( (22-20)^2 + (1-0)^2 + (42 - 36)^2 + (10-8)^2) ) ^(1/2)

=( (2)^2 + (1)^2 + (6)^2 + (2)^2 ) ) ^(1/2)

=(4+1+36+4)^(1/2)

=45^(1/2)

Distance = 6.7082

b.Manhattan distance :

d = |x1 - x2| + |y1 - y2|

d = |22- 20| + |1 - 0|

d = |2| + |1|

Explanation:

4 0
2 years ago
What is the device manager in windows 8?
astraxan [27]
This is the answer hope it helps :D

5 0
3 years ago
Other questions:
  • Which of the following statements best compares and contrasts the role of story writers and script writers
    12·1 answer
  • Which of the following jobs is considered part of the information technology industry?
    15·2 answers
  • A marketing associate wants to use the Validate button to ensure an email is CAN-SPAM compliant. What information does the assoc
    5·2 answers
  • When does a soft page break occur in a document
    9·1 answer
  • Suppose testcircle1 and circle1 in listing 9.1 are in two separate files named testcircle1.java and circle1.java, respectively.
    14·1 answer
  • 7.) Title text boxes on every slide must be the same format. <br> A. True <br> B. False
    15·2 answers
  • Write the algorithm and draw a flowchart to display the greatest number among any two different numbers....
    5·1 answer
  • Which line of code will find the first occurrence of a three in an array?
    5·2 answers
  • Which type of protocol allows for a secure data transmission using encryption methods?
    7·1 answer
  • Sebutkan contoh komputer analog, komputer digital, dan komputer hybrid
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!