please write a code for that

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 2GZ
icon
Related questions
Question
please write a code for that
A Game of Chance
The computer rolls 2 dice (2 random numbers from 1 to 6). Each time the
user plays, the addition of the two numbers is the user's points, unless the
numbers add up to 3, 7 or 12. In these cases the user does not get any points.
Each time the user plays, the program should display the points for that turn.
When the user ends the game, the program should display the total number
of points.
Transcribed Image Text:A Game of Chance The computer rolls 2 dice (2 random numbers from 1 to 6). Each time the user plays, the addition of the two numbers is the user's points, unless the numbers add up to 3, 7 or 12. In these cases the user does not get any points. Each time the user plays, the program should display the points for that turn. When the user ends the game, the program should display the total number of points.
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
C-string
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,