• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Count the number of vowels, words, and sentences.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys I am trying to make a program called word that uses the a text file called output in order to:
1) Count the number of words.
2) Count the number of vowels (a,e,i,o,u *disregard y*)
3) Count the number of sentences.
4) Count the number of lines.
5) Count the number of punctuations.
6) Count the number of characters.

For my output text I have:


Now I tried doing this program in two different ways and I haven't been able to make any of them work so I will show you guys both ways I've done it.

***Here is my first attempt at the program.***





The errors I am getting with this one are:
a) Each "answer" is repeated like 3 times for some reason.
b) It won't read how many sentences I have in the output file.
c) It won't read how many punctuations I have in the output file.


***Here is my second attempt at the program.***



The error I am getting with this one are:
a) It erases the output text file and then give me the message "File is empty. Aborting Program"




Can anyone help me? I've been trying to get this program working for over three days...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic