Answered step by step
Verified Expert Solution
Link Copied!

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managerial Accounting

Authors: Karen W. Braun, Wendy M. Tietz

4th edition

978-0133428469, 013342846X, 133428370, 978-0133428377

More Books

Students also viewed these Programming questions

Question

What is the method of least squares?

Answered: 1 week ago

Question

Write each fraction as a percent. 7 50

Answered: 1 week ago