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
A unique aspect of Java that allows code compiled on one machine to be executed on a machine of a different hardware platform is
notka56 [123]

Answer:

Java's bytecode

Explanation:

To execute its operations, java programming languages uses bytecodes.

These bytecodes are literally instructions of a java virtual machine (or JVM). They are generated in form of a class file as soon as the java program is ran and executed. In other words, the java compiler compiles the code and generates the bytecode.

As soon as the bytecode is generated, it can be transferred to a different machine and platform completely and one can run this bytecode on this different machine.

8 0
3 years ago
In which part of a presentation should you provide background information, ask a thoughtful question, or offer an interesting
makkiz [27]

The correct answer is A. Opening

Explanation:

In a presentation or the text, the opening is the first section that should allow the audience to understand what is the topic and focus. This is achieved through a hook that can include an interesting fact or a rhetorical question (a question that makes the audience think) because these two elements grab the attention of the audience. Additionally, after the hook, it is common to provide background information about the topic of the presentation, and finally, the speaker will state the main point or thesis statement. This occurs before the body of the presentation, which is the main section, and the closing, which is the last section. Thus, elements such as background information or an interesting fact are part of the opening.

8 0
4 years ago
Plz help
vazorg [7]

The correct answer is:


a. All parts of the circuit will begin to carry higher amounts of current than normal.


Explanation:


When two or more than two conductors of different phases touch each other in a power line, the part of the impedance is shunted out of the circuit due to which a large current flow in the un-faulted phases, such current is called the short circuit current. Short circuit current decreases the impedance in the circuit while the current in the circuit increases.

8 0
3 years ago
Read 2 more answers
Testing a website includes visiting every web page on the site and selecting every link, tab, and button available.
mixas84 [53]

Answer:

Wouldn't it be false?

Explanation:

because what if the website doesn't allow some kinds of people on certain pages?

(If its wrong then sorry.)

4 0
2 years ago
Suppose a MATV/SMATV (Satellite Master Antenna Television) firm has to start it's operation in the metropolitan area of a countr
Nata [24]
Cdizvwjcuabcusyfbwhcyeiixhw. jai
8 0
3 years ago
Other questions:
  • What is the function of the Status bar in Outlook 2010?
    9·1 answer
  • Which one of the following oscilloscope controls is used to move the trace up and down the screen vertically? A. Focus B. Sweep
    9·2 answers
  • Document creation is a key business function because:
    6·2 answers
  • Write the C++ if statement that compares the contents of the quanity variable to the number 10. If the quantity variable contain
    12·1 answer
  • ________ consists of detailed, preprogrammed instructions that control and coordinate the computer hardware components in an inf
    11·1 answer
  • Which of the following are correct? I. Hold the middle mouse button to rotate the model on the screen. II. To pan the model, hol
    15·1 answer
  • Which role involves designing and creating advertisements for marketing purposes?
    14·1 answer
  • 1. What are the biggest password mistakes that people and companies make? How can you avoid those mistakes?
    11·1 answer
  • Three different numbers need to be placed in order from least to greatest. For example, if the numbers are ordered 9, 16, 4, the
    9·1 answer
  • Who is primarily responsible for ensuring cybersecurity in society? Select 3 options.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!