saivinaya / dice-game Goto Github PK
View Code? Open in Web Editor NEWTwo six-sided dice are rolled. Their sum lies between 2 and 12. Write a program that asks the user for n (the number of rolls) and then simulates the rolling of the two dice n times. You must simulate the rolling of each die and then add to compute the total. When all the rolling is complete your program will draw a bar chart showing the respective frequency of each total. This is a console based application and needs no graphical user interface. Your program will use "*" characters to represent dice rolls. If the number 2 is rolled half as many times as 9 is rolled then 2 will have half as many stars. The number of stars that you use and the design of the output is up to you but must be well done and clear to the user. I recommend that you generate the same number of stars despite the number of requested rolls. That is, each star should represent a percentage of rolls.