Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write all in 1java run 1) Generate two random numbers between 2 and 10. 2) Ask user to choose one operator from +,,,/ ( note:

Write all in 1java runimage text in transcribed

1) Generate two random numbers between 2 and 10. 2) Ask user to choose one operator from +,,,/ ( note: / is an integer division) 3) Display Math formula using the numbers and the operator. ( eg: 67= ?) 4) Ask the user for an answer. - If the user's answer is correct, display "You are a math genius! Bye." and terminate the program. - If the user's answer is incorrect. Display "wrong answer!" and ask the user for the answer of the formular again. (Do not generate new numbers and formula.) 5) To calculate the answer, create a method and send/return the operator and two numbers. Like, public static int math(String op, int a, int b) \{ int result =0; if (op.equals(" + ") { result =;} return result; \} 6) you must pass 3 parameters (operator, first number, second number) to the math method and receive the result from the method. 7) Include appropriate program comments and formatting including: Your first and last name, a short description of the program's function comments necessary to explain the operation of your program

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_2

Step: 3

blur-text-image_3

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

Logic In Databases International Workshop Lid 96 San Miniato Italy July 1 2 1996 Proceedings Lncs 1154

Authors: Dino Pedreschi ,Carlo Zaniolo

1st Edition

3540618147, 978-3540618140

More Books

Students also viewed these Databases questions