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
What is the output?
Vinvika [58]

Answer:

20

Explanation:

4 0
3 years ago
All objects in an object-oriented program are instantiated (created) from a ____.
Nuetrik [128]

Answer:

Class is the correct answer for the above question.

Explanation:

In an object-oriented language, The class is a structure type template, which is used to define the structure but the class does not take memory when an object is created then it takes the memory of class type. For example, if a user-defined class of one member whose size is 4 bit if its store in memory. When a user creates an object, then the object size is 4 bit.

That's why the class is an only structure while an object is used to give the memory for class member and the member of the class also get executed by the object of that class. class have no existence if object is not created. so when a user wants to create a object, he needs to create the object by the help of class name because class is user defined data type and object is variable of that class.

Then the answer of the above question is that object is created with the help of class which is described above.

6 0
3 years ago
Sarah used a grid to create this layout for a website. Which rule of composition did Sarah use for the grid?
Nana76 [90]

Answer:

B rule of thirds

Explanation:

4 0
3 years ago
Read 2 more answers
How do I answer a question on Brainly.com without an “oops” notification?
Paul [167]
You just type in the answer as long as it is more then 20 characters
3 0
3 years ago
Read 2 more answers
Which person would be the best fit for a career in the Information Technology field?
zaharov [31]
The best possible fit would be a person with a creative mind and flexible mind. 
The technical stuff can be taught and learnt. But to evolve and keep up with the pace of how technology improves day to day, you'd need some with flexibility to cope up with this and creativeness to make innovations.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Double clicking a word selects the entire word?
    9·2 answers
  • ________ is the abbreviation for the place in the computer where the programs and data the computer is currently using are store
    8·1 answer
  • • Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links, of rates R1= 500 kbps, R2
    15·1 answer
  • HURRY!! Ill give brainily and 25 points. Describe how Scent is related to the culture and historical period when it was created.
    15·1 answer
  • A(n) _______________ is a collection of configuration and security settings that an administrator has created in order to apply
    14·1 answer
  • To implement a small database, a database designer must know the "1" and the "M" sides of each relationship and whether the rela
    13·1 answer
  • Given that Apache and Internet Information Services (IIS) are the two most popular web application servers for Linux and Microso
    10·1 answer
  • ........ is a formal description of message formats and the rules for exchanging those messages
    12·1 answer
  • What is the meaning of photography​
    5·2 answers
  • PLEASE HELP
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!