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
Complete the below method, isPalindrome(), that takes in a String and returns a boolean. The boolean should be true if the Strin
Salsk061 [2.6K]

Answer:

public static boolean isPalindrome(String word) {

   //TODO: Complete this method

   String reverse = "";  

       for (int i = (word.length()-1); i>=0; i--) {

           if(word.charAt(i)!=' '){

               reverse+=word.charAt(i);

           }

       }

   String without_space = word.replaceAll(" ", "");

   

   return reverse.equals(without_space);

   }

5 0
3 years ago
what option can be used to create vpn connections that can be distributed to users' computers so that vpn clients do not have to
IRINA_888 [86]

This option can be used to create virtual private network (VPN) connections that can be distributed to users' computers so that VPN clients do not need to be configured on each client station is a VPN connection profile.

Users can send and receive data over shared or public networks as if their computer equipment were physically connected to a private network using a virtual private network (VPN), which extends the private network over the public network.

Increased functionality, security, and private network administration are all benefits of a VPN. It is often used by remote workers and allows access to resources that are not available on the public network. Although not an essential part of a VPN connection, encryption is often used.

By using dedicated circuits or tunneling protocols over existing networks, a VPN can be created by creating a virtual point-to-point connection.

To know more about VPN click here:

brainly.com/question/28945467

#SPJ4

6 0
1 year ago
What languages other than English are spoken in the United States?
tester [92]
Chinese, Spanish, French, Tagalog, Korean and German all exceed a million active speakers.
5 0
3 years ago
Which is not an example of a boolean operator?
allochka39001 [22]
1. Because is not an example of and Boolean operator

2. Google is the internets top search engine

I hope this helped
3 0
3 years ago
Read 2 more answers
13./ Write a java program to input an integer N and compute its factorial. Print the number and the factorial.
antoniya [11.8K]

Answer:

Código Java de forma recursiva que nos ayuda a calcular el factorial de ... El factorial de un número es la multiplicación de los número que van del ... Para expresar el factorial se suele utilizar la notación n! ... mayo 5, 2010 - 4:13 am ... un programa q de un numero dado en arabigo o romano lo imprima ya

Explanation:

Espero te sirva!!

3 0
2 years ago
Other questions:
  • The specifications for ____ are developed by the world wide web consortium (w3c) and are continually evolving.
    13·1 answer
  • What Is the output of the following: =OR (5 <7, 16*Rand ()>23,FALSE)
    5·1 answer
  • How is a correction made to an Electronic health record?
    14·1 answer
  • Eye wash stations should contain enough water to provide ______ minutes of continuous use
    5·2 answers
  • What is adobe photoshop?
    10·2 answers
  • Which statement describing the arcade games played in the 1970s is true?
    14·1 answer
  • The Ocean Medallion is a wearable device that connects virtually to various devices on board a cruise ship. When a guest is wear
    14·1 answer
  • If anyone knows how to code on python:
    8·1 answer
  • Which of the following are true about algorithms? (You may select more than one)
    12·1 answer
  • What are 3 customizations that can be done using the header/footer section in the customize reports tray?.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!