Assignment 4B: Mathletes Game! With the introduction of loops, we now know enough about programming to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Assignment 4B: Mathletes Game! With the introduction of loops, we now know enough about programming to begin creating simple games. Our first game (sponsored by the KSU College of Science and Mathematics) will test your ability to solve multiplication problems. Your game will first ask the player if they want to play on easy or hard mode. Save their response in an appropriate variable (you will reference it later). Then, you will randomly generate two numbers and display them to the player in the form of a multiplication problem (Refer to the Lab 6 instructions and the online lab videos for help with random numbers). The possible numbers will range between - 255 and 255. You will ask the player to solve the equation. You will keep creating multiplication questions until the player wins or loses. Based on whether the player chose "hard" or "easy" mode, the game will play a little differently. Refer to the following rules for the difference: Easy Mode Hard Mode Player only has to answer 3 questions Player has to answer 6 questions Player can try again if they get a question wrong Player loses instantly if they get a question (up to two times) wrong Call the file name Assignment4B (.java, .cs, .cpp) and the class name Assignment4B. Example outputs are shown below. Note that due to using a random number generator, you will not get the same numerical results - but the formatting and wording should be the same. User input is indicated in bold. Sample Output #1: [Mathletes Game] Choose a game mode (0=Easy, 1=Hard): 0 Playing on easy mode, huh? Okay! Q1. 3 *4 = ? 12 Correct! Q2. -3 * 7 = ? 0 Incorrect! Try again. -21 Correct! Q3. -1 -2 = ? 3 Correct! You win! Sample Output #2: [Mathletes Game] Choose a game mode (0=Easy, 1-Hard) : 1 So, you want a challenge? Okay! Q1. -12 * 7 = ? -84 Correct! Q2. -3 77 = ? 539 Incorrect! Game over... Assignment 4B: Mathletes Game! With the introduction of loops, we now know enough about programming to begin creating simple games. Our first game (sponsored by the KSU College of Science and Mathematics) will test your ability to solve multiplication problems. Your game will first ask the player if they want to play on easy or hard mode. Save their response in an appropriate variable (you will reference it later). Then, you will randomly generate two numbers and display them to the player in the form of a multiplication problem (Refer to the Lab 6 instructions and the online lab videos for help with random numbers). The possible numbers will range between - 255 and 255. You will ask the player to solve the equation. You will keep creating multiplication questions until the player wins or loses. Based on whether the player chose "hard" or "easy" mode, the game will play a little differently. Refer to the following rules for the difference: Easy Mode Hard Mode Player only has to answer 3 questions Player has to answer 6 questions Player can try again if they get a question wrong Player loses instantly if they get a question (up to two times) wrong Call the file name Assignment4B (.java, .cs, .cpp) and the class name Assignment4B. Example outputs are shown below. Note that due to using a random number generator, you will not get the same numerical results - but the formatting and wording should be the same. User input is indicated in bold. Sample Output #1: [Mathletes Game] Choose a game mode (0=Easy, 1=Hard): 0 Playing on easy mode, huh? Okay! Q1. 3 *4 = ? 12 Correct! Q2. -3 * 7 = ? 0 Incorrect! Try again. -21 Correct! Q3. -1 -2 = ? 3 Correct! You win! Sample Output #2: [Mathletes Game] Choose a game mode (0=Easy, 1-Hard) : 1 So, you want a challenge? Okay! Q1. -12 * 7 = ? -84 Correct! Q2. -3 77 = ? 539 Incorrect! Game over...
Expert Answer:
Answer rating: 100% (QA)
To start lets define the functions as instructed Well then use the provided data to compute the average treatment effect for the firstprice auction ex... View the full answer
Related Book For
Auditing and Assurance services an integrated approach
ISBN: 978-0132575959
14th Edition
Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Introduction and Overview The project requires writing, reading, and handling a large data set. An array of random values is generated and saved to a file in binary format. The file is read into...
-
Explain why a safety net can save the life of a circus performer.
-
A 0.122-kg remote control 23.0 cm long rests on a table, as shown in FIGURE 11-44, with a length L overhanging its edge. To operate the power button on this remote requires a force of 0.365 N. How...
-
Pecan Theatre Inc. owns and operates movie theaters throughout Florida and Georgia. Pecan Theatre has declared the following annual dividends over a six-year period: 20Y1, $80,000; 20Y2, $90,000;...
-
At a given location in a 12-ft-wide rectangular channel the flowrate is \(900 \mathrm{ft}^{3} / \mathrm{s}\) and the depth is \(4 \mathrm{ft}\). Is this location upstream or downstream of the...
-
Calculating Project NPV In the previous problem, suppose the required return on the project is 12 percent, what is the projects NPV?
-
Solve the differential equation. dy =6x36-y, -6
-
Assume the probability of a certain disease is 0.01. The probability of test positive given that a person is infected with the disease is 0.95 and the probability of test positive given the person is...
-
A B Assumptions: 1 2 Formula: 3 WACC = (% Debt x Cost of Debtx (1 -Tax rate)) + (% Equity x Cost of Equity) 4 5 6 MRP 7 Tax Rate 8 Beta 9 10 Debt 11 % Debt 12 Cost of Debt 13 Equity Value 14 % Equity...
-
Develop the HIM department operations budget on a spreadsheet for the next FY. Allocate the funding through- out the FY on a monthly basis. The FY at General Hospital begins July 1. First, create a...
-
Choose two listed companies from Bursa Malaysia, Using their most recent financial reports and stock price performance, compare, decide, and advise which company has the greatest potential for growth...
-
If the price of Lowe's preference shares is R30 and the company pays a dividend of R2, what is the discount rate/required rate of return used by the company?
-
delete : delete a reservation for during time for day quit: server updates file reservations.txt and quits The server should implement checks to ensure that requests are sensible. For example, a...
-
Suppose you are Mr. Y who is working as an assistant engineer of PGCB. You have studied a wye-wye system during your investigation of a three-phase system. In this system, a Y-connected balanced...
-
The Ferris wheel in the figure has a radius of 68 feet. The clearance between the wheel and the ground is 14 feet. The rectangular coordinate system shown has its origin on the ground directly below...
-
Distinguish between the general audit objectives and management assertions. Why are the general audit objectives more useful to auditors?
-
What is the importance of cash discounts to the client and how can the auditor verify whether they are being taken in accordance with company policy?
-
List the major analytical procedures for testing the overall reasonableness of inventory. For each test, explain the type of misstatement that could be identified.
-
The chief goal of the private sector is effciency.Why? The primary focus of the public sector is equity. Why? It is quite possible to be highly effcient yet ineffective. It is also possible to be...
-
Why is healthcare reform such a contentious issue in the United States? Why have public and private efforts been unsuccessful in fully addressing the challenge of affordable health care? What role(s)...
-
Drawing on economic theory, what kinds of market failure underlie the worlds most pressing problems? Examine three examples: hunger, groundwater contamination, and literacy.
Study smarter with the SolutionInn App