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
scoray [572]
3 years ago
6

Write a program that prompts the user to enter a text and displays the number of vowels and consonants in the file. Use a set to

store the vowels A, E, I, O, and U.
Computers and Technology
1 answer:
bulgar [2K]3 years ago
7 0

Answer:

Using python

Explanation:

fileName = input("Enter the file to check: ").strip()

infile = open(fileName, "r")

vowels = set("A E I O U a e i o u")

cons = set("b c d f g h j k l m n p q r s t v w x y z B C D F G H J K L M N P Q R S T V W X Y Z")

text = infile.read().split()

countV = 0

for V in text:

if V in vowels:

countV += 1

countC = 0

for C in text:

if C in cons:

countC += 1

print("The number of Vowels is: ",countV,"\nThe number of consonants is: ",countC)

You might be interested in
Which command compiles the java source code file welcome.java?
shutvik [7]
"javac <FILE NAME>" (unsurprisingly, stands for "java compile"), will compile your java source code in to a .java file, that can be run with the "java <FILE NAME>" command.

Make sure that your command prompt is set to the right destination when you run these commands, using "cd <DESTINATION>", otherwise they may be unable to find them in the incorrect destination.
3 0
4 years ago
What is a clutch on a car
grandymaker [24]
<span>The first stage in the transmission of a car with a manual gearbox is the clutch.</span>
6 0
4 years ago
Sort short_names in reverse alphabetic order.
tangare [24]

lst = short_names.split()

print(sorted(lst,reverse = True))

6 0
3 years ago
A programmer is responsible for solving a problem and making a presentation that includes his solution. He does not have much ro
sashaice [31]

Probably 2 but that's just a guess.


5 0
3 years ago
Read 2 more answers
Explain what the World Wide Web is, including several tasks that can be accomplished online. Include definitions of the followin
Alja [10]

Answer:

<u>World Wide Web (WWW):</u>

The World Wide Web (WWW) or the Web, which was invented by Tim Berners-Lee in the year 1989, is an information system of internet servers containing web pages where specially formatted documents and resources, supported by Hypertext Transfer Protocol or HTTP, can be located by Uniform Resource Locators (URLs) with other hypertext links. Technical definition of the world wide web can be " all the user and resources using an HTTP protocol''.

<u>Web-page:</u>

A web page can be defined as the solitary page of a website. When a user wants to access a webpage, it can be accessed using a single URL, and that page can be copied and shared. Unlike a website, no navigation is required to view the webpage.  

It may contain text, graphics, audio, video, downloadable hyperlinks for other pages, etc. Web browsers are used to display web page content on a computer or mobile by connecting to the server. Some of these documents have to use Flash or Java to view the information.

<u>Downloading:</u>

Downloading means receiving data from a remote system to a local system or initiating any such data transfer. There are some similar remote systems from which one can download. A download can mean the process of obtaining a file that has been submitted or downloaded for downloading, or any such type of file.

<u>Website:</u>

A website is a collection of interconnected web-pages, publicly available on the Internet, that share a domain name. Exchange of information can be done by the website. It can also be used to provide entertainment, news, and education.

A website is a means of obtaining information through the Internet. Special programs are used to view websites on computers, which are called web browsers.

Websites are found on the web-server. Every website has an Internet address which is called URL. The web-browser displays the website according to this address. The web-browser uses HTTP script (HTTP) to access them.

<u>Web server:</u>

A web server is a software that serves web pages, that is, software that transmits web pages to users. This can be divided into two parts: the machine on which the web-server is installed and the software that acts as a web server. These are the first hardware and the second software.

6 0
4 years ago
Other questions:
  • The code that follows saves the data that was in the $names array as
    13·1 answer
  • Consider the following business environment.
    14·1 answer
  • Which one of the following oscilloscope controls is used to move the trace up and down the screen vertically? A. Focus B. Sweep
    9·2 answers
  • How to write a program converting RGB to CMYK in python
    6·1 answer
  • An attacker captures an encrypted message. he tries decrypting with every possible key until the decryption process reveals a se
    14·1 answer
  • What are the best ways to find data within a spreadsheet or database? Check all that apply. sorting tools the help function scro
    11·2 answers
  • In excel, the applied theme has a set of complimentary ________, which are defined sets of formatting characteristics, such as f
    12·1 answer
  • Discuss the 21 st century competencies or skills required in the information society and 4 ways you can apply it during supporte
    6·1 answer
  • True or false: It can take some time for the labs to load once you click “start lab.”
    7·1 answer
  • P*********** is considered a serious social problem justify this statement​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!