write a program that simulates the rolling of two dice. the program should use a c random number generator to roll the first die (returning a value between 1 and 6) and again to roll the second die. the sum of the two values should then be calculated. your program should roll the two dice 3600 times. g

Answers

Answer 1

A single-subscripted array can be used to count the instances of each sum.

Write a program that simulates the rolling of two dice?

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

int main()

{

int die1, die2, sum, roll;

srand(time(0));

for (roll = 1; roll <= 3600; roll++)

{

 die1 = (rand() % 6) + 1;

 die2 = (rand() % 6) + 1;

 sum = die1 + die2;

 printf("Roll #%d: Die 1: %d  Die 2: %d  Sum: %d\n", roll, die1, die2, sum);

}

return 0;

}

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

int main(){

   int i, sum;

   // initialize random seed

   srand(time(0));

   // roll the dice 3600 times

   for(i = 0; i < 3600; i++){

       int dice1 = rand() % 6 + 1; // roll the first die

       int dice2 = rand() % 6 + 1; // roll the second die

       sum = dice1 + dice2; // calculate the sum of the two dice

       printf("Dice 1: %d\tDice 2: %d\tSum: %d\n", dice1, dice2, sum);

   }

   return 0;

}

To learn more about a program that simulates the rolling of two dice refer to:

https://brainly.com/question/18751332

#SPJ4


Related Questions

Why did we decide to send a message as a sequence of two options rather than modifying our devices to represent more options?

Answers

Answer:

Following are the solution to this question:

Explanation:

Please find the complete question in the attachment file.

The binary message is also an XML text SMS, which is used to represent in binary character. It may also flag the binary text as binary, and it can attach the UDH as just the start of its message. In this question, we assume that you can include A and B because there could be no more than 2 choices in such a binary message.

Why did we decide to send a message as a sequence of two options rather than modifying our devices to

We decided to send a message as a sequence of two states (A and B) rather than modifying our devices to represent more states (State C, State D, State E, etc.) primarily for simplicity and efficiency.

Using a binary communication system with just two states is straightforward and easier to implement than introducing more complex modifications for additional states.

Binary communication allows for clear and unambiguous encoding and decoding, making it more reliable and less prone to errors.

While using more states could potentially convey more information, it would also require more complex hardware and software, increasing the risk of communication errors and complicating the overall system design and operation.

Know more about binary communication:

https://brainly.com/question/32447290

#SPJ3

Your question is incomplete, but most probably your full question was.

Why did we decide to send a message as a sequence of state (A and B) rather than modifying our devices to represent more State (State C, State D, State E,....)?

How is peace circulated?​

Answers

Answer:

Peace is when people are able to resolve their conflicts without violence and can work together to improve the quality of their lives. 

When people are able to refill to their conflicts

What form of contacts can be shared in Outlook 2016?


O local contacts
O shared contacts individual contacts
O folders of contacts

Answers

Note that In Outlook 2016, you can share the following forms of contacts: " shared contacts individual contacts" (Option B)

What are shared and individual contacts?

In Outlook 2016, you can share the following forms of contacts:

Shared Contacts - These are contacts that are shared between multiple users in an organization, usually stored in a common location, such as a shared mailbox or a public folder.Individual Contacts - These are contacts that are specific to a single user's mailbox and are not accessible to others.

In Outlook 2016, you can't share folders of contacts. However, you can organize individual and shared contacts into different folders within your mailbox for better management and organization.

Learn more about Microsoft Outlook:
https://brainly.com/question/17457799
#SPJ1

Combining the definitions of three words describes a data analyst. What are the three words? Select an answer: 1. analysis, analyze, and technology 2. data, programs, and analysis 3. analyze, data, and programs 4.data, analysis, and analyze

Answers

Data, analysis, and analyze. Data analysts use data, analysis, and the ability to analyze to gather insights and trends from various sources.

What is the Data?

The data is any set of information which can be analyzed and used to make decisions. It can be collected from various sources such as surveys, research, experiments, observations, and historical records. Data can be qualitative or quantitative, and it can be structured or unstructured. Data analysis is the process of interpreting and making sense of the data in order to gain insights and make better decisions. Data analysis techniques include data mining, machine learning, and predictive analytics. Data is an important resource for businesses and organizations, as it provides valuable insights about their customers, processes, products, and services.

To learn more about Data

https://brainly.com/question/28498043

#SPJ1

When planning for cloud migration, what does the breath analysis look at? Select an answer: a. what the move is worth to the business b. the general purpose of moving into the cloud c. feedback loops from those operating and developing the cloud
d. the movement to different database models

Answers

Answer: B) The general purpose of moving into the cloud.

Explanation:

Option b is correct, the general purpose of moving into the cloud.

The breadth analysis involves evaluating the overall objectives and motivations for migrating to the cloud.

It examines the broader reasons behind the decision to move and the potential benefits that cloud adoption can bring to the organization.

This analysis helps in defining the strategic direction and purpose of the cloud migration initiative, aligning it with the business goals and identifying key drivers for the move.

To learn more on Cloud Migration click:

https://brainly.com/question/30098519

#SPJ6

In order to capture market share for its product, each company focused on a particular strategy. Match the strategy to the company.

1. choice 1.apple

2.price 2. Microsoft windows

3.preferance 3.linux

Answers

Answer:

1. Apple (Price)

2. Microsoft Windows (Preference)

3. Linux (Choice)

You do not have to move your fingers to click the bottom row reach keys.
1. True
2. False

Answers

Answer:

2false

Explanation:

hope dis helps u ^_^

the answer is 2 false

______ feedback is a technology that sends resistance to the gaming device in response to actions of the user.

Answers

Force feedback is the name of the technology used that sends resistance to the gaming device in response to the actions of the user.

Gaming device

Gaming devices are a piece of hardware used by game players. For example, devices such as gamepads and joysticks all fall under the category of gaming devices. These gaming devices make use of a force feedback technology which sends resistance when users perform certain actions.

You can learn more about force feedback technology from a related question here https://brainly.com/question/1786465


#SPJ1

(x - 1) (x² + x + 1)​

Answers

Answer:

x³ - 1

Solution 1: We are given two expressions: the first is (x² + x + 1) and the second (x - 1). We multiply the two term by term till all the terms in the first expression are exhausted. Start with the x² term from the first expression, multiply it by x of the second expression and put down the product. Next you multiply the same x² term by -1 of the second expression and write the result. Repeat the process for the other two terms ( x and +1) in the first expression. Having completed the multiplication process, simplify and arrive at the final result.

∴ (x² + x + 1) (x - 1)

= [x².x + x² (- 1) + x.x + x(-1) + 1.x + 1(-1)]

= x³ - x² + x² - x + x - 1 ,which after cancellation of equal terms,

= x³ - 1 (Proved)

Solution 2: Here we use the relevant formula which may be quoted verbally as follows: The difference of the two cubes of any two quantities is equal to the product of two expressions, one of which is the difference of the two quantities, and the other the sum of their squares increased by their product.

If the two quantities are x and 1,

Then the difference of the cubes of x and 1 = x³ - 1³ = x³ - 1

One expression = difference of x and 1 = x - 1

Other or second expression

= (sum of squares of x and 1 + product of x and 1)

= x² + 1² + x.1 = x² + 1 + x = x² + x + 1

∴ By the above theorem

x³ - 1 = (x² + x + 1) (x - 1)

Explanation:

- Triangle ABC has vertices A(1,2), B(7,0), and


C(3,-2). Prove triangle ABC is an isosceles triangle.



Please help! Thanks

Answers

Triangle ABC can be proven to be an isosceles triangle by showing that two of its sides have equal lengths.

To prove that triangle ABC is isosceles, we need to demonstrate that at least two of its sides have equal lengths. Let's calculate the lengths of the sides AB, BC, and AC using the distance formula.

The length of side AB can be found using the coordinates of points A(1,2) and B(7,0):

AB = √((7-1)² + (0-2)²) = √(36 + 4) = √40 = 2√10

The length of side BC can be calculated using the coordinates of points B(7,0) and C(3,-2):

BC = √((3-7)² + (-2-0)²) = √((-4)² + (-2)²) = √(16 + 4) = √20 = 2√5

The length of side AC can be determined using the coordinates of points A(1,2) and C(3,-2):

AC = √((3-1)² + (-2-2)²) = √((2)² + (-4)²) = √(4 + 16) = √20 = 2√5

Comparing the lengths of the sides, we see that AB = AC = 2√10 = 2√5. Therefore, two sides of triangle ABC have equal lengths, indicating that it is an isosceles triangle.

learn more about  isosceles triangle here:

https://brainly.com/question/29774496

#SPJ11

which of the following best describe the relative complexity of implementing nested subprograms compared to nested blocks.

Answers

The relative complexity of implementing nested subprograms compared to nested blocks can be described as:

Higher complexity.

What are Nested subprograms

Nested subprograms refer to the ability to define subprograms (functions or procedures) within other subprograms. This allows for the creation of nested layers of code that can access variables and parameters of their containing subprogram.

Implementing nested subprograms requires careful management of variable scoping, parameter passing, and the interaction between the nested subprograms and the containing subprogram.

Read more on Nested subprograms https://brainly.com/question/31435717

#SPJ4

6. When working with a file,
__________ the blades in a vise or against a solid surface such as a work bench to
avoid injury and ensure an even stroke.

Answers

Answer:

When working with a file, stabilize the blade in a vis or against a solid surface such as a work bench to avoid injury and to ensure an even stroke

Explanation:

The file can be used to sharpen a blade to increase the effectiveness of the blade. In order to properly sharpen a file in a safe manner, the blades to be sharpen, which ae usually relatively flexible as compared to the file, should be  made stable during the repetitive forward and backward notion of the file, for safety, to avoid being injured by the recoil of the blade, and also to ensure that the stroke is evenly applied to the blade.

Write a description of the photograph to someone who cannot see the photograph. Be sure to include the title of the photograph and photographer credit in your response.

Answers

Answer:

I do not have a photo as a example but you could explain the feeling that it gives you and if its gloomy or happy go lucky you can also explain the main colors in the photo as well as the charters and/or type of object/s are in the photo

Creating compelling visuals for presentations requires people to learn what new tools?


A: gaming software


B: language translation software


C: design software


D: audio recording software

Answers

Creating compelling visuals for presentations requires people to learn what new tools  "design software" (Option C)

What is a design software?

Design software is used to produce, modify, and examine various forms of graphics and pictures, such as photography, 3D design, and the front end of websites.

Presentation software is a type of application software that enables users to build a presentation of ideas by connecting text, graphics, and audio/video. The presentation presents a tale or supports a speech or information presentation.

Although presentation software is classified as either business presentation software or general multimedia authoring software, the majority of presentation software applications already include tools that enable users to access both professional-looking business powerpoint presentation and general multimedia presentations.

A presentation program is another name for presentation software.

Learn more about presentation:
https://brainly.com/question/27326303
#SPJ1

Write a program that asks the user to enter a city name, and then prints Oh! CITY is a cool spot. Your program should repeat these steps until the user inputs Nope.

Sample Run:
Please enter a city name: (Nope to end) San Antonio
Oh! San Antonio is a cool spot.
Please enter a city name: (Nope to end) Los Angeles
Oh! Los Angeles is a cool spot.
Please enter a city name: (Nope to end) Portland
Oh! Portland is a cool spot.
Please enter a city name: (Nope to end) Miami
Oh! Miami is a cool spot.
Please enter a city name: (Nope to end) Nope

Answers

user_name = input("Please enter city name to run the program: ")

while( user_name != "Nope" ):

  print("Nice to meet you ", user_name )

  user_name = input("Please enter a name or type Nope to terminate the program: ")

I hope this helps!

Animations in an html5 page are created by defining ________________ properties for a specific css selector.

Answers

Animations in an HTML5 page are created by defining animation properties for a specific CSS selector. These animation properties include:


1. `animation-name`: This property specifies the name of the animation. It refers to the keyframes that define what happens during the animation.
2. `animation-duration`: This property sets the duration of the animation in seconds or milliseconds.
3. `animation-timing-function`: This property defines the timing function used for the animation. It determines how the animation progresses over time.
4. `animation-delay`: This property specifies the delay before the animation starts.
5. `animation-iteration-count`: This property sets the number of times the animation should repeat. You can specify a finite number or use `infinite` to make it repeat indefinitely.

To know more about Animations visit:

https://brainly.com/question/29996953

#SPJ11

What are the 5 functions of a CPU? ;-;

