Question
Ask the user to enter a string of characters with no space ( 260245849302127 or ghrewrrtjrnhnpew). Create a function that will add a - character
Ask the user to enter a string of characters with no space ( 260245849302127 or ghrewrrtjrnhnpew).
Create a function that will add a - character after the 2nd number and the ~ character after the 5th number then repeat this pattern.
This string would print as follows 26-02458~49-30212~7 or gh-rewrr~tj-rnhnp~ew
Requirement
You must create a function to perform the actions
You can create more than one function
The method must take in the number as a parameter and return the modified string
Describe and Print to console
The string of characters the user entered The modified string
Commenting
Program Header
Method Header
Pseudocode
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