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
The company database may be stored on a central database server and managed by a database adminstrator true or false
RUDIKE [14]
The answer is True.  <span>The company database may be stored on a central database server and managed by a database administrator.  </span>
6 0
3 years ago
In the terms of OOP, in the microwave system, current time is a BLANK and change heat is a BLANK
otez555 [7]

Answer:

1. Data and 2. procedures or functions

Explanation:

The object in an object oriented programming comprises of data and the procedures, The data describes the object, and the procedures explains what that particular object can do. And that is a function and nothing else. We declare a data, and procedure or function. We then initialize the data through constructor. And finally we does the operation like here its change heat by defining a function for it. A function is first declared, then defined and finally called for getting the desired output.

4 0
3 years ago
a. Do you think the U.S. government should censor information on the Web, such as instructions for making weapons, to protect th
MrRissso [65]

Answer:

The answer is YES.

Explanation:

<em>Things pertaining to weapons, destructive materials should be shared with precautions or much better if these things should not be put online. Since internet is widely available to almost all types of users and almost to all places, we cannot be sure of who will get hold of these information. Kids could easily see this and gain knowledge and out of curiosity will try these dangerous things. Terrorist groups will also have access to these information and who knows might happen to poor innocent souls around.  </em>

<em> </em>

<em>I don't think it would violate the right of First Amendment regarding freedom of speech. Freedom should be granted on matters that are most sensible. And this time, we are just protecting the rights of children and other innocent people who can be a victim including you. We are talking about weapons and destructive materials here which is non beneficial if one could get hold of this information, in my opinion. If there is really a need to construct these things, it is better to consult an expert or an authority to ensure that nobody gets harm.</em>  

5 0
3 years ago
How to generate random numbers in excel without duplicates
Lilit [14]

Answer:

<h3>Generate Random Number List With No Duplicates in Excel:</h3>

1. Select cell B3 and click on it.

2. Insert the formula: =RANDBETWEEN(10,30)

3. Press enter.

4. Drag the formula down to the other cells in the column by clicking and dragging the little “+” icon at the bottom-right of the cell.

Explanation:

Hope it helps you..

Your welcome in advance..

(ㆁωㆁ)

5 0
3 years ago
Create a goal seek analysis to determine what the price should be to generate demand of 2,625,000 tablets given that the supplie
Svetach [21]

Answer:

Explanation:

The following image shows the required entries that are to be filled in the excel sheet:

Goal Seek Parameters and Results

Set Cell                                        C14

To Value By Changing Cell        2625000

By Changing Cell                         C3

Resulting Price?                           $290

Explanation:

The goal seek tool in excel is used to change a value in the calculation to get the desired results.

In the given question, it is required to get the demand of tablets to reach the value of 2,625,000 by changing the price.

The value that is to be inserted in the “Set cell” field is the cell number which shall contain the desired result. This cell must have a formula having the cell which is inserted in the “by changing cell” field.

In the given question, the value of demand is desired.

The cell value which stores the calculated demand is C14 is and hence it is inserted in the field “Set cell”

The “to value” field of the goal seek tool is used to set the desired result.

Here, 2,625,000 is the value that is desired and hence it filled in the “To value” field.

The “By changing cell” field of the goal seek tool, represents the cell whose value is to be changed for getting the desired results.

Here, the value of price is required to be changed to get the required demand, thus the value that should be inserted in the “By changing cell” of the goal seek tool is C3, which represents the price.

The required demand is achieved by changing the price to $290.

8 0
3 years ago
Other questions:
  • Write an UPDATE statement that modifies the InvoiceCopy table. Change the PaymentDate to today’s date and the PaymentTotal to th
    7·1 answer
  • Because a vector container uses a dynamically allocated array to hold its elements,
    5·1 answer
  • Programs which tell the computer what to do:<br> a. Software<br> b. ROM<br> c. RAM<br> d. Hard disk
    6·2 answers
  • A #1 Phillips screwdriver has a shaft diameter of 
    13·1 answer
  • What are the benefits of transferable skills check all the boxes that apply
    6·2 answers
  • When you see ####### in a cell, you should​
    11·1 answer
  • Suppose the following groups are defined to shorten a system’s access control lists: – Group1: Alice, Bob, Cynthia, David, Eve –
    12·1 answer
  • Can anyone help me with these assignments??? Hands On Assignments- Insertion of Symbols, Special Characters, and Images.... and
    9·1 answer
  • Read the following scenario, and then decide if you should upgrade the computer. You have a desktop that you use primarily for w
    7·1 answer
  • 1. What are the process involved in data processing cycle?​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!