Write a program that simulates the rolling of two dice

Assignment Help Programming Languages
Reference no: EM132211458

Question: In C, C++

Write a program that simulates the rolling of two dice. The program should use rand to roll the first die and again use it to roll the second die. The sum of the two dice should be calculated and then printed in a tabular form. Note that the results should vary from 2 to 12 with 2 being the least frequent as there is one way only to get 2 and 7 being the most frequent as there is six ways to get 7. Execute and submit the program and the results in screen captures.

a) Verify that your results are reasonable in that the 7 should appear 6/36 of the times the dice are thrown, and the 2 should appear 1/36 of the times. Determine the theoretical frequency (just like I stated above) and the actual frequency the program outputs.

b) Increase the number of times the dice are thrown and rerun the program and comment on how the results changed.

Reference no: EM132211458

Questions Cloud

Write a program that stores the values : Write a program that stores the values ' X' and 76.1 in separate memory cells. Your program should get the values as data items and display them again.
What was the highest grade on test two : Write a method that takes in a teacher's last name and exam number via parameters. Ask the teacher (using her name) to tell you the highest score on that exam.
Create a make file to compile and link all three files : Create a make file to compile and link all three files. Do not change the names of the three files: deposit.c , withdraw.c and atm.c
Write a program that requests a floating point number : Write a program that requests a floating point number then separately outputs the integer and fractional components.
Write a program that simulates the rolling of two dice : Write a program that simulates the rolling of two dice. The program should use rand to roll the first die and again use it to roll the second die.
Write a program that repeatedly asks the user to type : Write a program that repeatedly asks the user to type in a sentence and press Enter. Your program will store each sentence the user types into some container.
Write a program that searches for a particular item : Write a program that searches for a particular item in a huge random array and see how long it take, using linear and binary searches.
Write a program that stores numbers in the given range : Write a program that stores numbers from the range 0 - 1000 in an array. Your program should. Create an array of size 50. Run in two modes and ask the user.
Write a program that solves the coin row problem : Write a program that solves the Coin Row problem in the C++ language. Your program should ask a user for the number of coins and coin values.

Reviews

Write a Review

Programming Languages Questions & Answers

  Calculate the total commission received by a salesperson

The following program attempts to calculate the total commission received by a salesperson who earns 7% on sales of product A which total less than $40,000 and 10% on the amount of sales above $40,000.

  Write vl program to convert leagues-number of nautical miles

Write a VL program which will convert 20,000 leagues to number of nautical miles. Your program requires no input elements, just elements to compute result and output how many nautical miles is equivalent to 20,000 leagues.

  Create a working program for alpha testing

you want to put together the work that has been completed to deliver a working program for alpha testing. You will combine the elements you have written to this point and deliver a working solution.

  Create the object-oriented design for dvd collection

Create the object-oriented design for system which keeps tracks of your CD and DVD collection. Recognize each of the classes, associated data, and operations for classes.

  Defining method dashedline with one parameter

Write a definition of method dashedLine, with one parameter, an int .

  Write a program that reads in a single record

Write a program named printRecord.py that reads in a single record from the first logfile, prints it, and exits - Write the final version of your program; it does what merger.py does and then loops through the records accumulating the op costs. It t..

  Write a function to circulate a list

Write a function to circulate a list. The function takes two paramaters, the first defines how many elements of the list to circulate, and the second is the list. The output should be the circulated list.

  Write program which asks user for number of bolts

Write C++ program which asks user for number of bolts and number of nuts in their purchase and then computes and prints out total cost.

  Create a class named game that contains a string

Create a class named Game that contains a string with the name of the Game and an integer that holds the maximum number of players. Include properties with get and set accessors for each field.

  Program to determine how many values were inputted

Write down the program which reads data into the type int. Valid values are from 0 to 10. Your program must determine how many values were inputted.

  Write lisp function to reverse order of the elements in list

Write a Lisp function that: given a two-element list, reverse the order of the elements in the list (cannot use the LISP reverse function).

  Write program to reads student-s name with test scores

Write down a program which reads student's name together with his or her test scores. Program must calculate the average test score for each student and allot the suitable grade.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd