Question
In C++ String Processing: Use the string processing functions we covered in class (length(), size(), find( ), substr( ), at( ), erase( ), insert( ),
In C++
String Processing: Use the string processing functions we covered in class (length(), size(), find( ), substr( ), at( ), erase( ), insert( ), replace( ) and append in the problems below. Remember if you need to reset a file to the beginning you can use infile.seekg(0, ios::beg);
1.0 Given the text file UAH_sample.txt write a program that performs the following tasks:
- Find and count all words that are from 1 to 10 letters long. Print the results to the screen as a table.
- Special circumstances:
- You should not count punctuation at the end of the sentence as part of the word. Just erase the punctuation or subtract 1 from the length.
- Do not count numbers as words.
- You do not need to remove apostrophes. Just count that as part of the length.
- Multiple words connected by dashes, like state-of-the-art, can be counted as one long word
- The table below shows the actual counts after punctuation has been removed.
-
Word Length Count
1 12 2 87 3 109 4 80 5 49 6 56 7 48 8 33 9 24 10 24
- Special circumstances:
- Count the number of times each letter (A_Z, a-z) appears in the file. Print (to the screen) a table of each letter and the number of times it appears. You do not need separate counts for upper and lowercase. Ignore all characters that are not letters. (NOTE: The functions in Appendix C2 may be helpful here.)
Given an input letter find and print to the screen all words that begin with that letter. Check for both uppercase and lowercase letters beginning a word. Show results for letters a, r and u.
- Using the original UAH_sample.txt file replace each occurrence of UAHuntsville with UAH. Create a new file with the updated text. Upload the new file to canvas along with your other documents.
The .txt file mentioned above The University of Alabama in Huntsville was founded in 1950 and became an autonomous campus with The University of Alabama System in 1969. Since that time, it has grown into one of the nation's premiere research universities, offering a challenging hands-on curriculum that ensures our graduates are prepared to become tomorrow's leaders. Why GO to UAHuntsville? Our beautiful 400-acre campus is in the heart of Huntsville, Alabama. Also known as the Rocket City, Huntsville has all the perks of nearby big cities like Nashville and Atlanta but with less traffic and a lower cost of living. Not to mention, we enjoy a mild climate perfect for year-round outdoor activities and entertainment. And right across the street from campus are a number of major federal and industry employers like Redstone Arsenal, NASA, and Cummings Research Park. So it's no wonder Huntsville was recently ranked in the top ten of Money Magazine's list of "Where the jobs are," giving our graduates an unparalleled competitive edge when starting their careers! What will you LEARN at UAHuntsville? Everything you'll need to know! Our five colleges: Liberal Arts, Engineering, Nursing, Science, and Business Administration offer over 80 areas of study. And as a tier-one research university, we have more than a dozen research centers, as well as numerous labs and facilities, to allow our students to get hands-on experience in the field of their choosing. But unlike many other, larger research universities, at UAHuntsville you won't get lost in the crowd. Our small class sizes and low faculty-to-student ratio ensures personalized attention, while our Student Success Center provides the resources you need to succeed inside the classroom and beyond. Who will you BE at UAHuntsville? Yourself! Thanks to our vibrant campus life, there's plenty of space for you to fit in and stand out no matter what your interests. UAHuntsville is home to over 120 student-run organizations, six sororities and six fraternities, and many popular annual events that bring the campus community together on a regular basis. We also have 14 NCAA teams, including the only NCAA ice hockey team in the South, in addition to plenty of intramural and club sports. And you'll feel right at home in one of our five staffed residence halls, all within easy walking distance of the University Fitness Center, our awesome on-campus dining options, and our brand-new state-of-the-art student center. UAHuntsville is home to nearly 8,000 students from across the country and the world. But while our student body may be diverse, our campus community is nothing short of inclusive! That's because we make campus housing available to all first-year students, which allows strong peer-to-peer friendships to grow from day one. And in two of our residence halls, you'll find themed communities where you can live and interact with others who share your interests. But being a Charger is about more than just fitting in; it's about standing out and being a leader on campus and in the community. To help, we've created a strong leadership program to enable you to excel outside of the classroom and make a smooth transition from collegian to careerist skills you can also learn by joining one of UAHuntsville's many student-run organizations or holding a position in the Student Government Association. No matter what role you choose, at UAHuntsville your student experience is just as valuable as your education.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started