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
Alenkasestr [34]
3 years ago
8

Count input length without spaces, periods, or commas Given a line of text as input, output the number of characters excluding s

paces, periods, or commas. You may assume that the input string will not exceed 50 characters.
Ex: If the input is:
Listen, Mr. Jones, calm down.
the output is:
21
Note: Account for all characters that aren't spaces, periods, or commas (Ex: "r", "2", "!").
Can I get this in C programming please?
Computers and Technology
2 answers:
MrRa [10]3 years ago
6 0

Answer:

This program is implemented in C++ using dev C++.  The solution of this answer along with running code is given below in explanation section.

Explanation:

#include <iostream>

#include<string>

using namespace std;

int main()

{

   string str;

   

cout<<"Enter String \n";

 

getline(cin,str);/* getLine() function get the complete lines, however, if you are getting string without this function, you may lose date after space*/

 

   //cin>>str;

 

   int count = 0;// count the number of characeter

   for (int i = 1; i <= str.size(); i++)//go through one by one character

   {

     

   

    if ((str[i]!=32)&&(str[i]!=44)&&(str[i]!=46))//do not count  period, comma or space

 {

           ++ count;//count the number of character

       }

   }

   cout << "Number of characters are  = "; //display

cout << count;// total number of character in string.

   return 0;

}

}

Ivanshal [37]3 years ago
5 0

Answer:

user_text = input()

import re

string = ( "listen, Mr. Jones, calm down.")

print(len(re.sub(r'[,.\s]+', '', string)))

Explanation:

You might be interested in
Write a function named "json_filter" that takes a JSON formatted string as a parameter in the format of an array of objects wher
7nadin3 [17]

Answer:

Check the explanation

Explanation:

kindly check the well written code below to get the solution to your question.

import json

def json_filter(input_string):

   jsonFormat = json.loads(input_string)

   result = []

   for obj in jsonFormat:

       if obj["temperature"] > 38.46:

           result.append(obj)

   return json.dumps(result)

7 0
3 years ago
Which of the following statements are true concerning abstraction and refinement? Select 3 options:
Akimi4 [234]

Answer:

The answer to this question is given below in the explanation section

Explanation:

First,  we need to know what is abstraction and refinement.

Abstraction and refinement are used in application/system development in the field of computing. Abstraction is used to abstract the details from the model. It means that displaying only essential information about the the model and hiding other details. While refinement is the idea that is used in software development by moving through each level of abstraction and incrementally refining each level of abstraction, providing more detail at each increment. Refinement is the inverse of abstraction.  

So the correct options to this question are:

  • Models may be abstracted and refined depending on the goals of the project.
  • Abstraction is a technique used in computational thinking.
  • Refinement is the inverse of abstraction.

5 0
3 years ago
In C#/ Write an application that computes the area of a circle, rectangle, and cylinder. Display a menu showing the three option
irga5000 [103]

Answer:

five nth cut gthrjhyyvhthtcycyhtbycuvhcyhcxhuffffvgxxv,-:

7 0
3 years ago
Of the 5 factors that should be evaluated when assessing information's quality (Validity, Reliability, Accuracy, Timeliness, and
Art [367]
Validity is the best asseng information to evaluate the all factors
8 0
2 years ago
What can a human still do better and faster than any Machine Learning (ML)<br> solution?
Ann [662]

Answer:

judge the quality of any given data

4 0
2 years ago
Other questions:
  • How does a hard drive work
    14·1 answer
  • When you move or size a control in the Form Designer, Visual Studio automatically adjusts the ________________ that specify the
    9·1 answer
  • A URL suffix is called a domain name.
    11·1 answer
  • As we learned in the unit, basic speech is developed during the toddler years. To what extent do you think a toddler’s speech is
    7·1 answer
  • Your computer crashed, and you lost many personal and work-related files. You just got a new computer, but you are now much more
    8·2 answers
  • Consider the following process for generating binaries. A compiler is used to generate the object code for individual modules, a
    8·1 answer
  • The frame header at the Data Link layer includes hardware addresses of the source and destination NICs. What is another name for
    11·1 answer
  • As related to the use of computers, ____ is defined as gaining unauthorized access or obtaining confidential information by taki
    10·1 answer
  • Explain the importance of system software in the computer​
    8·1 answer
  • All languages require the code which is simply a word that means _____.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!