1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
hram777 [196]
2 years ago
12

Higher Order Functions used for simulations of dice rolls. Definition: An n-sided dice function takes no arguments and always re

turns an int from 1 to n, inclusive. Types of n-sided dice functions: - Randomized: a randomized dice function can be fair, meaning that ir produce each possible outcome from 1 to n with equal probability. Examples: four_sided, six_sided - Deterministic: a deterministic dice function will be used for testing. Deterministic test dice functions always cycle through a fixed sequence of n values. - We write a make_fair_dice higher-order function to return a fair, randomized n-sided dice function. - We write a make_test_dice higher-order function that will return a deterministic, testing n-sided dice function.
Computers and Technology
1 answer:
tiny-mole [99]2 years ago
5 0

Answer:

#include <iostream>

#include <time.h>

#include <string>

using namespace std;

int main(){

srand(time(NULL));

cout<<"Throw dice"<<endl;

int b =0;

int a=0;

a=rand()%6;

b=rand()%6;

for (int i =0;i<1;i++)

{cout<<"dice one: "<<a<<endl;}

for (int i =0;i<1;i++)

{cout<<"dice two: "<<b<<endl;}

if(a>b)

{cout<<"first dice won"<<endl;}

if(b>a)

{cout<<"second dice won"<<endl;}

else{cout<<"they are same"<<endl;

return main();

}

return 0;

}

Explanation:

/*best dice roll game just for you change it as you want but all necessary things are there/*

You might be interested in
What portable computing devices, designed for user convenience, have a sensor called an accelerometer that senses vibrations and
Tomtit [17]

The answer is Tablets. It is a portable personal computer, generally with a mobile operating system and LCD touchscreen display processing circuitry, and a rechargeable battery in a single thin, flat package. It is bigger than smartphones.

7 0
3 years ago
To determine why a computer program started to function differently, Mel should most likely use data to
Amiraneli [1.4K]

Answer:

convince the software company of the issue

Explanation:

3 0
3 years ago
Read 2 more answers
What is active server page ?or why is it important?
Thepotemich [5.8K]
For Example,
If You Were Hosting Ark Survival And Suddenly The Server Was Off Then The Players Goes Off.The Server Is How We Connect To The Platform In Order To Do The Action Intended.
5 0
3 years ago
Which of the following statements is false?
SOVA2 [1]
People can use software to make their lives more enjoyable
5 0
2 years ago
um I'm new and I just sign up like right now and brainly says I've reached my daily limit for my questions why?
Natalija [7]

Answer:

Im not sure why but maybe you can find a way to contact the people who own it and see if they know because that hasn't happened to me. How many questions have you asked

Explanation:

7 0
3 years ago
Other questions:
  • What does delegating access give someone the permission to do on behalf of the user? Choose two answers.
    5·1 answer
  • You have a network that needs 29 subnets while maximizing the number of host addresses available on each subnet. How many bits m
    13·1 answer
  • a ____ consists of wires connecting the cpu and other parts of the computer. The _____ transfers data between CPU and memory uni
    6·1 answer
  • What is 1-7? Plz help!!!
    15·1 answer
  • Write a program that uses nested loop or for statements to display Pattern A below, followed by an empty line and then another s
    5·1 answer
  • New trends, tools, and languages emerge in the field of web technology every day. Discuss the advantages of these trends, tools,
    15·1 answer
  • Dynamic programming does not work if the subproblems: ___________
    5·1 answer
  • What are five types of applications you can create in Visual Basic 2017?
    12·2 answers
  • How can you prevent someone with access to a mobile phone from circumventing access controls for the entire device
    5·1 answer
  • What does Amara hope will<br> happen when Dad sits on the sofa?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!