Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Ruby script that allows a child to practice their math skills. Your software will allow the user to choose between problems involving addition,

Create a Ruby script that allows a child to practice their math skills. Your software will allow the user to choose between problems involving addition, subtraction, multiplication, and division.
six functions:
o to display the menu
o 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 to handle subtraction (similar to addition, difference will between 0-10 in Easy level)
o to handle multiplication (similar to addition, factors are 0-10 in Easy level)
o to handle division (similar to addition, quotient will be between 0-10 in Easy level.be careful avoiding division by zero!)
o 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions