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
fomenos
1 year ago
7

Question 1

Computers and Technology
1 answer:
Fittoniya [83]1 year ago
8 0

Using the knowledge in computational language in C++ it is possible to write a code that generates and displays 10 random (integer) numbers between 0 and 50.

<h3>Writting the code in C++</h3>

<em>  class SecureRandom : Random</em>

<em>    {</em>

<em>        public static byte[] GetBytes(ulong length)</em>

<em>        {</em>

<em>            RNGCryptoServiceProvider RNG = new RNGCryptoServiceProvider();</em>

<em>            byte[] bytes = new byte[length];</em>

<em>            RNG.GetBytes(bytes);</em>

<em>            RNG.Dispose();</em>

<em>            return bytes;</em>

<em>        }</em>

<em>        public SecureRandom() : base(BitConverter.ToInt32(GetBytes(4), 0))</em>

<em>        {</em>

<em />

<em>        }</em>

<em>        public int GetRandomInt(int min, int max)</em>

<em>        {</em>

<em>            int treashold = max - min;</em>

<em>            if(treashold != Math.Abs(treashold))</em>

<em>            {</em>

<em>                throw new ArithmeticException("The minimum value can't exceed the maximum value!");</em>

<em>            }</em>

<em>            if (treashold == 0)</em>

<em>            {</em>

<em>                throw new ArithmeticException("The minimum value can't be the same as the maximum value!");</em>

<em>            }</em>

<em>            return min + (Next() % treashold);</em>

<em>        }</em>

<em>        public static int GetRandomIntStatic(int min, int max)</em>

<em>        {</em>

<em>            int treashold = max - min;</em>

<em>            if (treashold != Math.Abs(treashold))</em>

<em>            {</em>

<em>                throw new ArithmeticException("The minimum value can't exceed the maximum value!");</em>

<em>            }</em>

<em>            if(treashold == 0)</em>

<em>            {</em>

<em>                throw new ArithmeticException("The minimum value can't be the same as the maximum value!");</em>

<em>            }</em>

<em>            return min + (BitConverter.ToInt32(GetBytes(4), 0) % treashold);</em>

<em>        }</em>

<em>    }</em>

See more about C++ code at brainly.com/question/19705654

#SPJ1

You might be interested in
What is pseudocode? O A way of describing a set of instructions in text form using plain english O A diagrammatic representation
Marat540 [252]

The definition of pseudocode is that; A: A way of describing a set of instructions in text form using plain English

<h3>What is Pseudocode? </h3>

In computer science, pseudocode is defined as a plain language description of the steps in an algorithm or another system.

Now, the way Pseudocode works is that it often makes use of structural conventions of a normal programming language to be utilized for human reading instead of machine reading.

Pseudocode usually omits details that are essential for machine understanding of the algorithm, such as variable declarations and language-specific code.

Read more about Pseudocode at; brainly.com/question/11623795

8 0
3 years ago
17. Write a SELECT query for the palateE4 database that produces a result grid listing paintName, and a count of the occurrences
GaryK [48]

Answer:

SELECT paintname, COUNT(paintname) as count_paintname

FROM paint

GROUP BY paintname HAVING COUNT(paintname) > 2

ORDER BY paintname

Explanation:

The structured query language or SQL statement returns two columns of paintname and the count of the distinct paint names in the paint table with rows of grouped paint names greater than two and in the ascending order of the names.

4 0
3 years ago
To specify grouping and sorting for a report, click the ____ button on the design tab in layout view.
inessss [21]
Hello <span>Sydney2640 </span><span>

Answer: To specify grouping and sorting for a report, click the group-and-sort button on the design tab in layout view.

Hope this helps
-Chris</span>
4 0
3 years ago
A whining sound coming from the power supply after attempting to power up a system is a typical sound that occurs when a power s
leva [86]

Answer:

false

Explanation:

a PC needs to give a silent noise or better still no noise when it is being powered. It could be a problem within the coil in the power supply unit or a graphics card and the noise changes volume when a certain task is performed on it.

The two main causes of whinning noise in a computers are capacitors squealing and coil whinning.

7 0
4 years ago
Antifreeze is not considered a hazardous waste by the EPA unless it is used or otherwise becomes contaminated.
Ahat [919]

False might be the answer

6 0
3 years ago
Read 2 more answers
Other questions:
  • What's the purpose of maintaining a network of digital forensics specialists?
    14·1 answer
  • Which of the following is FALSE? Select one: a. The fast-paced and collaboration-based business environment makes email less use
    10·1 answer
  • A circuit contains four resistors connected in series. R1 is 100 , R2 is 200 , R3 is 240 , and R4 is 600 . What is the total cir
    13·1 answer
  • A __________ is when the sender cryptographically marks a message with its private key, which is achieved by a cryptographic alg
    12·1 answer
  • Suppose we have a linearly separable dataset, and we divide the data into training and validation sets. Will a perceptron learne
    8·1 answer
  • Access-lists pose a logical problem which often has more than one solution. Can you think of a different set of rules or placeme
    8·1 answer
  • What is the term for a set of actions carried out on inputs?
    7·1 answer
  • Name the type of software which provides the user interface. [1 mark
    5·1 answer
  • Question #2
    8·2 answers
  • Re-write the below program correcting the bugs
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!