Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C program that has as input a telegram text and as output the cost of this telegram. The input consists of one
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Sure Heres a C program that calculates the cost of a telegram based on the given requirements c incl...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started