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
How many generations of computer languages
vichka [17]
5 generations................
6 0
3 years ago
54 points!!! Cyber security
Veseljchak [2.6K]

Answer:

a

Explanation:

3 0
3 years ago
Explain briefly why we say that the "Web" exists only in our minds.
hammer [34]

Answer:

The Web is the system of web pages and sites that uses the Internet to pass the files across. It was developed in the late 1980’s by Tim Berners-Lee, and you <em>need a Web Browser to access it</em>. This could either be in a PC, a mobile phone or one of the new iPods.

Explanation:

I guess you could look at it as just one of many services that use the Internet – other services include e-mail, internet telephony and peer-to-peer file transfers. Hope this helps ^-^

4 0
3 years ago
Travis sends Suri what purports to be a link to an e-birthday card, but when she clicks on the link, software is downloaded to h
12345 [234]

Answer:

Identity Theft

Explanation:

Identity theft is the act of someone who obtains details about someone else illegally.  This is done to find personal and financial information such  name, address,social security number, passwords, and credit card number, phone number, e-mail, etc. Then the hacker can use this information to control bank accounts, e-mails, computers, portray himself as you are, or sell information to someone else.

3 0
3 years ago
In a circular linked list the last node points to the____ node.
horsena [70]

Answer: option A) First

In a circular linked list the last node points to the first node.

Explanation: As in a circular linked list, the node will point to its next node. Since the node next to last node is the first node hence last node will point to first node in a circular way. The elements points to each other in a circular path which forms a circular chain.

4 0
4 years ago
Other questions:
  • PLZ HELP ASAP!!!
    10·1 answer
  • Who usually signs a collection letter?
    15·2 answers
  • I need the alphabet quickly! sorry bad with remembering!
    10·1 answer
  • If the wrong server edition is installed, what command can be used to change to a different edition?​
    5·1 answer
  • Which game console was the first to use the blue ray side as a distribution medium ???
    15·2 answers
  • Which tool allows multiple users to dynamically update a document at the same time? Question 3 options: Google Docs OneDrive Exc
    14·1 answer
  • Which function works best when you need to remove an element at a pacific index and a list
    15·1 answer
  • Rick is teaching a photographic worship about sun color and image. He shows the students a few images to teach them about contra
    12·1 answer
  • Use MPLAB to write an asemply program to multipy two numbers (11111001) and (11111001). Then save the product in file reisters 0
    8·1 answer
  • Joining a computer to active directory involves joining the computer to a workgroup. True or false.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!