Question: Please help :( Write a program that accomplishes the following tasks.Remember: All output should be labelled accordingly. You should only use features, functions, and routines
Please help :(
Write a program that accomplishes the following tasks.Remember:
- All output should be labelled accordingly.
- You should only use features, functions, and routines already discussed in class.
- You should make good use of how C++ features work whenever possible.
- Be sure to use proper top down design techniques and include an appropriate number of functions with an appropriate amount of arguments.
If you make any assumptions or interpretations of the prompt that you feel that you need to clarify, be sure to include it as a comment.
"rngNumbers.txt" is a text file of random numbers in the range 1 - 100, organized by 5 numbers per row, a space between each number (you may download it in "Files" on Canvas).
- Write a program that will take input from this text file and store it in an array.But this program should treat every digit as its own separate number.
- The program reads 10 such numbers, sorts them, and then outputs the contents to screen.
- Prompt the user to enter a number, and then print out how many times that number shows up in the array.You may assume that the user always enters a number that is in the array.
- Prompt the user to enterone word.
- Swap the third last character with the third character, and output the new modified string. You may assume that the user always enters reasonably long input.
Example output:
Array contents:
1 3 3 3 3 4 4 7 7 8
Enter a number: 3
The number 3 shows up 4 times.
Enter a word: incredible panther
Modified word: inbredicle
Explanation: Going 1 digit at a time, the program should read up until the first "3" of "33" on the second row, which gives the contents listed above.One word means just "incredible".Swapping the third last character ("b") with the third character ("c) gives the final result.
"rngNumbers.txt"
https://drive.google.com/file/d/1LQZuD1VGVRwlUPmPilFC_oatBWFKoSPA/view?usp=sharing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
