Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

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

Step: 3

blur-text-image

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

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

Discuss all branches of science

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago