how to do this? write a c++ program that given the name of a text file reads that file and counts the number occurrences of each alphabetic letter in the text. treat upper and lower case instances of a letter as the same letter. hint: look up tolower()---testing the case isn't necessary. if ch is a char, then ch-'a' is a valid c++ expression and will evaluate to 0 when ch is equal to 'a'---try 'b', 'c', and 'd'!)..
really need your help..this is for my case study.
norEdz 0 Newbie Poster
Recommended Answers
Jump to PostBreak it down into manageable parts. I'd say start by reading the file character by character and simply writing those characters to cout.
Jump to Postcan you give me an example code please?
Not until you prove that you've done some work yourself. Please read our rules concerning homework.
Jump to PostOK, you're current program is not going to do what you want it to at all. If I were you, I'd start by looking at the question more carefully and breaking it down into a number of small parts.
So, the question is:
write a c++ program that given …
Jump to PostOK, I think that you're missing a vital piece of information that you're given in the question. ASCII is a widely used (look it up) set of rules about how text (specifically Roman characters) is represented in computers. In ASCII the letters 'a' to 'z' and 'A' to 'Z' are …
Jump to Postwhat do you mean my "Get a token from the file and convert it to a char, store it in ch
"?A token is a "chunk" of stuff from the file. In this case, it's going to go to the file and get everything from the first non-white-space character …
All 18 Replies
Narue 5,707 Bad Cop Team Colleague
norEdz 0 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
norEdz 0 Newbie Poster
brainfo -5 Junior Poster in Training
norEdz 0 Newbie Poster
ravenous 266 Posting Pro in Training
Cross213 -5 Posting Whiz in Training
norEdz 0 Newbie Poster
ravenous 266 Posting Pro in Training
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
norEdz 0 Newbie Poster
norEdz 0 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
ravenous 266 Posting Pro in Training
Hafiz Wajahat 0 Newbie Poster
rproffitt 2,701 https://5calls.org Moderator
David W 131 Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.