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
aleksandrvk [35]
3 years ago
13

Write a program that (a) generates a vector with 20 random integer elements with integers between -29 and 30, (b) replaces all t

he negative integers with 100.
Computers and Technology
1 answer:
Ghella [55]3 years ago
5 0

Answer:

import random

randomlist = []

for i in range(0,20):

n = random.randint(-29,30)

if n < 0 :

n = 100

randomlist.append(n)

print(randomlist)

Explanation:

The random module is first imported as it takes care of random. Number generation.

An empty list called randomliay is created to hold the generated random integers.

Using a for loop, we specify the range of random numbers we want.

Inside the for loop ; we attach our generated random integer which will be in the range (-29 to 30) in a variable n

For each n value generated, if the value is less than 0( it is negative, since all the values are integers), replace the value with 100.

You might be interested in
I'll pay 50 dollars to anyone who can do this leave your snap after answering doing it and ill cash app it
gladu [14]

Well for must cases it is the Ram of the system and the processor I will show you how you can get rid of slow processing

  1. Run the task manager then try to stop some running programs
  2. the antivirus sometimes slows the computer due to the processing power it takes.
  3. I would recommend that all program should be closed from the task manager and close some running apps in the system settings go to start up and then close it now you are good to go.

5 0
3 years ago
Hello everyone. New ppl on Ro.blox? I want to play sometime.
alexira [117]

Answer:

Hello :)

Explanation:

Yesh i play Ro.blox, maybe u or me could friend each other

6 0
3 years ago
Read 2 more answers
Assuming outFile is a file stream object and number is a variable, which statement writes the contents of number to the file ass
professor190 [17]

Answer:

Its outfile<<number.

However, before this we need to write

outfile.open("xyz.txt", ios;;out)

outfile<<number

And this code will do what is required in the question. This is going to write the number's content to the xyz.txt file which is the file associated with the outfile.

And remember this is in C++. And C++ is a imperative oriented programming language. Undoubtedly, Python and R are fully object oriented programming languages.

Explanation:

The answer is self explanatory.

7 0
3 years ago
You are configuring a firewall to use NAT. In the configuration, you map a private IP address directly to a persistent public IP
Ivan

Answer:

Option B (Static NAT) would be the correct choice.

Explanation:

  • Static NAT seems to be a method of NAT methodology used to navigate as well as monitor internet usage from some kind of specific public IP address to something like a private IP address.
  • Everything always allows the provision of web access to technology, repositories including network equipment inside a protected LAN with an unauthorized IP address.

Some other decisions made aren't relevant to the situation in question. So the above alternative is indeed the right one.

8 0
3 years ago
When saving a memo you created in Word, which of the following extensions is automatically assigned to the document?
Lena [83]
.docx is the default file extension on a Word doc.
6 0
3 years ago
Read 2 more answers
Other questions:
  • . When you have multiple graphics positioned on a page, you can _______________ them so that they are a single graphic instead o
    9·1 answer
  • What does "Forward" in emails do?​
    7·1 answer
  • You are out on the water. you do not understand what another boater intends to do. what sound signal should you make?
    14·1 answer
  • People use a computer connected to the internet to manage financial accounts
    15·1 answer
  • DeShawn uses Google Ads. He wants to enable website call conversion tracking so he can see how his current ad campaign is drivin
    12·1 answer
  • Select two netiquette guidelines. In a paragraph of no less than 125 words, explain why these guidelines make professional onlin
    9·1 answer
  • Often used in connection with a business
    6·1 answer
  • So, I have strict parents &amp; need help, if u don’t know how to fix this after u read it, leave. I don’t want u getting points
    11·2 answers
  • What is the target audience of an ad?
    11·1 answer
  • What are the characteristics of computer. Explain any one​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!