Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Spring 2023 / INFO 2315

Project 1

Due date Feb 15th 11:59PM

Objective:

Implement appropriate algorithms for the given problem.

Problem Specifications

In this project, you will create a Java game using recursion. The game includes three      recursive stages Generate Spinning Wheel,” “Spin the Wheel,” and Play the Game.” The game starts by generating five unique random numbers between 0 and 299 inclusive (no duplications). The five generated numbers represent the spinning wheel   sectors. The second stage of the game is Spin the Wheel .”In this stage, the program   generates a random number between 1 and 5 inclusive, representing the wheel sector. Based on the sector number, the value will be the Play the Game” stage parameter.

Remember, you will not get any score if you do not use recursion to implement the methods in the Generate Spinning Wheel and  Play the Game stages.

Your program should include at least the following methods:

1-  Generate Spinning Wheel, a recursive method that generates five unique

random numbers between 1 and 299 inclusive (no duplications) to represent the spinning wheel sectors. (25 points)

2-  Spin the Wheel is a method that generates a random number between 1 and 5

inclusive and returns the corresponding value of the wheel sector. (5 points)

3-  Play the Game is a method that accepts one parameter, which is the selected

wheel sector value returned from the Spin the Wheel method. The function calls one of three recursive methods based on the wheel sector value. If the value is between 1 and 99 inclusive, the first method print a hailstone sequence is called with the wheel value as an argument . If the value is between 100 and 199 inclusive, the second method display all odd numbers is called with the sector value and 200 as arguments. If the wheel sector value is between 200 and 299, the third method print modulus is called with the wheel sector value and a       generated random number between 2 and 10 . (10 points)

a)  print a hailstone sequence recursive method is to generate a hailstone sequence of numbers. (15 points)

The sequence starts with a positive integer n accepted as a parameter and always ends with one by following the rules below

-     If n is 1, then the sequence ends.

-     If n is an even number, then the next number in the sequence is n/2

-     If n is an odd number, then the next number in the sequence is (3 * n) + 1

b)  display all odd numbers recursive method accepts the wheel sector value as a parameter and prints all the odd numbers between the parameter value and

200. (10 points)

c)  print modulus recursive method accepts the wheel sector value and a generated random integer between 2 and 10 as parameters. The function calculates the parameters' modulus without using multiplication, division, modulus, or any other Java methods except addition and subtraction. (15 points)

4-   Manage the program. You should divide your program into methods called by the

main method and the other methods mentioned in the specifications to complete the game. The program should continue asking the player if they want to play the game again or not. (20 points)

Submission Instructions

The whole project folder should be named using YOURNAME and YourIDNumber, then compress and submit the project through Moodle course website.

Incomplete submission and java codes saved in text files will NOT be considered or marked. Please check the course outline for more information about late/missing  submissions.

You can ask about the project by email no reply to emails sent two business days before the submission date.