Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Type: Individual |Weight: 10% I Delivery: A2L - Assignment submission folder Due Date: Please see the Assignment vabmisslon tolder or calendar Introduction A computer program

image text in transcribed
Type: Individual |Weight: 10\% I Delivery: A2L - Assignment submission folder Due Date: Please see the Assignment vabmisslon tolder or calendar Introduction A computer program is composed of statements with actions and control flow. The actions are often expressions (amongst other thingi). The control fow directs the sequence of how the statements are executed. Much like flow charts, a program can be as simple as a single line of executable statements with a start and an end. However, it may also include tests for conditions that may result in branches to other parts of the program, or iserations of code blocks (loops). Course Learning Outeomes Evaluated in this Assignment Demonstrate the control of program flow using conditional tests and loops. Instructions Demonstrate the use of "loops" and "ir" statements to simulate the results of rolling a single die multiple times. It is a simple simulation that can help show that the probablity of acy die tace value is equal. Here are the requirements: 1. Ask the user how many times the die needs to be rolled. This value should be stored in an appropriate variable. 2. A loop must be executed the number of times the aser specified in 1. above. 3. Inside the loop, a random number between 1 and 6 (inclusive) is generated. 4. Keep track of the number of times a number is generated. A simple approach is to have a variable (a ceunter) for each die value. As the random die roll is generated, the corresponding counter is incremented by 1. For example, you could have a variable called Roll that keeps track of the number of times a 1 is rolied. And each time a1 is rolled, the variable has 1 added to it. Although you might want to print the values as they are generated while you are developing and debugging your program, DO NOT include these satements in your submitted solution. (You can comment them out or just deleted them before submissice.] 5. When the loop ends, a report is displyyed on the screen showing the count of each die value. There should be 6 values displayed in a user friendly manner. As simple outpat might look like this: Number of times 1 is rolled: xx Number of times 2 is rolled: x. Number of times 3 is rolled: xx Number of times 4 is rolled: xox Number of times 5 is telled: 30 Number of times 6 is rolled: xx where the so's are the total number of times that specific number appeared. 6. Please submit the program as a py file to the appropriate assignment folder. This file should be an executable Python program, NOT just a record of using the interactive features of Prthen. For grading information, please see the Rubric that is part of the Assignment information in A2L

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

explain what is meant by the terms unitarism and pluralism

Answered: 1 week ago

Question

4. Are there any disadvantages?

Answered: 1 week ago

Question

3. What are the main benefits of using more information technology?

Answered: 1 week ago