Design a roulette wheel which allows the user to enter bets on multiple numbers. Allow the user to stop betting when they enter 0 on a bet. The program will then choose a random number between 0 and 36. If the user wins, they will get back 30 times the amount they bet on that number. The program will print out the winning number as well as how much they won or lost. Create an array to store the numbers the user bet on. Create a corresponding array to store the amount they bet on each number. o int[] bets=new int[36];//To store the person's bets o int[] amount =new int[36];//To store the amount of the bet Ask them what numbers they want to bet on and how they want to bet. Store these in the arrays. The program chooses a winning random number. Check to see if any of their bets match the correct number. If they have the correct number tell them this and inform them as to how much they won or lost. If they did not get the correct number tell them this and tell them how much they lost. Print the winning number
Design a roulette wheel which allows the user to enter bets on multiple numbers. Allow the user to stop
betting when they enter 0 on a bet. The program will then choose a random number between 0 and 36.
If the user wins, they will get back 30 times the amount they bet on that number. The program will print
out the winning number as well as how much they won or lost.
Create an array to store the numbers the user bet on.
Create a corresponding array to store the amount they bet on each number.
o int[] bets=new int[36];//To store the person's bets
o int[] amount =new int[36];//To store the amount of the bet
Ask them what numbers they want to bet on and how they want to bet. Store these in the arrays.
The program chooses a winning random number.
Check to see if any of their bets match the correct number.
If they have the correct number tell them this and inform them as to how much they won or lost.
If they did not get the correct number tell them this and tell them how much they lost.
Print the winning number
Program 3: (Based on arrayhw4 in the chapter 7 project).
Create your own SAT exam.
There will be three sections, each section will have a corresponding array for the true answers and an
array to store the student’s answers. Each section has 5 questions.
Example-For section 1:
char[] answers1 = {'A','C','A','D','E'}; //correct answers
char[] sanswers1 = new char[answers1.length]; //to store the student’s answers
Scoring is done as follows:
Base score is 200
For each correct answer in section 1 they get 20 points. For each incorrect answer 5 points is
deducted.
For each correct answer in section 2 they get 40 points. For each incorrect answer 10 points is
deducted.
For each correct answer in section 3 they get 60 points. For each incorrect answer 15 points is
deducted.
Ask the questions
Compute the score
o If their score is less than 200 give them a score of 200
Step by step
Solved in 4 steps with 2 images