Question: Help with coding in C++ If the numbers 1 to 5 are written out in words - one, two three, four, five - then the

Help with coding in C++

If the numbers 1 to 5 are written out in words - one, two three, four, five - then the number of letters used in total is 3 + 3 + 5 + 4 + 4 = 19 letters

If all the numbers from 1 to 1000 (one thousand),inclusive, were written out in words, how many letters would be used?

Solution must include:

a) include at least two functions where:

i) at least one function has to take in a parameter

ii) at least one function has to return a value

b) print out all numbers from 1 to 1000 as words

c) print out the toal number of letters

Don't count spaces or hyphens as characters... but count 'and' as three letters. Ex) 101 - One hundred and one = 16 letters.

Question is testing ability to write functions and pass values into other functions and then print them out. I know you should use word.length() to help with your counting for loop.

Thank you!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!