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
Who knows a website that can connect videos in your phone
Arte-miy333 [17]
Get a screen recorder then record all the videos u wanna save then u can go back and watch them wenever u want to
5 0
3 years ago
Database management systems _____. a. include transaction-processing reports for database analysis b. are used to create, organi
GaryK [48]

Answer:B. Are used to create, organize, and manage databases

Explanation: Database management system (DBMS) is a computer software which is used to collect, analyse or evaluate and retrieve data from a database. It is essential to the flow of businesses or other activities of an organisation.

Examples of database management system softwares MICROSOFT ACCESS,FOXPRO,ORACLE etc all this are effective as it helps to manipulate the data structure,field names,the file formats etc.

3 0
3 years ago
Which of the following is the most significant outcome of the formation of the SMPTE?
olga55 [171]

Answer:

The SMPTE created an organized system of film technology, development, and distribution.

Explanation:

The SMPTE opened the door for Union organization within the film industry is true but not the most significant outcome of the formation of the SMPTE. However, the second option is certainly the most significant outcome as SMPTE is the most organized system of film technology, development, and distribution. And the other two options are also correct but the most significant outcome of the formation of the SMPTE is the second option.

7 0
3 years ago
A student is reading a book for language arts. She has to finish three chapters by class tomorrow, because there will be a quiz.
Jobisdone [24]

Answer:

Distracted..?

8 0
3 years ago
Read 2 more answers
Which word is most appropriate to describe a laptop?
Thepotemich [5.8K]
The best word to describe a laptop would be Portable
8 0
3 years ago
Other questions:
  • What is the operating system?
    9·1 answer
  • A bin contains 100 sty le a notebooks, 100 style b notebooks, and 100 style c notebooks. antoine will select 3 notebooks from th
    9·1 answer
  • What is the best way to protect computer equipment from damage caused by electrical spikes
    15·1 answer
  • Why is the len ( ) function useful when using a loop to iterate through a stack?
    6·1 answer
  • You are part of a team that is setting up a movie streaming service. The company is planning on initially making available 500 m
    8·1 answer
  • C++
    11·2 answers
  • If your database is in archivelog mode, how can you force an archive?
    7·1 answer
  • what term defines inventiveness uncertainty and futuristic ideas typically deals with science and technology
    15·1 answer
  • Write the difference between left-sentential form and <br> right-sentential form
    13·1 answer
  • A keyboard would be considered what 2 things
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!