Write a program that will read in a line of text up to 100 characters as...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that will read in a line of text up to 100 characters as string, 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 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 upper- and lowercase versions of a letter as the same letter. Output the letters in alphabetical order and list only those letters that do occur in the input line. For example: I say Hi. Write a program that will read in a line of text up to 100 characters as string, 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 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 upper- and lowercase versions of a letter as the same letter. Output the letters in alphabetical order and list only those letters that do occur in the input line. For example: I say Hi.
Expert Answer:
Answer rating: 100% (QA)
Code def countwordsandlettersline Remove commas and periods and split the li... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Two small spheres with charges 1.6 x 10-5 C and 6.4 x 10-5 C (both positively charged) are situated 2.0 m apart. Where, relative to these two objects, should a third object of charge -3.0 x 10-6 C so...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Consider Hoare triples of the form {T} V := E {V = E} where T is the atomic formula 'true' and V and E range over variables and expressions, respectively. (i) Write down an instance of such a triple...
-
Solve this system of equations -3x-y 5 -3x - 4y 83 || y = 1 11
-
Consider the linear programming problem in Exercise 3. Identify the matrices A, B, C, X, and U and state the problem and its dual in terms of matrices. In exercise +2 s 14 + s 9 x + 2y 24 . >0, >0.
-
What items will decrease a partner's basis in her partnership interest?
-
Subject to what conditions is it possible to compare EPS before and after a deal?
-
Coastal Computer operates two retail outlets in Oakview, one on Main Street and the other in Lakeland Mall. The stores share the use of a central accounting department. The cost of the accounting...
-
Find an arc length parametrization of the line y=7x+12. (Use symbolic notation and fractions where needed. Give your answer in the form of comma separated list of i, j components Fig())->help...
-
The following unadjusted trial balance is for the year ended 30 June 2019: BILLY GOAT LTD Unadjusted Trial Balance as at 30 June 2019 Debit Credit Bank overdraft Vehicle rental expenses Cash at bank...
-
5 29. 62-x= 29.62-* 1 36 32. (0.01) = 1002- 3 35.4% +7 = 15 38. 3x+2 = 36
-
8. Explain the difference between legislation and common law and provide one (1) example of legislation (using the correct naming convention) and one (1) example of a common law principle. The...
-
For a company / product of your choice, create a prospecting plans. In this plan consider : . what methods of prospecting will you choose . how will you determine and prioritize prospects . what...
-
Player Team Position Salary Brian McCann Atlanta Braves Catcher$6,700,000 Brooks Conrad Atlanta Braves Third Baseman $427,250Chipper Jones Atlanta Braves Third Baseman $14,000,000 CraigKimbrel...
-
A) Statement of research problem: (approximately 75-100 words) that explains the who, what, where, when and why of your proposed research. Explain why this problem should be answered with a...
-
The answer should be a very large number like the temperature of the sun that might not make much sense but that should be the correct answer. if you still cannot see the screenshot, below is a link...
-
Suppose that Wind Em Corporation currently has the balance sheetshown as follows, and that sales for the year just ended were $1million. The firm also has a profit margin of 10 percent, aretention 2...
-
A container holds 2.0 mol of gas. The total average kinetic energy of the gas molecules in the container is equal to the kinetic energy of an 8.0 10-3-kg bullet with a speed of 770 m/s. What is the...
-
Write a recursive method that will reverse the order of the characters in a given string and return the result as a new string. For example, if "book" is the argument, the result would be "koob".
-
Write a program to enter employee data, including Social Security number and salary, into an array. The maximum number of employees is 100, but your program should also work for any number of...
-
Imagine a program that displays a menu of five possible choices, lettered a through e. Suppose the users selection is read into the character variable choice. Write a switch statement that reacts to...
-
An accounting error, which was regarded as significant in nature and size, was not discovered until a later reporting period. How should it be dealt with?
-
The following information was extracted from the financial statements of I. Ching (Booksellers) plc for the year to 31 May 2016: Required: Prepare a statement of comprehensive income for the year...
-
Thor plc has the following events occurring between the end of the reporting period and the date the financial statements were authorised for issue: 1 The discovery that, during the reporting period,...
Study smarter with the SolutionInn App