Exercise 3: Given the input text file shown in Figure 1. Write a Python program that reads this text file, and then calculates the number of vowels and consonants in each line. Your program should calculate the total probability of vowels and consonants.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question
100%

By using files:

Please Write Python program design at the beginning of program:define the purpose, Input /output data and Algorithm

and please write the program testing ( for cases that could happen)

Exercise 3: Given the input text file shown in Figure 1. Write a Python program that reads this
text file, and then calculates the number of vowels and consonants in each line. Your program
should calculate the total probability of vowels and consonants.
Input text file
Oman is an Arab country on the southeastern coast of the Arabian Peninsula
in Western Asia.
Holding a strategically important position at the mouth of the Arabian
Gulf.
From the late 17th century, the Omani Sultanate was a powerful empire.
Some Program outputs:
In line
In line
In line
1 there are
33 vowels and 42 consonants
2 there are
25 vowels and 39 consonants
3 there are
22 vowels and 33 consonants
Figure 1. Input text file and Program output.
Transcribed Image Text:Exercise 3: Given the input text file shown in Figure 1. Write a Python program that reads this text file, and then calculates the number of vowels and consonants in each line. Your program should calculate the total probability of vowels and consonants. Input text file Oman is an Arab country on the southeastern coast of the Arabian Peninsula in Western Asia. Holding a strategically important position at the mouth of the Arabian Gulf. From the late 17th century, the Omani Sultanate was a powerful empire. Some Program outputs: In line In line In line 1 there are 33 vowels and 42 consonants 2 there are 25 vowels and 39 consonants 3 there are 22 vowels and 33 consonants Figure 1. Input text file and Program output.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Computational Systems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr