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
Consider the following schema for customer: (id, name, street, city, state, zip, phone), in which customers are uniquely determi
Art [367]

Answer:

Super key is a set of attributes that uniquely identifies all attributes in a relation.Super keys are more than candidate key.

Explanation:

For example in the given schema where

Customer: (id , name , street , city,state,zip,phone)

We have a relation we check super keys by following dependencies

Functional Dependencies                          Super Key

id                                                                     YES

name                                                               YES

id , name -> street , city,state,zip,phone       YES

id , street  ->name , city,state,zip,phone       YES

id,city ->name , street ,state,zip,phone         YES

id,state ->name , street ,city,zip,phone         YES

id,phone  ->name , street ,state,zip,city        YES

id , name , street                                             YES

id , name , street , city                                    YES

id , name , street , city,state                          YES

id , name , street , city,state,zip,phone         YES

All these are uniquely identified

All these are super key but in reverse they are not super key such as

street , city,state,zip,phone->id , name        No

8 0
3 years ago
What does N represent when analyzing algorithms?
Mademuasel [1]

Answer: "N" is considered as the size of the input that is being given in the algorithm.

Explanation: During a problem solving process , a algorithm is used to analyze the problem . Many function and  steps are to be taken care of while analyzing algorithm. Among analyzing step, input is also given which is usually zero more than that . An input has a certain size which is given by the initial "N".  The input size defines the length of the string for the input.

4 0
3 years ago
A new user needs access to their files in iCloud without relying on the operating system (OS). How would the user access the App
m_a_m_a [10]

Answer:

Log in to iCloud.com on a browser

Explanation:

On your browser which should be a supported browser, you should log in to iCloud.com since iCloud is not supported on mac OS X earlier than mac OS X Lion 10.7.5

7 0
3 years ago
How many times go you need to click the format painter button to apply copied formats to multiple paragraphs one right after the
Umnica [9.8K]
Double click would be enough
6 0
3 years ago
Read 2 more answers
Jhon bought a new printer for his desktop computer. It does not work even though he checked all the cables and cords. What do yo
ExtremeBDS [4]
Im not for sure but it might be B or C
4 0
2 years ago
Read 2 more answers
Other questions:
  • You are entering command that operates on a file. The path to the file is lengthy and confusing and you are afraid that you will
    12·1 answer
  • Which cisco ios command is used to display the current ospf neighbors and their rids?
    11·1 answer
  • Which one of the following is not the name of a 20th century school composition
    14·2 answers
  • What is the rationale behind the development of an operating system in computing?
    15·1 answer
  • Pls answer fast in five mins​
    12·1 answer
  • First write a method to calculate the greatest common divisor (GCD) of two positive integers using Euclid’s algorithm (also know
    10·1 answer
  • Pros and cons of access to a wide range of online services when it comes to an individual's safety?
    14·1 answer
  • A company database needs to store information about employees (identified by ssn, with salary and phone as attributes), departme
    7·1 answer
  • Computer in education are used for teaching and learning aids​
    14·1 answer
  • Select the WRONG statement about Slide Transitions.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!