Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Programming Language Expert

problem 1) prepare a program which helps teachers test their students in their mathematical knowledge. The program must use two generate methods generateNumber and generateOperation as follows:

a) public static int generateNumber(): generate the integer value randomly between (1-10)

b) public static String generateOperation(): generate the string symbol representing the operation (+, -,*) randomly. Hint: you could generate integers and use switch to select the correct string for your operation

c) public static boolean check (int x, int y, int result, String op): checks users answer matches result of performing operation op on x and y.
In main method you require to keep on asking user new problem and user could stop the game by entering value 999. You need to keep track of users score, a correct answer would give the user 1 point and a wrong answer would take off one point.

ex:

**** Welcome to our math game ****

What is the result of 2 * 9 ? (999 to stop): 18
Excellent!
What is the result of 4 - 5 ? (999 to stop): -1
Excellent!
What is the result of 3 - 2 ? (999 to stop): 1
Excellent!
What is the result of 1 - 2 ? (999 to stop): 33
Sorry wrong value!
What is the result of 10 + 5 ? (999 to stop): 999

*************************************
Your total is 2

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M94545

Have any Question? 


Related Questions in Programming Language

1 show how to transform a three-address code sequence into

1. Show how to transform a three-address code sequence into one in which each defined variable gets a unique variable name. 2. Determine the types and relative addresses for the identifiers in the following sequence of d ...

Programming assignmentthis question has two parts a and

Programming Assignment This question has two parts (a) and (b): Develop a program to read in five exam-scores (in the range of 0-100) of a student in HIST220 class. (a) You program should compute and store in memory the ...

Design and implement your own simple class to represent any

Design and implement your own simple class to represent any household item of your choice (toaster, fan, hair dryer, piano ...) Your class should have a constructor, one additional method and at least one member variable ...

Assignmentwrite a console application to meet the following

Assignment Write a console application to meet the following requirements. Create a system for a simple library. The library has a name and a list of books. Each book has a title, author and an int as the id number. Defi ...

Create a very basic calculator map out the numeric keypad

Create a very basic calculator, map out the numeric keypad (17 buttons) and an EditText view. If text is given, prompt the user with a message that complains about the error. Toast.makeToast(getApplicationContext() , "er ...

Assignment1 you are a manager who is employed by a game

Assignment 1. You are a manager who is employed by a game production company. Your team is responsible for coding one of the game modules. You have two newly hired programmers working for you who believe that the followi ...

A certain loop requires 5 loads 7 stores and 8 arithmetic

A certain loop requires 5 loads, 7 stores, and 8 arithmetic operations. What is the minimum initiation interval for a software pipelining of this loop on a machine that executes each operation in one clock tick, and has ...

The concepts discussed in this section can also be applied

The concepts discussed in this section can also be applied to eliminate partially dead code. A definition of a variable is partial ly dead if the variable is live on some paths and not others. We can optimize the program ...

1 write a pay-raise program that requests a persons first

1. Write a pay-raise program that requests a person's first name, last name, and current annual salary, and then displays their salary for next year. People earning less than $40,000 will receive a 5% raise, and those ea ...

Sum of digits in a string design a program that asks the

Sum of Digits in a String Design a program that asks the user to enter a string containing a series of single digit numbers with nothing seperating them. The program should display the sum of all the single digit numbers ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro