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
Help me out with this .....
kykrilka [37]

Answer:

D

Explanation:

You are welcome

8 0
3 years ago
Which of the following statements is false? a. A class can directly inherit from class Object. b. If the class you're inheriting
Dovator [93]

Answer: C

Explanation:

5 0
3 years ago
You want to make it possible for your smartphone to share its internet access wirelessly with your friends device which of the f
IrinaVladis [17]

Answer:WiFi or hotspots

Explanation:you will have to turn on your WiFi or hotspots on your smart phone and allow your friend to also turn his WiFi or hotspot after you will search for your WiFi and connect there he can use the internet

6 0
3 years ago
How long does a baby dolphin stay with its mum
g100num [7]
The nursing usually takes up to 18 months, i.e. one year and a half.

The baby dolphin may however remain with his mum for up to 3-6 years.
5 0
3 years ago
________ is the process of translating a task into a series of commands that a computer will use to perform the task.
IgorC [24]
Programming 
It can also be described as Reverse Engineering 
7 0
4 years ago
Other questions:
  • Ray has to type an invoice using the QWERTY keyboard. Along with letters and numbers, he also has to insert the dollar sign. Whi
    13·1 answer
  • Which information is considered free for use?
    9·2 answers
  • Does any one play sniper clash 3d ??? ​
    9·2 answers
  • During which phase of film making does the team outline their vision for the film?
    5·1 answer
  • Which of the following statements are true?
    13·1 answer
  • How old was the mummy where they found a wooden prosthetic toe on him?
    6·1 answer
  • You’re having trouble connecting to the Internet so you call your Internet service provider for help. They need to know the perm
    15·1 answer
  • Which of the following correctly declares and initializes a Scanner object that will use input from the keyboard as its data sou
    13·2 answers
  • In Python what are the values passed into functions as input called?
    13·1 answer
  • What font family is Times New Roman an what font family is Arial?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!