Question
Problem Consider a paragraph of 100 characters at maximum. We need to extract the numeric values from this paragraph (between 0-9) that are written as
Problem Consider a paragraph of 100 characters at maximum. We need to extract the numeric values from this paragraph (between 0-9) that are written as text and then perform the needed arithmetic operation between them. The operation should be indicated in the text which could be (add, multiply, divide). The result of the operation should be printed in the center of the screen with the ability to move it to the left, right, up, and down according to the movement of arrows. To clarify things, consider the following input paragraph: We have the numbers one, two, and three, please do add operation on them. The output of the program should be as following: 1+2+3=6 This result should be printed in the center of the screen. Now if the user clicks one of the arrows from the keyboard, the result should be moved accordingly. The following summarizes the needed tasks: 1. Ask the user to input a paragraph of 100 characters at maximum. If the number of inputted characters exceeds 100, an error message should be generated. 2. Extract the numbers from the text and convert them into numeric values. Only numbers between 0-9 should be considered. 3. Extract the needed operation from the text. 4. Place the result in the center. 5. Ask the user to press on an arrow. 6. Move the result in the proper direction in accordance with the keystrokes.
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