Answers

Fetch
Decode
Execute
Arithmetic logic unit
Control unit
•Fetch. The first step of a CPU is to fetch instructions from the program memory. ...
Decode.

•After fetching information CPU will determine what to do with that data next, this step is the decode step. ...

•Execute. ...

•Arithmetic Logic Unit (ALU) ...

•Control Unit (CU)

ced-vfrj-yiu
ev.eyo.ne joi.n.thro.ugh goog.le m.eet​

Answers

Answer:

n.o

Explanation:

n.o.

Why do I get the error ""Assignment has more non-singleton rhs dimensions than non-singleton subscripts""?

Answers

The error "Assignment has more non-singleton rhs dimensions than non-singleton subscripts" occurs when you are trying to assign values to a variable or array with mismatched dimensions.

This error typically occurs in programming languages that support multi-dimensional arrays or matrices. It indicates that the dimensions of the values being assigned on the right-hand side (rhs) of the assignment statement do not match the dimensions of the variable or array on the left-hand side (lhs) where the assignment is being made.

For example, if you are trying to assign a 2-dimensional array to a 1-dimensional array, or if the dimensions of the arrays being assigned are not compatible, this error will occur.

To resolve this error, you need to ensure that the dimensions of the rhs values match the dimensions of the lhs variable or array. You may need to reshape or resize the arrays, or adjust the dimensions of the assignment accordingly.

You can learn more about  programming languages at

https://brainly.com/question/16936315

#SPJ11

What would be considered a generous amount of storage capacity,
in GB, for a network that must allow access to 322 users? What is a
generous amount of bandwidth, in MBPS, for those 322 users?

Answers

A generous amount of bandwidth for 322 users could be considered as 100 Mbps or more. This would provide enough bandwidth for most activities and allow for smooth operation even during peak usage periods.

The amount of storage capacity and bandwidth required for a network depends on several factors, such as the size of the files being stored and transferred, the number of users accessing the network simultaneously, and the type of applications or services running on the network.

Assuming an average storage requirement of 1 GB per user, 322 users would require at least 322 GB of storage capacity. However, to ensure that there is enough space for future growth and to accommodate larger files, a generous amount of storage capacity could be considered as 500 GB or more.

As for the bandwidth requirements, it also depends on the type of activities the users are performing on the network. For example, if the users are mostly browsing the internet and sending emails, then a bandwidth of 10-20 Mbps could be sufficient. However, if the network is used for streaming videos or downloading large files, then a higher bandwidth would be required.

Assuming a moderate usage scenario, a generous amount of bandwidth for 322 users could be considered as 100 Mbps or more. This would provide enough bandwidth for most activities and allow for smooth operation even during peak usage periods.

Learn more about bandwidth here

https://brainly.com/question/13440200

#SPJ11

Throughout the reflection, make sure you have a copy of the Student Guide and your data tables. Complete the
paragraph using the drop-down menus
In this lab, you observed how pollutants affected the
of water. You also modeled and observed how
pollution affected freshwater sources, including surface water and the water in the​

Answers

Answer:

1) pH

2) ground

Can I have a brainliest?

Explanation:

In this lab, you observed how pollutants affected the ____ of water. You also modeled and observed how pollution affected freshwater sources, including surface water and the water in the  _______.

In this laboratory, you observed how pollutants affected the pH of water.

What is pH?

pH literally means the power of hydrogen ions and it can be defined as a measure of the molar concentration of hydrogen ions that are contained in a particular solution.

In Chemistry, the power of hydrogen ions (pH) is typically used to specify the acidity, neutrality or basicity of any chemical solution such as water.

In this laboratory, students were made to observe how pollutants affected the pH of water and they modeled how pollution affected freshwater sources, including surface water and the water in the​ ground.

Read more on pH here: brainly.com/question/24233266

which statement describes a characteristic of the sas automatic variable error ? a. the error variable maintains a count of the number of data errors in a data step. b. the error variable is added to the program data vector and becomes part of the data set being created. c. the error variable can be used in expressions in the data step. d. the error variable contains the number of the observation that caused the data error.

Answers

Option c is correct. The statement that describes a characteristic of the SAS automatic variable error is the error variable can be used in expressions in the data step.

