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
zvonat [6]
3 years ago
10

Define a function roll() that takes no arguments, and returns a random integer from 1 to 6. Before proceeding further, we recomm

end you write a short main method to test it out and make sure it gives you the right values. Comment this main out after you are satisfied that roll() works.
Computers and Technology
1 answer:
Lostsunrise [7]3 years ago
6 0

Answer:

Follows are the code to this question:

#include <iostream>//defining a header file

using namespace std;

int roll()//defining a method roll

{

return 1+(rand() %5);//use return keyword that uses a rand method

}

int main()//defining main method

{

cout<<roll();//calling roll method that print is value

return 0;

}

Output:

4

Explanation:

In this code,  the "roll" method is defined, that uses the rand method with the return keyword, that returns the value between 1 to 6, and in the next step, the main method is declared, that uses the print method to calls the roll method.

You might be interested in
Please, ignore
Komok [63]
Abhheoorioooooohhhhh omg
3 0
3 years ago
Read 2 more answers
Electronic ledger that tracks mathematical data
fenix001 [56]
<span>Spreadsheet software consists of an electronic ledger designed to perform mathematic calculations quickly </span>
6 0
3 years ago
Melissa needs to put a topic name on her email that she will send will to her teacher . choose the name of the field
Lera25 [3.4K]

It is A. I am pretty sure

8 0
3 years ago
Read 2 more answers
Write down the numbering system from base 2 to 200​
natka813 [3]

Answer:

So, 11001000 is the binary equivalent of decimal number 200 (Answer).

 

3 0
3 years ago
What features are needed in a mobile to make it a business solution?
ad-work [718]

Answer:

Connectivity, Security, Productivity

Hope this helps;)

6 0
3 years ago
Other questions:
  • Background Susan finished work on system architecture issues, and her system design specification was approved. Now she is ready
    15·1 answer
  • Write a Python program to do the following:
    12·1 answer
  • Which is a good guideline to follow when choosing a background for your slides?. . A. Use a different background for each slide.
    8·1 answer
  • In 1988, Robert Morris, Jr. launched a program called the _________ that used weaknesses in e-mail programs and operating system
    5·1 answer
  • Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels
    11·1 answer
  • And then what happened,Paul Revere rhyme
    14·2 answers
  • Write out a shorthand version of the border property which will apply border that is 5 px wide, colored in lightgreen, and solid
    9·1 answer
  • List at least 5 professions for people working in the Information/Communication<br> fields.
    10·1 answer
  • Submit your business presentation that clearly compares and contrasts three different cell phone service plans. I have TO HAVE I
    14·1 answer
  • security investigators discovered that after attackers exploited a database server, they identified the password for the sa acco
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!