Question Description
An important aspect of using files, is to be able to extract certain data from a large chunk of data in a file and then be able to use it to perform calculations.
So in order to practice basics of it, We will Write a program which gives the user the option to separate, Vowels or Consonant from a given text from a file. We will display the separated data (Vowels & Consonants) on screen and also store it in output file.
Note: We will be using similar logic to the one we had used in lab 4 to determine whether the user entered character was a vowel or consonant, but here we will be getting data(more than 1 character) from a file.
Please find the input file in the files directory.
Name of the input file to be used is: SeparateConVow.dat
The input file has following Text within it:
THIS IS THE FINAL PROJECT FOR OUR CLASS
Hint: Length of the text is 32, useful to be used in a loop.
Sample Runs:
Run 1:
Enter name of input file: i.datEnter name of output file: o.dat
Would you like to separate Vowels or Consonant, Please press 1 for Vowel, 2 for consonant :
1
Vowels in the string are :
I I E I A O E O O U A
Run 2:
Enter name of output file: o.dat
Would you like to separate Vowels or Consonant, Please press 1 for Vowel, 2 for consonant :
2
Consonant in the string are :
T H S S T H F N L P R J C T F R R C L S S
Note: Please make use of GSA Office hours on Thursday (1pm to 3pm) & Lab times(11am to 11:50am, 3pm to 5pm) on Friday for assistance using Microsoft teams.
Also feel free to email or message me on teams for assistance.
Point Distribution:
- -50 Does not compile
- -5 Warnings
- -5 No description multiple line comments (name, date, etc)
- -5 No single line comments (logic, input, output, etc)
- -10 did not store data to output file.
- -10 If Does not check for failure to open the input file
- -10 if the program does not prompt the user for Input for file name
This question has not been answered.
Create a free account to get help with this and any other question!
Brown University
1271 Tutors
California Institute of Technology
2131 Tutors
Carnegie Mellon University
982 Tutors
Columbia University
1256 Tutors
Dartmouth University
2113 Tutors
Emory University
2279 Tutors
Harvard University
599 Tutors
Massachusetts Institute of Technology
2319 Tutors
New York University
1645 Tutors
Notre Dam University
1911 Tutors
Oklahoma University
2122 Tutors
Pennsylvania State University
932 Tutors
Princeton University
1211 Tutors
Stanford University
983 Tutors
University of California
1282 Tutors
Oxford University
123 Tutors
Yale University
2325 Tutors