Absolute C++
Absolute C++
6th Edition
ISBN: 9780133970784
Author: Walter Savitch, Kenrick Mock
Publisher: Addison-Wesley
bartleby

Videos

Textbook Question
Book Icon
Chapter 9, Problem 2PP

Write a program that will read in a line of text and output the number of words in the line and the number of occurrences of each letter. Define a word to be any string of letters that is delimited at each end by either whitespace, a period, a comma, or the beginning or end of the line. You can assume that the input consists entirely of letters, whitespace, commas, and periods. When outputting the number of letters that occur in a line, be sure to count uppercase and lowercase versions of a letter as the same letter. Output the letters in alphabetical order and list only those letters that occur in the input line. For example, the input line

I say Hi.

should produce output similar to the following:

3 words

1 a

1 h

2 i

1 s

1 y

Blurred answer
07:25
Students have asked these similar questions
Write a program that reads the contents of two sentences and compares them in the following ways: (e.g. first sentence: We are Python programmers from Computer Science Department of xyz College. Second sentence: We learned Python programming knowledge and skills from Python class at Computer Science Department of xyz college).• It should display a list of all the unique words contained in both sentences.• It should display a list of the words that appear in both sentences.• It should display a list of the words that appear in the first sentence but not the second.• It should display a list of the words that appear in the second sentence but not the first.• It should display a list of the words that appear in either the first or second sentence but not both.Hint: Use set operations to perform these analyses.
The internet enables people to network, join a cause, take a poll, etc. Your program will prompt the user for a description of a poll to be taken and then prompt 5 users for a response of 1-10 (1 being a 'poor' response; 10 being the 'best' response).Your program does not have to validate that the user entered 1-10. We'll do that type of checking later.Your program must use a string data type to store the poll description and a Python list data type to save the integer responses of the 5 user responses.Your output should list all the responses stored in the list, the highest given response, the lowest given response and the average of the 5 responses. See sample input and utput below.Review powerpoint 3, slide 21 for an example if you need one. Sample interactive run of your program: Give a simple description of the poll to be takenRate your understanding of the first 3 zyBook chaptersEnter a 1-103Enter a 1-1010Enter a 1-104Enter a 1-102Enter a 1-105Sample outputRate your understanding…
Write a program that will read a line of text and output the number of words in the line and the number of occurrences of each letter. Define a word to be any string of letters that is delimited at each end by either whitespace, a period, a comma, or the beginning or end of the line. You can assume that the input consists entirely of letters, whitespace, commas, and periods. When outputting the number of letters that occur in a line, be sure to count uppercase and lowercase versions of a letter as the same letter. Output the letters in alphabetical order and list only those letters that occur in the input line. For example, the input line I say Hi. should produce output similar to the following: 3 words 1 a 1 h 2 i 1 s 1 y

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Computer Programming for Beginners | Functions, Parameters & Arguments | Ep24; Author: Programming With Avelx;https://www.youtube.com/watch?v=VXlh-qJpfw0;License: Standard YouTube License, CC-BY