• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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...
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic