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 happens to runt frames received by a cisco ethernet switch?
Nikolay [14]

Answer:

thank you sa point labyu stay safe

5 0
2 years ago
The first tools that analyzed and extracted data from floppy disks and hard disks were MS-DOS tools for ____ PC file systems.
netineya [11]

<u>The first tools that analyzed and extracted data from floppy disks and hard disks were MS-DOS tools for </u><u>IBM</u><u> PC file systems</u>. A file system is a structured representation of data and a set of metadata describing this data. The file system of the IBM supports stream input/output and storage management, providing a structure over all information stored in the system. A floppy disk consists of a thin plastic disk coated with magnetic material (it was designed by IBM in the early 1970s). A hard disk is fixed on the system unit. It is made up of several circular disks called platters. MS-DOS (Microsoft Disk Operating System) is a licensed operating system for use on microcomputers from various manufacturers.

6 0
3 years ago
Egovernment involves the use of strategies and technologies to transform government by improving the delivery of services and en
aleksandrvk [35]
I guess the answer True
3 0
3 years ago
How to solve level 53 on rapid router?
alexgriva [62]

&lt;img src=/static/game/image/actions/go.svg alt=' + ugettext(play= button)= += '= style=width: 4%;&gt; ) def noPermissionMessage():

6 0
2 years ago
Write a program that reads in two integers typed on the keyboard and outputs their sum, difference, and product.
dsp73
# Written in python

a = int(input("Enter an integer: "))
b = int(input("Enter an integer: "))

sum = a + b

# subtract the smaller number from the bigger
if a < b:
    dif = a - b
else:
    dif = b - a

prod = a * b

print("The sum is", sum)
print("The dif is", dif)
print("The product is", prod)
6 0
3 years ago
Other questions:
  • What role do you think mobile devices have played in shaping the world?
    13·1 answer
  • Paulene is using this table in Word,and she started with the cursor in the box that read “Flavor”. she then hits Alt+End,The the
    7·1 answer
  • Software that helps run the computer's hardware devices and coordinates instructions between applications is called
    10·1 answer
  • Make a program that (i) asks the user for a temperature in Fahrenheit degrees and reads the number; (ii) computes the correspond
    8·1 answer
  • Why is Abraham called the Father of Believers?
    6·1 answer
  • (Complete the Problem-Solving discussion in Word for Programming Challenge 2 on page 404. Your Problem-Solving discussion should
    13·1 answer
  • Supports traditional transactional processing for day-to-day front-office operations or systems that deal directly with the cust
    11·1 answer
  • What is the main difference between a peripheral device and other types of devices? Choose the best answer.
    12·1 answer
  • Create a text file content.txt and copy-paste following text (taken from Wikipedia) into it: A single-tasking system can only ru
    7·1 answer
  • Guys, please help me asap (Photo Attached) !!!!!!! HELP 25pts!!!!
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!