Question

C++ 1.0 Given the text file UAH_sample.txt  write a program that performs the following tasks: Find and...

C++

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.
      • all other punctuation can be counted as part of length
      • 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

The text file

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.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program:

#include<iostream>
#include<fstream>
using namespace std;
int main()
{
   fstream fin;
   int count[11] = {0};
   fin.open("UAH.txt");
   int len;
   string word;
   while (fin >> word)
   {
       len = word.length();
       if (len <= 10)
       {
           count[len]++;
       }
   }
   for (int i = 1;i <= 10;i++)
   {
       cout << i << " " << count[i]<<"\n";
   }
   return 0;
}

Add a comment
Know the answer?
Add Answer to:
C++ 1.0 Given the text file UAH_sample.txt  write a program that performs the following tasks: Find and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ 1.0 Given the text file UAH_sample.txt  write a program that performs the following tasks: Find and...

    C++ 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...

  • write a C++program to analyze a small subset of the data that has been collected. See...

    write a C++program to analyze a small subset of the data that has been collected. See file universities.txt .Use precisely seven parallel arrays: one for name of university, one for state, one for city, one for yearly tuition, one for enrollment, one for average freshman retention, and one for the percent of students who graduate with in six years. Note that the percentage of student accepted is not stored.An output file is opened in main() and remains open until the...

  • Please!!! need help asap!!!! write a C++program to analyze a small subset of the data that...

    Please!!! need help asap!!!! write a C++program to analyze a small subset of the data that has been collected. See file universities.txt .Use precisely seven parallel arrays: one for name of university, one for state, one for city, one for yearly tuition, one for enrollment, one for average freshman retention, and one for the percent of students who graduate with in six years. Note that the percentage of student accepted is not stored.An output file is opened in main() and...

  • Case 2-9 Racially Charged Language Inhibits Inclusive Cultures Leaving home for the first time and going...

    Case 2-9 Racially Charged Language Inhibits Inclusive Cultures Leaving home for the first time and going off to college is an exciting and stressful time for tens of thousands of students across the U.S. each year. Leaving the familiarity of family, friends, and community behind and entering an often much more diverse community filled with people with different social, political, religious, racial, national, and sexual orientation backgrounds can create challenges. Luckily, there is currently an effort across the United States...

  • Item 1 In the case below, the original source material is given along with a sample...

    Item 1 In the case below, the original source material is given along with a sample of student work. Original Source Material Suppose you study a group of successful companies and you find that they emphasize customer focus, or quality improvement, or empowerment; how do you know that you haven't merely discovered the management practice equivalent of having buildings? How do you know that you've discovered something that distinguishes the successful companies from other companies? You don't know. You can't...

  • Item 4 In the case below, the original source material is given along with a sample...

    Item 4 In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button. Original Source Material Student Version Television and radio editorials--when they rarely occur--are usually bland; typically, they are opposed to sin and for freedom. But too many newspaper editorials are the same, and newspapers do not have a federal license that might be taken away. The unspoken motto that hangs over...

  • Item 1 In the case below, the original source material is given along with a sample...

    Item 1 In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button. Original Source Material Student Version In the 1986 soccer World Cup final, the Argentine star Diego Maradona did not score a goal but his passes through a ring of West German defenders led to two Argentine goals. The value of a star cannot be assessed only by looking at his...

  • For a C program hangman game: Create the function int play_game [play_game ( Game *g )]...

    For a C program hangman game: Create the function int play_game [play_game ( Game *g )] for a C program hangman game. (The existing code for other functions and the program is below, along with what the function needs to do) (Also the link to program files (hangman.h and library file) is below the existing code section. You can use that to check if the code works) What int play_game needs to do mostly involves calling other functions you've already...

  • Write 3 paragraphs for reflection and should be do the following: 1. In first paragraph, Summarize...

    Write 3 paragraphs for reflection and should be do the following: 1. In first paragraph, Summarize the article (attached below). (Don't plagiarism from article. Please use your own words to summarize article below) 2. In second paragraph, Connect the article with one of those "biological variation in modern humans" or "cultural anthropology" or "how identity and worldview are deeply influenced by cultural upbringing" or "human pre-history, human social interaction, and human cultures". Be specific about the connections you make. 3....

  • Case Study 1: Should a Computer Grade Your Essays? Would you like your college essays graded...

    Case Study 1: Should a Computer Grade Your Essays? Would you like your college essays graded by a computer? Well, you just might find that happening in your next course. In April 2013, EdX, a Harvard/MIT joint venture to develop massively open online courses (MOOCs), launched an essay-scoring program. Using arti ficial intelligence technology, essays and short answers are immediately scored and feedback tendered, allowing students to revise, resubmit, and improve their grade as many times as necessary. The non-profit...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT