Write a C program that has as input a telegram text and as output the cost...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C program that has as input a telegram text and as output the cost of this telegram. The input consists of one or more lines containing a number of words each separated by a number of spaces. The unique word "END" terminates the input. Produce a bill for this telegram with each word costing 10 cents and an additional charge of 5 cents for every word over eight letters long. For instance for the following text "Violence can only stop if we undertake to preach and practice peace and compassion If only the rulers of this world could embrace peace and Justice Science and Engineering are ready to create paradise on earth END" The output will be the following: Number of words Number of normal sized words Number of oversized words TOTAL : 37 : 34 at 10 is 3.40 3 at 15 is 0.45. 3.85 Write a C program that has as input a telegram text and as output the cost of this telegram. The input consists of one or more lines containing a number of words each separated by a number of spaces. The unique word "END" terminates the input. Produce a bill for this telegram with each word costing 10 cents and an additional charge of 5 cents for every word over eight letters long. For instance for the following text "Violence can only stop if we undertake to preach and practice peace and compassion If only the rulers of this world could embrace peace and Justice Science and Engineering are ready to create paradise on earth END" The output will be the following: Number of words Number of normal sized words Number of oversized words TOTAL : 37 : 34 at 10 is 3.40 3 at 15 is 0.45. 3.85
Expert Answer:
Answer rating: 100% (QA)
Sure Heres a C program that calculates the cost of a telegram based on the given requirements c incl... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Introduction The goal of this assignment is to develop your visualization skills by sketching multiview representations of three-dimensional objects with inclined lines Include Hidden Lines and...
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
For this prompt, consider your academic goals, including (but not limited to) such topics as how you plan to manage your time to fit in your studies; how you will build your skills, as needed; how...
-
Beck Manufacturing reports the following information in T-account form for 2019. The following data is provided for Garcon Company and Pepper Company. Garcon Company Pepper Company Beginning finished...
-
The truss shown consists of six members and is supported by a ball and socket at B, a short link at C, and two short links at D. Determine the force in each of the members for P = 0 and Q = (2968...
-
Soundgarden Ltd. sold 200 color laser copiers on July 10, 2020, for 4,000 apiece, together with a 1-year warranty. Maintenance on each copier during the warranty period is estimated to be 330....
-
Data for Jennifer Anistons business as at 31 December 20x9 are as follows: Required 1 Prepare a profit and loss account for the year ending 31 December 20x9. 2 Prepare a balance sheet as at 31...
-
Lilly Painting Company is considering whether to purchase a new spray paint machine that costs $4,000. The machine is expected to save labor, increasing net income by $600 per year. The effective...
-
Bridgeport Corporation was organized on January 1, 2022. It is authorized to issue 15,000 shares of 8%, $100 par value preferred stock, and 504,000 shares of no-par common stock with a stated value...
-
Jim and Betty Williams have come to you, their financial planner, for help in developing a plan to accomplish their financial goals.Jim is 65 years old, and in good health.He owns Williams Pharmacy,...
-
On October 21, ABC Inc. repurchased and retired 10,000 of its common shares at a price of $1 per share. At this time, the average cost of the shares was $3 per share. Identify the journal entry to...
-
The following financial information is provided for Some Company: Some Company Balance Sheet Beginning Balance Ending Balance Assets Cash $ 75,250 $ 83,500 Accounts receivable $ 25,125 $ 23,695...
-
TVM or the time value of money is is the notion that a dollar today than in the future due to its potential earning capacity. This is a core principle in finance and the the fundamental concept that...
-
3. A particle is traveling along the y-axis and its position from the origin can be modeled by y(t) = 6t2t3 + 10 where y is meters and t is minutes. a. On the interval 0
-
4 5 6 QUESTIONS Q1) A camping site owner keeps at least 30 motovans and 20 tents in his camping site to rent the campers one of these spaces depending on their choices. According to his accountant he...
-
In Exercises 105108, evaluate each expression without using a calculator. log(ln e)
-
1. Describe the capital budgeting process in your own words. 2. Define capital investment. List at least three examples of capital investments other than the examples provided in the chapter. 3. As...
-
AllTreads produces two types of exercise treadmills: Regular and Deluxe. The exercise craze is such that AllTreads could use all of its available machine hours producing either model. The two models...
-
Carmichael Industries is in the process of analyzing its manufacturing overhead costs. Carmichael Industries is not sure if the number of units produced or the number of direct labor (DL) hours is...
-
In Caroline Company, total material costs are \($48,000\), and total conversion costs are \($60,000\). Equivalent units of production are materials 10,000 and conversion costs 12,000. Compute the...
-
Sota Company has the following production data for April: units transferred out 40,000, and ending work in process 5,000 units that are 100% complete for materials and 40% complete for conversion...
-
Motta Company has the following production data for April: units started and completed 40,000, and ending work in process 5,000 units that are 100% complete for materials and 40% complete for...
Study smarter with the SolutionInn App