Question: Write a Ruby script that will allow a youngster to practice his arithmetic skills. More specifically, your program will allow the user to choose between

 Write a Ruby script that will allow a youngster to practice

Write a Ruby script that will allow a youngster to practice his arithmetic skills. More specifically, your program will allow the user to choose between addition, subtraction, multiplication, and division problems. Your program must use at least six functions: o One to display the menu o One to handle addition (In Easy level, generate two random numbers between 0-10, ask the user for the sum, read their answer from the keyboard, compare to see if it was correct, display if they got it right or wrong, and display the correct answer if they got it wrong) o One to handle subtraction (similar to addition, difference will between 0-10 in Easy level) o One to handle multiplication (similar to addition, factors are 0-10 in Easy level) o One to handle division (similar to addition, quotient will be between 0-10 in Easy level....be careful avoiding division by zero!) o One to get the level of difficulty for problems. This function should ask user to enter "E" for easy, M for medium, or D for difficult. The function should loop until a valid choice is entered. Once valid, that letter should be returned. o When the user chooses Quit from the menu, the script should display the number correct, the number attempted, and the percentage correct. o Do not use any global variables. Pass data to functions using parameters where necessary

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!