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
Look at the slide.
svetlana [45]

Answer:

c

Explanation:

5 0
3 years ago
Read 2 more answers
Edhesive assignment 4
Agata [3.3K]

Answer:

nrToCheck = int(input("How many numbers do you need to check? "))

nrEven = 0

nrOdd = 0

for i in range(nrToCheck):

 number = int(input("Enter number: "))

 if (number % 2):

   nrOdd = nrOdd + 1

   print("{} is an odd number".format(number))

 else:

   nrEven = nrEven + 1

   print("{} is an even number".format(number))

print("You entered {} even number(s).".format(nrEven));

print("You entered {} odd number(s).".format(nrOdd));

7 0
3 years ago
Which technique/concept can be use toimplement multiple inheritances<br> in java?
LiRa [457]

Answer:

Interface

Explanation:

Java does not supports multiple inheritance by class, but we can implement multiple inharitacnce in  java using interface, with interface we uses implements keyword.

Example-

Declare interface like below code -

interface parent{

}

and use in child class like below code -

class Child1 implements interface{

}

class Child2 implements interface{

}

8 0
3 years ago
I'll give brainlist to right answers
xeze [42]
I think it’s number 1. Check the answer first.
5 0
3 years ago
Joe, a user, reports to the help desk that he can no longer access any documents on his PC. He states that he saw a window appea
posledela

Answer:

The answer is most likely B) Trojan.

Explanation:

8 0
3 years ago
Other questions:
  • Encryption is the process of:
    12·1 answer
  • list six external parts or peripherals of a computer system and identify which are output and which are input devices
    8·1 answer
  • Which actions help to protect a computer and keep it running properly? Check all that apply.
    10·1 answer
  • What is a mortgage?
    8·2 answers
  • Ricardo twists his ankle at work but does not immediately realize that he is injured because his ankle is not sore or swollen, a
    5·1 answer
  • Software is giving instructions so that text is displayed on the monitor. This software is an example of _____.
    7·2 answers
  • Yall tryna play gta later? I play on ps4
    12·2 answers
  • Giving brainliest if you answer question.
    8·1 answer
  • If the list [8,1,4,2,10,0] is sorted with the selection sort algorithm, what is the list at the 4th step of the algorithm?
    13·1 answer
  • 8.6 Code Practice: Question 2
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!