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
zaharov [31]
3 years ago
14

Write a program with a function that accepts a string as an argument and returns the number of uppercase, lowercase, vowel, cons

onants, and punctuation that the string contains. The application should let the user enter a string and should display the number of uppercases, lowercases, vowels, consonants, and punctuations that the string contains.
Computers and Technology
1 answer:
diamong [38]3 years ago
8 0

Answer:

Explanation:

The following code is written in Python. It is a function called checkString that takes in a string as an argument and loops through each char in that string and checking to see if it is lowercase, uppercase, vowel, consonant, or punctuations. It adds 1 to the correct variable. At the end of the loop it prints out all of the variables. The picture below shows a test output with the string "Brainly, Question."

def checkString(word):

   uppercase = 0

   lowercase = 0

   vowel = 0

   consonants = 0

   punctuation = 0

   vowelArray = ['a', 'e', 'i', 'o','u', 'y' ]

   consonantArray = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']

   punctuationArray = ['.', '!', '?', ',', ';', '(', ')']

   for char in word:

       if char.isupper():

           uppercase += 1

       else:

           lowercase += 1

       if char.lower() in vowelArray:

           vowel += 1

       elif char.lower() in consonantArray:

           consonants += 1

       if char in punctuationArray:

           punctuation += 1

   print('Uppercase: ' + str(uppercase))

   print('Lowercase: ' + str(lowercase))

   print('Vowels: ' + str(vowel))

   print('Consonants: ' + str(consonants))

   print('Punctuations: ' + str(punctuation))

You might be interested in
When a new word processing software program is released, companies that might use it must consider not only the cost of buying i
Alexus [3.1K]

When a new word processing software program is released, companies that might use it must consider not only the cost of buying it, but the costs of retraining all their employees to use it, and of training their support staff to install and operate it. These additional costs beyond the purchase price are known as <u>c. transformation </u>

Explanation:

  • Software cost estimation is the process of predicting the effort required to develop a software system.
  • As a number of these models rely on a software size estimate as input, we first provide an overview of common size metrics.
  • We then highlight the cost estimation models that have been proposed and used successfully.
  • Transformation Costs means the total difference between Price paid by Nortel Networks for the Product and total Material Cost, and includes Material Overhead, Labour Cost, Overhead Cost, Warranty Costs, Profit, Cost of Logistics Operations
  • Cost transformation work focuses on simplifying, refocusing and strengthening your business, so you can pursue growth & a better customer experience.
  • Transformational Cost Management Program charges are recognized as the costs are incurred over time in accordance with GAAP.

4 0
3 years ago
Write a program to demonstrate circular linked list with operations using pointers – insert
BabaBlast [244]

A program to demonstrate circular linked list with operations using pointers is:

struct Node *addToEmpty(struct Node *last, int data)

{

   // This function is only for empty list

   if (last != NULL)

     return last;

 

   // Creating a node dynamically.

   struct Node *temp =

         (struct Node*)malloc(sizeof(struct Node));

 

   // Assigning the data.

   temp -> data = data;

   last = temp;

   // Note : list was empty. We link single node

   // to itself.

   temp -> next = last;

 

   return last;

}

<h3>What is a Circular Linked List?</h3>

This refers to the type of linked list in which the first and the last nodes are also joined together other to form a circle

Read more about circular linked list here:

brainly.com/question/12974434

#SPJ1

5 0
2 years ago
How can rows be added to a table? Check all that apply
svlad2 [7]
<h2><em>1) By drawing a row in the table using the draw option. </em></h2><h2><em> </em></h2><h2><em>2) By using the insert option under the Table Tools tab. </em></h2><h2><em> </em></h2><h2><em>3) By designing the table with an added row using the Design tab.</em></h2><h2><em></em></h2><h2><em>HOPE IT HELPS (◕‿◕✿)</em></h2>
6 0
3 years ago
Read 2 more answers
Which symbol would be used in a flowchart to represent a connection to another part of the flowchart
Lisa [10]
The answer is an arrow
3 0
3 years ago
Software that translates the sound of human voice into text is called:________.
S_A_V [24]

Answer:

C) speech recognition software.

Explanation:

Software that translates the sound of human voice into text is called a speech recognition software.

In Computer science, a speech recognition software is a voice technology application or program which enables the conversion of human voice such as spoken language to computer commands such as text through the use of speech recognition algorithms.

Some examples of speech recognition software are HTK, Kaldi, Voice navigator, Julius etc.

6 0
3 years ago
Other questions:
  • kevin is working on a financial project that involves a lot of statistical information. He needs software that allows him to ent
    8·2 answers
  • The Internet and World Wide Web allow almost any business to be global. What are two important results of this process?
    8·1 answer
  • What is a good way to minimize technical problems with your computer
    10·1 answer
  • How can you remove heat from a computer?
    10·1 answer
  • HELP PLZ !!
    13·1 answer
  • Problem 5. (Greatest Common Divisor) Write a program gcd.py that accepts p (int) and q (int) as command-line arguments, and writ
    13·1 answer
  • Write a Python program segment, using a loop, to calculate and print the sum of the odd integers from 20 to 120. (Hint: 21 23 25
    13·1 answer
  • Can somebody do an Algorithm 2 for more?<br> (Python)
    15·1 answer
  • Write a recursive method called sumTo that accepts an integer parameter n and returns a real number representing the sum of the
    12·1 answer
  • In order to control access to a company's intranet and other internal networks, all communications pass through a _____ server.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!