Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Project Challenge: Algebra The math teacher at Garfield High School, Mr. Escalante, is looking for new ways to help his students learn algebra. They are

Project Challenge: Algebra

image text in transcribed

image text in transcribed

The math teacher at Garfield High School, Mr. Escalante, is looking for new ways to help his students learn algebra. They are currently studying the line equation ( y = m * x + b ). Mr. Escalante wants to be able to give his students a phone app that they can use to study for the midterm exam. This is what he'd like the program to do:

The user will be presented with the option to study in one of 3 modes, or to quit the program:

  1. Solve for the value of y, given the values for m, x and b.
  2. Solve for the value of m, given the values for y, x and b.
  3. Solve for the value of b, given the values for y, m and x.

In each mode, all of the given values should be randomly generated integers between -100 and +100. This means that the correct answer must be calculated by the program.

Once the student selects a mode, the program will continue to present randomly generated questions until the student has correctly answered 3 questions in a row. If the student attempts more than 3 questions in a particular mode, a hint about how to solve the problem should be given before the next question is presented.

After the student has correctly answered 3 questions in a row, an overall score (the number of questions answered correctly divided by the total number of questions attempted) should be displayed, and the menu is presented again.

DIRECTIONS

Your program must

  • define and use custom methods (functions)
  • use if statements
  • use while loops

Things to think about when you're designing and writing this program:

  1. Take some time to think about the problem, and break it down into several smaller problems.
  2. Take some time to design and write an outline for your program using pseudo code.
  3. Take some time to think about what methods you will need to design and write for this program.
  4. Take some time to think about where you may use if statements and while loops in your program.
  5. Once you have considered all of the above elements, then start to implement your design in Java.
  6. Remember to choose your variable and method names carefully. Names should be descriptive, and well chosen names can make it much easier to solve the problem.

NOTE-

This is a three part staged assignment. You must complete part 1 with at least 80% success before you can begin part 2, and the same with part 3. After you've completed and submitted each part, you can proceed to the next part by selecting the drop down arrow next to the assignment title. You will need to complete all parts to receive full credit.

Part 1. Solve for y. Write a program with a that displays a randomly generated problem that asks the user to solve for the y variable, takes input from the user, and prints if the user answered correctly or not. Your main should give one problem and then exit. Use one or more methods to produce this behavior.

Example interactions:

Given:

m = 10 x = 3 b = 2

What is the value of y? 32 Correct!

Given:

m = 6 x = 9 b = 3

What is the value of y? 52 Sorry, that is incorrect. The answer is 57.

Part 2. Solve for y, m and b. Add 2 choices that behave similarly to your part 1 program, but have the user solve for m and b instead. These choices should also randomly generate problems, and print if the user answers correctly. Your main program should display a menu asking which type of question to ask: Select 1 to Solve for Y, 2 to Solve for M, 3 to Solve for B and 4 to quit. When the user selects the question type, one question should be asked, then the user should return to the menu. This should repeat until the user selects quit, then the program should exit. Use one or more methods and loops to produce this behavior.

Part 3. Three in a Row with Hints. Update your program so that each problem type mode will repeatedly ask questions until the user gets 3 correct answers in a row. If the attempts more than 3 questions in a particular mode, the program should provide a hint on how to solve problems of this type. After the student has correctly answered 3 questions in a row, an overall score (the number of questions answered correctly divided by the total number of questions attempted) should be displayed, and the menu is presented again.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions