Create the logic for a game that simulates rolling two dice by generating two numbers between 1
Question:
Create the logic for a game that simulates rolling two dice by generating two numbers between 1 and 6 inclusive. The player chooses a number between 2 and 12 (the lowest and highest totals possible for two dice). The player then “rolls” two dice up to three times. If the number chosen by the user comes up, the user wins and the game ends. If the number does not come up within three rolls, the computer wins.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 45% (11 reviews)
Flowchart Pseudocode start Declarations num dice1 num dice2 num guess num count num won num LIMIT 6 ...View the full answer
Answered By
Somshukla Chakraborty
I have a teaching experience of more than 4 years by now in diverse subjects like History,Geography,Political Science,Sociology,Business Enterprise,Economics,Environmental Management etc.I teach students from classes 9-12 and undergraduate students.I boards I handle are IB,IGCSE, state boards,ICSE, CBSE.I am passionate about teaching.Full satisfaction of the students is my main goal.
I have completed my graduation and master's in history from Jadavpur University Kolkata,India in 2012 and I have completed my B.Ed from the same University in 2013. I have taught in a reputed school of Kolkata (subjects-History,Geography,Civics,Political Science) from 2014-2016.I worked as a guest lecturer of history in a college of Kolkata for 2 years teaching students of 1st ,2nd and 3rd year. I taught Ancient and Modern Indian history there.I have taught in another school in Mohali,Punjab teaching students from classes 9-12.Presently I am working as an online tutor with concept tutors,Bangalore,India(Carve Niche Pvt.Ltd.) for the last 1year and also have been appointed as an online history tutor by Course Hero(California,U.S) and Vidyalai.com(Chennai,India).
4.00+
2+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Create a flowchart or pseudocode that shows the logic for a program that generates a random number, then asks the user to think of a number between 1 and 10. Then display the randomly generated...
-
Create the logic for the dice game Pig, in which a player can compete with the computer. The object of the game is to be the first to score 100 points. The user and computer take turns rolling a pair...
-
Create a Web page named repavg.html that simulates a large number of dice rolls and computes the average of the dice totals. The user should be able to enter a number of rolls in a text box and then...
-
Consider a country that imports steel and exports automobiles. The value per unit of cars exported is measured in units of thousands of dollars per car by the random variable X. The value per unit of...
-
Solve Problem using Gauss-Jordan elimination. 3x1 - 9x2 + 12x3 = 6 -2x1 + 6x2 - 8x3 = -4
-
You are standing on an overpass throwing a package down to a truck be;pw . The truck approaching at a speed is 8 0 km / h and you estimate horizontal distance away from you at 2 0 m . if you are 7 m...
-
How do we use the requirement of design to define messages and methods?
-
When a company acts in an ethically questionable manner, what types of problems are caused for the organization and its customers?
-
On January 1 of Year 1, Alpha Corporation issued $400,000 of 8% (cash payable semiannually on June 30 and December 31), three-year bonds to yield 10%. Required a. Compute the selling price of the...
-
Grizzly Community Hospital in central Wyoming provides health care services to families living within a 200-mile radius. The hospital is extremely well equipped for a relatively small, community...
-
In Chapter 2, you learned that in many programming languages you can generate a random number between 1 and a limiting value named LIMIT by using a statement similar to randomNumber = random(LIMIT)....
-
A subscript is a(n) _________. a. Element in an array b. Alternate name for an array c. Number that represents the highest value stored within an array d. Number that indicates the position of an...
-
Saddle Inc. has two types of handbags: standard and custom. The controller has decided to use a plantwide overhead rate based on direct labor costs. The president has heard of activity-based costing...
-
Finding that the next baby born in Alaska is a girl. For Exercises 1118, use the theoretical method to determine the probability of the given outcome or event. State any assumptions that you need to...
-
Considering the application described in the preceding exercise, what changes would you make to the user interface screens to bring them into compliance with the human engineering guidelines...
-
At the Large Hadron Collider in Switzerland, two highenergy protons collide to create new particles. Prior to collision, each proton is accelerated to an energy of \(7000 \mathrm{GeV}\) in the Earth...
-
A uniform 200-kg cube that has a volume of \(8.00 \mathrm{~m}^{3}\) (measured when the cube is at rest in the Earth reference frame) travels perpendicular to a pair of its faces at \(0.672 c_{0}\)...
-
Assume that \($s0\) is initialized to 11 and \($s1\) is initialized to 22. Suppose you executed the code below on a version of the pipeline that does not handle data hazards (i.e., the programmer is...
-
Access the September 27, 2014, 10-K report for Apple, Inc. (ticker AAPL), filed on October 27, 2014, from the EDGAR filings at www.SEC.gov. Required 1. What products are manufactured by Apple? 2....
-
In July 2013, cnet.com listed the battery life (in hours) and luminous intensity (i. e., screen brightness, in cd/m2) for a sample of tablet computers. We want to know if screen brightness is...
-
Create an application for Paulas Portraits, a photography studio. The application allows users to compute the price of a photography session. Paulas base price is $40 for an in-studio photo session...
-
In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fix. For example, DebugFourteen1.java will become...
-
a. Create a quiz game that displays, in turn, five questions about any topic of your choice. All five questions should have the same three possible multiplechoice answers. For example, you might ask...
-
Estimate the final temperature in Celsius of the combination if I drop 5 rolls of pennies at 2 0 C ( each roll is 5 0 pennies stacked together; assume they are pure copper ) into a cup of recently -...
-
A 100 gram mass is hung of then end of a cantilever beam . The beam is made of brass, and is 30 cm long (), 2 cm wide, and 3 mm thick. Find the resulting deflection ()
-
The nitrogen-vacancy (NV) and silicon-vacancy (SiV) defects in diamond can lead to many exciting quantum nanotechnologies in physical and biological sciences, including single-photon sensors,...
Study smarter with the SolutionInn App