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]
2 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]2 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]2 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
Does anyone know what the name of the game is, where you click on the grey dots in a 3x3 grid and try to make them all the same
antoniya [11.8K]

Answer:

Its the pattern puzzle game.

Explanation:

The answer is straight forward. Its a pattern puzzle game, and here we need to change everything to same color, and that is a pattern of this pattern game. Many forms of such pattern games are available, but this one happens to be the most popular among them all, and is widely used by various people of all ages to pass their time.

3 0
2 years ago
Select the correct answer.
Softa [21]

Answer:

MY ANSWER IS B.

Explanation:

B.A+(B.C)

3 0
3 years ago
What is a computer attack where an attacker accesses a wireless computer network, intercepts data, uses network services, and/or
Harman [31]

Answer:

The correct answer to the following question is Drive-by hacking .

Explanation:

Drive-by hacking is the type of hacking which comes under the cyberterrorism.

Drive-by hacking is the hacking where the hackers can access their data and steal their data, use their network services from some "safe" distance without going inside the company or an organization.

Drive-by download is the type of download of the malicious code into your mobile devices or the computers which occur by designed and it leave you to the cyberattack.

7 0
3 years ago
Comment if u wanna text me on behance
kow [346]

Answer:

what is behance? :)

Explanation:

4 0
3 years ago
You were discussing software piracy with a friend and were surprised to learn how software piracy can impact your life every day
Vika [28.1K]
Those who use pirate software:
<span>1)Increase the chances that the software will not function correctly or will fail completely
2)Forfeit access to customer support, upgrades, technical documentation, training, and bug fixes
3)Have no warranty to protect themselves
4)Increase their risk of exposure to a debilitating virus that can destroy valuable data
5)May find that the software is actually an outdated version, a beta (test) version, or a nonfunctioning copy
6)Are subject to significant fines for copyright infringement</span>
5 0
3 years ago
Other questions:
  • You just read an msds for acetic acid. based on what you read, what type of information is included in an msds sheet? record you
    7·1 answer
  • Using ajax technologies and apis, websites and applications can pull information from a variety of sources in order to create __
    8·1 answer
  • Write a program that implement a bubble sort ?
    5·1 answer
  • Files with what two file extensions are commonly known as tarballs??
    8·1 answer
  • shapes polymorphism Create a set of classes derived from an abstract class Shape, which provides a common interface, for managin
    7·1 answer
  • What privacy risks do new technologies present,<br> and how do we decide if they're worth it?
    11·1 answer
  • WILL GIVE BRAINLIEST!!!!!!!
    10·2 answers
  • What kind of skill is persuasion?
    7·1 answer
  • (Java) Write a program that accepts a number of minutes and converts it both to hours and days. For example, 6000 minutes is 100
    10·1 answer
  • In addition to good design sense, what else do web designers need to be proficient in?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!