Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question # 3 : New Word Program ( 6 pts ) Write a program that prompts the user for four words. Your program should behave
Question #: New Word Program pts
Write a program that prompts the user for four words.
Your program should behave as follow:
Display a welcome message.
Ask the user to prompt words with at least letter.
Ask the user to prompt numbers, that should be less than the length of each
word to indicate length of substring in each word. For example, if the word is
Ann, then the entered number should be less than the length of Ann
Create a new word, which merges the substring of words. If the entered
number is even, the substring starts from the first letter; if is it odd, the substring
starts from the second letter.
Display the resulting new word.
Display a farewell message, so that the user knows that the program has
terminated normally.
Restriction: This questions requires the use of the functions: length substr
Assumption: Assume a perfect user who will always enter the correct input values.Welcome to New Word Program
Please enter words : Mary Has Elephants
Please enter the st number less than :
Please enter the nd number less than :
Please enter the rd number less than :
The new word is: aryHaElepha
Thank you for using New Word Program!
Figure Sample output # for Question Welcome to New Word Program
Please enter words : How Are You???
Please enter the st number less than :
Please enter the nd number less than :
Please enter the rd number less than :
The new word is: oArou?
Thank you for using New Word Program!
Figure Sample output # for Question
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started