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)
It appears youve shared an image with a programming exercise description Based on the instructions y... 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
-
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.
-
Why does the Fed use indirect means of controlling the money supply instead of simply printing more money or removing money from circulation when necessary?
-
Is the collision in Example 10.7 elastic? Data from Example 10.7 Pucks 1 and 2 slide on ice and collide. The inertia of puck 2 is twice that of puck 1 . Puck 1 initially moves at \(1.8 \mathrm{~m} /...
-
This problem continues the Draper Consulting, Inc., situation from Problem 8-42 of Chapter 8. Refer to Problem 2-62 of Chapter 2. In Chapter 2, we learned that Draper Consulting, Inc., had purchased...
-
Fluorine Limited (FL), a manufacturer of ships, has entered into the following contracts during the year ended 31 December 2022: (i) On 1 January 2022, FL entered into a contract with Alpha Limited...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Your client, Blue Corporation, is a traditional C Corporation. The corporation has 1 shareholder, Cindy Lou Blue. Cindy Lue comes to your office to discuss the corporation. She is trying to minimize...
-
What did you learn? How did Japan and the Middle Ages influence our present mode of living, arts, music, architecture, engineering, commercial undertakings, or thinking? Summarize each: Gothic...
-
Make a comparison between the operating systems Microsoft Windows, Apple macOS and Linux ?
-
A company is considering installing a solar heating system in its manufacturing plant for space and hot water hearing. There are three possible alternatives as given in the Table below: A B C Solar...
-
What policies should Canada pursue to meet its target of a 40% reduction in emissions by 2030 compared to 2005 levels and a commitment to reach zero emissions by 2050?
-
What are the 20 most Important Apple MacOS logs for incident response and digital forensic exams?
-
Davis Corporation borrowed $50,000 on January 1, Year 1. The loan is for a ten-year period and has an annual interest rate of 9%. At the end of each year, Davis will make a payment of $7,791, which...
-
Determine the optimal use of Applichem's plant capacity using the Solver in Excel.
-
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...
-
Which of the following best describes the underlying rationale for a written investment policy statement (IPS)? A. A written IPS communicates a plan for trying to achieve investment success. B. A...
-
Which of the following is least important as a reason for a written investment policy statement (IPS)? A. The IPS may be required by regulation. B. Having a written IPS is part of best practice for a...
-
A written investment policy statement (IPS) is most likely to succeed if: A. Created by a software program to assure consistent quality. B. It is a collaborative effort of the client and the...
Study smarter with the SolutionInn App