Question: 1) Merry seven (dice game) write a Java program https://de.wikipedia.org/wiki/Lustige_Sieben I couldnt find an english resource so I have to translate the rules of the

1) Merry seven (dice game) write a Java program https://de.wikipedia.org/wiki/Lustige_Sieben I couldnt find an english resource so I have to translate the rules of the game first: Merry seven is a historical dice game with two dice and one board (Tableau). You can see the tableau in the picture. The player is playing against the bank. In the first step the player is placing a bet on a random number. The banker rolls the dice and pays for an equal number twice back and from a number on the left side the normal bet back. (which means par) so the player is not loosing but also not winning anything. On all other cases the Bank gets the whole bet from the player. For an example: If the player choose six as number (it has to be between 2-12 because of two dices) and after the program is rolling the dice with the outcome of six, the player would get double from the bet back. For the numbers 2,4,9,11 (left side from the table), the player would get the bet back, while for 7,3,5,8,10,12 the player would loos the bet. The number 7 is called to be a Refait number, which means if the player choose number 7 and after rolling the two dice the outcome is 7 the bank would pay the bet three times back. The Task: Implement a program where the player is playing against the bank. The bet from the player and the number you have two choose from the dice should be read in from the console. The range from the bet has to be between 1 and 100. Proof firstly for any input which is not following the rules and ask the player again. For an example: If you put X (which is not an Integer number) ask the player again (Proof with parse). If the bet is out of range (so not between 1 and 100) ask again or if the number from the dice is not between (2-12) ask again. Rolling the dice and determine the profit for the player has to be realized from the program. The throwing for one dice can be realized by using the function. int x = (int)(Math.random() * 6) +1; After one game the player should see the outcome from the game and the total amount of winning or lossing for the player. After each game the player should be asked, if he wants to continue or end the game. Summarize: Numbers 2,4,6,9,11 Player would get the bet back if he choose 4 and the bank rolls the dice 6. Or if he choose 4 and the bank rolls the dice 4 Player would get back double bet. Or if the bank rolls 5 (right side from the table) Player loos the whole bet. Reafait: Player choose 7 as number. The bank rolls 7 Player would win three times the bet. Example Description Hello at playing merry seven ===================================== Please place your bet between 1 and 100: 10 You placed 10, in order your bank balance is now = -10 Please choose a random number between 2 and 12: 3 The dice have fallen: 4 + 4 = 8 You will get back: 10 Your new bank balance = 0 Do you want to continue (Y)? n ------------------------------------------------------------- Please place your bet between 1 and 100: 100 Wrong bet! Please choose a bet between 1 and 100: 20 You placed 20, in order your bank balance is now = -20 Please choose a random number between 2 and 12: 6 The dice have fallen: 1 + 4 = 5 You lost your bet from 20 Your new bank balance = -20 Do you want to continue (Y)? n ------------------------------------------------------------- Please place your bet between 1 and 100: 20 You placed 20, in order your bank balance is now = -40 Please choose a random number between 2 and 12: 22 Wrong number! Please choose a random number between 2 and 12 The dice have fallen: 1 + 2 = 3 You will get your bet back: 20 Your new bank balance = -20 Do you want to continue (Y)? n ------------------------------------------------------------- Please place your bet between 1 and 100: 20 You placed 20, in order your bank balance is now = -40 Please choose a random number between 2 and 12: 7 The dice have fallen: 6 + 4 = 10 You lost your bet from 20 Your new bank balance = -40 Do you want to continue (Y)? y ------------------------------------------------------------- Your total money = -40 ===================================== I hope I descriped the task clearly enough. I know the best way to realize in Java is to while and for and furthermore Parse for make sure the player can not put X as number. And I know using stings and boole values might be good for an solution. I would be happy if an expert can help me with this task. I have to write the program in java. We are using Eclipse but it doesnt matter if I use one class with many methods or if I use three classes ( for an example player, bank and merry seven) or so on. A simple Java file would be enough. Thanks a lot for the help currently I have a programm but its not working to complete all tasks I mentioned out above.

1) Merry seven (dice game) write a Java program https://de.wikipedia.org/wiki/Lustige_Sieben I couldnt

find an english resource so I have to translate the rules of

Ubung Grundlagen der Programmierung WS 2018/19 Aufgabe 03.1 Lustige Sieben Lustige Sieben ist ein historisches Wrfelspiel mit zwei Wrfeln und einer Tafel (Tableau) nachstehender Gestalt: 6 10 12 Der Spieler spielt gegen die Bank. Der Spieler setzt einen Einsatz auf eine beliebige Zahl. Der Bankier wrfelt und zahlt bei gleicher Zahl den doppelten und bei einer auf einer Lngsseite der Spieltafel stehenden Zahl den einfachen Einsatz zuck (steigt also pari aus). Sonst gewinnt die Bank und zieht den Einsatz ein. Fallen also z. B. sechs Augen, so bekommt man bei gesetzter Zahl 6 den Einsatz doppelt zurck und bei gesetzter Zahl 2, 4, 9, 11 den Einsatz einfach zurck, whrend man bei 7, 3, 5 8, 10, 12 den Einsatz verliert. Die Zahl 7 ist ein Refait, d.h., wenn diese gesetzt wurde und fllt, dann zahlt die Bank den Einsatz dreifach zurck. Implementieren Sie ein Programm, mit dem ein Spieler gegen die Bank spielen kann. Der Einsatz des Spielers und die gesetzte Zahl sollen von der Konsole eingelesen werden. Der Einsatz muss zwischen 1 und 100 liegen. Prfen Sie auf falsche Eingaben und lassen Sie die Eingabe dann wiederholen. Wrfeln und bestimmen des Gewinns des Spielers wird durch das Programm realisiert. Das Werfen eines Wirfels kann man mit folgender Anweisung simulieren: int x(int) (Math.random)6) 1; Nach jedem einzelnen Spiel soll das Ergebnis des Spiels und der Gesamtgewinn oder-verlust des Spielers ausgegeben werden. Nach jedem Spiel wird der Spieler gefragt, ob er fortsetzen will. Beispiel: Hallo bei Lustige Sieben Bitte Deinen Einsatz zwischen 1 und 100: 10 Du setzt 1e, damit ist Dein Kontostand-1e Bitte Deine Zahl zwischen 2 und 12: 3 Die Wrfel sind gefallen: 4 + 4 = 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!