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
Which information is required when designing a field? check all that apply.
Alex_Xolod [135]

Answer:

Explanation:

dimensions or calculation

3 0
2 years ago
What command will prevent all unencrypted passwords from displaying in plain text in a configuration file?.
Juli2301 [7.4K]

Answer:

(config)# enable password secret

(config)# enable secret Encrypted_Password

(config-line)# password secret

(config)# enable secret Secret_Password

(config)# service password-encryption

Explanation:

To prevent all configured passwords from appearing in plain text in configuration files, an administrator can execute the service password-encryption command. This command encrypts all configured passwords in the configuration file. For more: https://ccnav7.net/what-command-will-prevent-all-unencrypted-passwords-from-displaying-in-plain-text-in-a-configuration-file-2/

3 0
2 years ago
_______ software helps run the computer and coordinates instructions between other software and the hardware devices. select one
Mila [183]
'SYSTEM' <span> software helps run the computer and coordinates instructions between other software and the hardware devices.</span>
5 0
2 years ago
Which font style is said to be slightly above the other line of text?
Keith_Richards [23]
I think the answer would be "superscript"
8 0
3 years ago
Read 2 more answers
Write a script that prints the multiples of 7 between 0 and 100. Print one multiple per line and avoid printing any numbers that
Sedbober [7]

Answer:

The program to this question can be described as follows:

Program:

#include <iostream> //defining header file

using namespace std;

int main() //defining main method

{

int x; //defining integer variable

for(x=0;x<=100;x++) //defining loop to count value from 0 to 100

{

   if(x%7==0) //check value is divisable by 7

   {

       cout<<x<<endl; //print value

   }

}

   return 0;

}

Output:

please find the attachment.

Explanation:

In the above code, an integer variable x is declared, which is used in the for loop, in this loop variable  "x" starts from 0 and ends when the value of x is less than and equal to 100.

  • Inside the loop an, if block is used that defines a condition that is (i%7==0), it will check, that the value is divided by 7.
  • In this loop, a print method is used, that prints its values.

8 0
3 years ago
Other questions:
  • Judy forgot where she saved a certain file on her computer. Therefor, she searches for all files with a jpg file extension. Whic
    11·2 answers
  • Which of the following is a feature that is in the Excel program and NOT in Word? (Select all that apply.)
    14·1 answer
  • Which of these automotive repair areas helps the vehicle change speeds to operate efficiently under all conditions?
    5·1 answer
  • Charlie is taking his slide presentation to a meeting at a remote location. He saves his presentation as a package on a CD. Char
    15·2 answers
  • Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numb
    10·1 answer
  • How do you turn on the Track Changes feature in a word-processing document?
    12·1 answer
  • One key to success in a career is to be an accomplished
    15·1 answer
  • Each row in a database is a set of unique information called a(n)
    8·2 answers
  • Mention two strategies of collecting data​
    13·1 answer
  • What science category includes physics and biology?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!