Program 3 Lyell C Read Solution





Problem Statement


Design a program that will make algebra fun. This program will start by asking the user how many “floors” to have, then will prompt the user to to answer an algebra problem for each floor. If they succeed on all “floors”, they win, and get to the top, while if they fail, they descend a level. There will be two modes: difficult and easy. Easy mode will allow the user to choose what operations they are required to conduct, while difficult mode will choose randomly for the user. In easy mode, numbers generated to fill the equations will be on [0..100], while in difficult mode, these numbers will be on [-100..100]. ASCII art must be used to represent the building progress.


More Requirements:


  • Must use at least three functions


  • Must use self made function to check and convert input (str) to signed int.


  • If the str contains illegal characters, return INT_MAX from <climits>


  • Must use a self made function to print the image of an elevator using ASCII characters.


  • This should accept two parameters: current level, max level


  • Must use a self made function to print the math problem to screen.


  • Must be named display_equation()


  • Must accept three parameters: (type of problem, lowest acceptable random number, highest acceptable random number)


  • 1 for addition, 2 for subtraction, 3 for multiplication, 4 for division (canvas)


  • Must return answer as a signed int


  • MUST USE: ​int display_equation(int eq_type, int range_low, int range_high);


  • Must catch all bad input


  • Math answers should always be ints


  • Elevator cannot go below the first floor…


  • User must be able to choose to repeat.



error: Content is protected !!