When a session is launched, SAS automatically creates automatic variables, which are system variables. Automatic macro variables and automatic DATA step variables are both created by SAS. The system-generated variables that are formed when the DATA step is executed have the names of automated variables reserved for them. It is advised against using names in your own apps that begin and conclude with an underscore.

The DATA step or DATA step statements can automatically create variables. However, they are not output to the data set that is being created; instead, they are added to the program's data vector. From one iteration of the DATA step to the next, the values of automatic variables are kept rather than being set to missing.

To know more about DATA click here:

https://brainly.com/question/18761322

#SPJ4

sandy has been asked to setup linux for a new user within the company. as a service technician, she would like to setup linux further by using key commands. she opens the linux terminal and begins to type out the commands. what is the linux term

Answers

The root user, Use su plus the name of the user you just added to log on, then use the command useradd "name of the user" (for instance, useradd roman), Press "Exit" to log off.

Which of the above commands should be used to add a new user to the Linux system?

Using the useradd command, a new user account is created. The login argument needs to be a distinctive string (its length is can be configured by administrators using the chdev command). In the user name, you cannot use the terms ALL or default. Password information for a user is not generated by the useradd command.

What are the three categories of Linux users?

Root, normal, and service users are the three different types of users in Linux.

To know more about linux visit :-

https://brainly.com/question/15122141

#SPJ4

which of the following is an operating system? responses usb 2.0 usb 2.0 microsoft access microsoft access linux linux notepad

Answers

Linux is an operating system. A collection of programs that make it possible for a user to use and interact with a computer is known as an operating system.

Option A is correct.

Operating system :

The program that manages all of a computer's other application programs after it is initially loaded into the system by a boot program is called an operating system (OS). Through a defined application program interface (API), the application programs utilize the operating system by making service requests.

Which operating system is Linux?

The Linux operating system is distributed under the General Public License , and it is free and open source. As long as they do so under the same license, anyone can run, study, modify, redistribute, and even sell copies of their modified code.

Incomplete question :

Which of the following is an operating system?

a. Linux

b. USB 2.0

c. Microsoft Access

d. Notepad

e. Wi-Fi

Learn more about Operating system :

brainly.com/question/22811693

#SPJ1

What does ISO control?

how long the light will be able to enter the camera

how sensitive the camera sensor is to incoming light

the size of the circular hole in the lens that lets in light

“depth of field”

Answers

The higher the ISO rating, the greater the film's ability to capture images taken in low light. ... For digital photography, ISO refers to the sensitivity—the signal gain—of the camera's sensor. The ISO setting is one of three elements used to control exposure; the other two are f/stop and shutter speed.

Answer:

y

Explanation:

Which of the following represent features of free software licensing? Check all of the boxes that apply.
is concerned with defending users' freedom of use
is always free of cost
makes source code available for editing
allows users to redistribute modified software as proprietary
is an idea that was developed by the Open Source Initiative (OSI)

Answers

Answer: A :is concerned with defending users’ freedom of use

C:makes source code available for editing

Explanation:

Answer:

a and c

Explanation:

What is the purpose of a career portfolio?
to introduce a resume and ask for a job interview
to provide relevant information in a job application
to keep track of all of the jobs you’ve applied for throughout your career
to collect work samples and the data that is used in a resume

Answers

Answer:

To provide relevant information in a job interview

Explanation:

Answer:

b.) on edg.

Explanation:

got it right

Question 1:
The Wayfinder is an ancient piece of technology created as a means of navigating challenging stretches of space. The device connects to every piece of technology in the galaxy in order to detect planets and spaceships and then shown their location to the user. As it happens, locations of planets follow a specific distribution. A planet can exist at coordinates x,y only if
2x² + |2xy| + y² =10000
The user can use the Wayfinder to find nearby planets by input the range for x and y. Draw a flowchart and write a C++ program that models the Wayfinder. Ask the user to input a range for x and y, then print all possible planet coordinates. The program should also print the number of planets detected.
Hint: you can use pow(x,n) to get the value of xn and abs(x) to get the absolute value of x.

helpppppppppp!!!!!!!!!!

Sample output:

Question 1:The Wayfinder is an ancient piece of technology created as a means of navigating challenging

Answers

Answer:

Following are the code to the given question:

#include<iostream>//header file

#include<math.h>//header file

using namespace std;

int main()//main method

{

   long long x, x1, y, y1;//defining long variable

   int count=0,i,j;//defining integer variable

   cout<<"Enter a range for x coordinates: "<<endl;//print message        

   cin>>x>>x1;//input x and x1 value                          

   cout<<"Enter a range for y coordinates: "<<endl;//print message

   cin>>y>>y1; //input y and y1 value  

   for(i = x; i <= -x1; i++)//use nested loop that tests each coordinates                                        

   {

       for(j = y; j <= y1; j++)//use nested loop that tests each coordinates

       {

           if(((2*pow(i,2)) + abs(2*i*j) + pow(j,2)) == 10000)//use if that checks condition as per the given question

           {

               cout<<"There is a planet at "<<i<<", "<<j<<endl;//  print coordinates

               count++;//incrementing count variable value                                                    

           }

       }

   }

   cout<<"Total number of planets detected are: "<<count<<endl;//print count value

   return 0;

}

Explanation:

In this code, inside the main method long "x, x1, y, and y1" and integer "count, i, and j" type variable is declared that uses a long variable to input value from the user-end.

In the next step, two nested loops have defined that test each coordinate and define if block that checks condition as per the given question and use i, j, and count variable to print value with the message.

explain three ways in which tables make it easier to understand data

Answers

1. A table will break up data into categories. 2. It makes data easier to read or understand. 3. Some tables have images & are helpful to visual learners.

Total values in columns and lines of tables may make them simpler to read. These values should match the total of the lines and/or columns, as applicable, whereas relative values should match the exposure variable, that is, the sum of the values mentioned in the lines should equal 100 percent.

What is a table and explain its characteristics?

One's perception of a table is that it is a two-dimensional structure with rows and columns. Due to E. F. Codd's use of the term relationship as a synonym for a table when developing the relational model, a table is also referred to as a relation. The foundational element of a relational data model is a table.

Data that is too complex or extensive to be fully conveyed in the text is organized in tables so that the reader may easily see the outcomes. They can be used to draw attention to trends or patterns in the data and to improve the readability of a publication by excluding text-based numerical information.

Learn more about Tables here:

https://brainly.com/question/10670417

#SPJ2

What is the difference between apple store and play store

Answers

one is for apple and the other is for android. apple you have to pay for more stuff but get better things but mostly their literally just the exact same with different names
Other Questions
Can people pls add me im lonely :( Math2 miles is the equivalent to how many feet? Can someone help please??What are the values of the variables in eachfigure? under the 1035 policy exchange provision, which of the following will not receive favorable tax treatment? an annuity contract exchanged for a life insurance policy an endowment policy exchanged for an annuity contract a life insurance policy exchanged for another life insurance policy an annuity contract exchanged for another annuity contract just doing this to finish my account Write a recipe to prepare a cup of coffee.First make a list of ingredients and write instructions to prepare. ASAPWhat does Dickinson compare nature to in the poem?ambitionshistory emotionshumans list a few different ways you might redissolve the pbcl2 precipitate. How is pH measured?A. It is based on a scale of o to 14.B. It is a percentage between 1 and 100.C. It is a level between 1 and 4.D. It is a decimal between 0 and 1. (Will Give Brainliest)Directions: Print and read the text The Hunt for Gold. Mark the text to identify the evidence that supports the theme's development and helps you find the text's theme. Then write one example of each within the organizer Small tumor with a pedicle or stem attachment. They are commonly found on mucous membranes such as those lining the colon or nasal cavity. Colon polyps may be precancerous. if || = n, how many distinct events does the probability space have? lily likes to collect records. Last year had 12 records in collection. Now has 15 records. What is the percent increase of collection? The figure skater was able to use the strength of her arms to pull her spinning mass inward. Using the skater as a model for the forming solar system, what force does her muscular strength represent? a state must have people t or f so it said i have to find this in i dk it. _______ leadership is an example of passive leadership. multiple choice a)defensive b)transactional c)laissez-faire d)neutral tactile .another sentence with adjectives Andrew walked his dog Neural control of gfr is mediated by ________ that innervate ________ receptors on vascular smooth muscle causing ________ a map scaled at 1 75 000 is considered to be what size