View the step-by-step solution to:


I got this help using charArray but

class="hljs-keyword">is there anyway not using charArray but only using if-else if-else statement, switch statement and several kinds of loop statement to have same output?

The question is

1) Import the file in specific places

2) Reverse the case of all letters so that all lower-case letters in input.txt will show up in output.txt as upper-case, all upper-case letters in input.txt will show up in output.txt as lower-case.

3) Replace All numbers/digits with a hyphen-separated list of the words for the digits in that number.

Some examples: the number 123 in input.txt will show up in output.txt as one-two-three; the number 7 in input.txt will show up in output.txt as seven.

4) Lastly, output.txt should end up with the same number of lines as in input.txt

Remember: As lines are written to the output file, output.txt, they should also be displayed to the console for the user to see.

So far, I got the part 1, and I know what the code of part 2, but It doesn't work when I compile them to check whether I did it correctly. And I have no idea about part 3 and 4.

It is long question to solve it but I really want to know how to approach this question for the upcoming exam.

Please help

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes