1 answer

THIS MUST BE SOMETHING NEW AND DIFFERENT from NORMAL ANSWERS You must write a complete code...

Question:

THIS MUST BE SOMETHING NEW AND DIFFERENT from NORMAL ANSWERS

You must write a complete code in C PROGRAMMING Language using FILE Handling

  1. Use ABSOLUTE PATH SPECIFICATION
  2. Read a passage or text from a file named “research.txt”
  3. Remove all the present a,e,i,o,u basically all vowels from any word i.e. word must look like wrd after it removes the o from it, in the given text
  4. Save data in the new file named “proposal.txt”

THINGS TO CONSIDER

  • YOU MAY USE FUNCTIONS OR DO IT WITHOUT FUNCTIONS
  • USE POINTERS IF NEEDED
  • MAKE IT AS SIMPLE AS POSSIBLE
  • USE COMMENTS TO HIGHLIGHT EACH main command.

DATA

research.txt has the following data

The newly-civilized Enkidu leaves the wilderness with his consort for the city of Uruk, where he learns to help the local shepherds and trappers in their work.

One day, when Gilgamesh himself comes to a wedding party to sleep with the bride, as is his custom, he finds his way blocked by the mighty Enkidu, who opposes Gilgamesh‘s ego, his treatment of women and the defamation of the sacred bonds of marriage.

Enkidu and Gilgamesh fight each other and, after a mighty battle, Gilgamesh defeats Enkidu, but breaks off from the fight and spares his life.

He also begins to heed what Enkidu has said, and to learn the virtues of mercy and humility, along with courage and nobility.

Both Gilgamesh and Enkidu are transformed for the better through their new-found friendship and have many lessons to learn from each other. In time, they begin to see each other as brothers and become inseparable.


Answers

Given below is the code for the question. Please do rate the answer if it helped. Thank you.


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void processFile(char inFilename[], char outFilename[]);
int isVowel(char c);
void removeVowels(char words[]);

int main(){
   char inFilename[100] = "research.txt";
   char outFilename[100] = "proposal.txt";
  
   processFile(inFilename, outFilename);
   return 0;
}

void processFile(char inFilename[], char outFilename[]){
   char line[1024];
   char word[25];
   FILE *in = fopen(inFilename, "r");
   FILE *out = fopen(outFilename, "w");
  
   if(in == NULL){
       printf("ERROR: could not read input file %s\n", inFilename);
       return;
   }
  
   fgets(line, 1024, in);
   while(!feof(in)){
       removeVowels(line);
       fprintf(out, "%s", line);
       fgets(line, 1024, in);
   }
  
   fclose(in);
   fclose(out);
   printf("Output file %s created\n", outFilename);
}

  
int isVowel(char c){
   if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'
       || c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U')
       return 1;
   else
       return 0;
}

void removeVowels(char str[]){
   char *dest, *src;
   src = str;
   dest = str;
  
   //go over each char and remove it if it is vowel. Keep a track of src i.e. char being processed and dest i.e the position where the char will be written if its not vowel.
   //the original string is modified.
   while(*src){
       if(!isVowel(*src)){
           *dest = *src;
           dest++;
       }
       src++;
   }
  
   *dest = '\0'; //terminate the string
      
}

-----------------------
proposal.txt (created by program)
--------------
Th nwly-cvlzd nkd lvs th wldrnss wth hs cnsrt fr th cty f rk, whr h lrns t hlp th lcl shphrds nd trpprs n thr wrk.

n dy, whn Glgmsh hmslf cms t wddng prty t slp wth th brd, s s hs cstm, h fnds hs wy blckd by th mghty nkd, wh ppss Glgmsh‘s g, hs trtmnt f wmn nd th dfmtn f th scrd bnds f mrrg.

nkd nd Glgmsh fght ch thr nd, ftr mghty bttl, Glgmsh dfts nkd, bt brks ff frm th fght nd sprs hs lf.

H ls bgns t hd wht nkd hs sd, nd t lrn th vrts f mrcy nd hmlty, lng wth crg nd nblty.

.

Similar Solved Questions

1 answer
Suppose the electric potential is given by V(r) = Ar3 - Br?, where A = 6.66...
Suppose the electric potential is given by V(r) = Ar3 - Br?, where A = 6.66 V/m2 and B = 3.33 V/m2. At what value of r is the electric field due to this potential zero?...
1 answer
A proton H is spin coupled to n equivalent protons. The NMR of H will be...
A proton H is spin coupled to n equivalent protons. The NMR of H will be splitting .... number of peaks? a) n b) n+1 c) n+2 d) 4n e) none of above...
2 answers
P 4-42 (similar to Question Help You have just turned 22 years old, received your bachelors...
P 4-42 (similar to Question Help You have just turned 22 years old, received your bachelors degree, and accepted your first job. Now you must decide how much money to put into your retirement plan. The plan works as follows: Every dollar in the plan eams 7.1% per year. You cannot make withdrawals un...
1 answer
Voc, Rr = ? 6? 3? 12 V(+ 2i OC
Voc, Rr = ? 6? 3? 12 V(+ 2i OC...
1 answer
3.13 pts D Question 15 A payoff table is given below and the probabilities of s1,...
3.13 pts D Question 15 A payoff table is given below and the probabilities of s1, s2, and s3 are 0.3, 0.4, and O.3, respectively, what is the expected opportunity loss of the best decision? s3 s2 s1 750 d1 250 500 d2 300 -250 1200 500 600 d3 500 530 625 280 385 810 Next Previous 4...
1 answer
6. (8 marks) Suggest a synthetic route for the following transformation (flowchart only but include reagents...
6. (8 marks) Suggest a synthetic route for the following transformation (flowchart only but include reagents required); several steps are involved and you may need to call on some of the reactions that you learned in CHEMY102. &o &...
1 answer
How do you find the derivative of #y=ln ln(3x^3)#?
How do you find the derivative of #y=ln ln(3x^3)#?...
1 answer
Determine the concentrations of K2SO4, K+, and SO42-in a solution prepared by dissolving 1.35x 10-4 g...
Determine the concentrations of K2SO4, K+, and SO42-in a solution prepared by dissolving 1.35x 10-4 g K2SO4 in 2.50 L of water. Express all three concentrations in molarity. Additionally, express the concentrations of the ionic species in parts per million (ppm). Note: Determine the formal concentra...
1 answer
Mathematical Statistics with Applications 7th Edition question 9.69, 9.80, 9.89 solutions pls
Mathematical Statistics with Applications 7th Edition question 9.69, 9.80, 9.89 solutions pls...
1 answer
18.2 Two-level cache performance A processor with two levels of caches has a CPI of 1...
18.2 Two-level cache performance A processor with two levels of caches has a CPI of 1 when there is no level-1 cache miss. At level 1, the...
1 answer
Essay: Discuss the use of an Ethics committee within a hospital setting: who comprises this team?...
Essay: Discuss the use of an Ethics committee within a hospital setting: who comprises this team? What is their duties? 50 word essay:...
1 answer
Part 1) Every Space and Entire Building needs to have an air balance, supply air must...
Part 1) Every Space and Entire Building needs to have an air balance, supply air must equal return plus outside air, ventilation air. Ventilation air must have the prescribed outside air quantity, ASHRAE 62, plus the amount of outside air to balance the space exhaust air, plus the amount of air requ...
1 answer
Pla solve it in word
1) Mitchell Electronics produces a home video game that has become very popular with children. Mitchell’s managers have reason to believe that Wright Televideo Companyis considering entering the market with a competing product. Mitchell must decide whether to set a high price to accommodate en...
1 answer
Need help Draw the major organic product for the following reaction. Do not draw counterions or...
need help Draw the major organic product for the following reaction. Do not draw counterions or byproducts. Miya...
1 answer
Write a response summary essay about Fiesta, 1980 reader point of view
write a response summary essay about Fiesta, 1980 reader point of view...
1 answer
QUESTION 1 contain costs while retaining the patient's choice of physician while following the fee-for-service type...
QUESTION 1 contain costs while retaining the patient's choice of physician while following the fee-for-service type of payment. Health Maintenance Organizations (HMO) Preferred Provider Organizations (PPO) Point-of-Service Plans (POS) Health Savings Accounts (HCA)...