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
-
Build an Excel spreadsheet to compute a discount rate of 8 percent per year for each requirement. Required a. Present value of $(5,000) now b. Present value of $1,500 one year from now c. Present...
-
On what do total line-haul costs and line-haul costs per hundredweight depend? What two ways can shippers reduce line-haul costs? LO.1
-
On January 14, at the end of the second week of the year, the totals of Castle Companys payroll register showed that its store employees wages amounted to $ 33,482 and that its warehouse wages...
-
Paulette Jordanne is trying to explain how a difference in planned from actual volume will impact results. She is preparing a budget based on the actual activity of a period, which is known as a: O...
-
In the economy of Eastlandia, the money market is initially in equilibrium when the economy begins to slide into a recession. a. Using the accompanying diagram, explain what will happen to the...
-
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...
-
If the demand for a product is inelastic, what will happen to total revenue if price is increased? Explain.
-
Question (4) seen, 20 vehicles/km moving at 100 km/h and 30 vehicles/km traveling at 120 km/h. Two successive videos showing stationary traffic on the road were examined. Two groups of platoons were...
-
?In civil engineering, what is the main use of a slump test in concrete technology?
-
Explain the process of compression resin transfer molding(CRTM)?in composite manufacturing. What are the benefits of using CRTM for producing composite structures?
-
Explore the role of post-occupancy evaluation in commercial and industrial architecture. How do architects use feedback from building users to improve future designs?
-
Discuss the principles of geotechnical engineering in slope stability analysis. How can engineers assess slope stability, mitigate landslide risks, and design effective stabilization measures to...
-
Use inductive reasoning to predict the next three numbers in the pattern (or sequence). 4, 7, 10, 13,
-
Chicago Company sold merchandise to a customer for $1,500 cash in a state with a 6% sales tax rate. The total amount of cash collected from the customer was $558. $600. $642. $636. Nevada Company...
-
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...
-
1,600 Balance Sheet The following is a list (in random order) of KIP International Products Company's December 31, 2019, balance sheet accounts: Additional Paid-In Capital on Preferred Stock $2,000...
-
Question 3 4 pts 9 x + 3 x 9 if x 0 Find a) lim f(x), b) lim, f(x), C), lim , f(x) if they exist. 3 Edit View Insert Format Tools Table : 12pt M Paragraph B IV A2 Tv
-
Mr. Geoffrey Guo had a variety of transactions during the 2019 year. Determine the total taxable capital gains included in Mr. Guo's division B income. The transactions included: 1. On January 1,...
Study smarter with the SolutionInn App