Question: 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
Sure Heres a C program that calculates the cost of a telegram based on the given requirements c incl... View full answer
Get step-by-step solutions from verified subject matter experts
