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]
2 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]2 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
Case Study
larisa [96]

Answer:

1. Design system to avoid theatre tickets selling issue.

2. Resources provided to student who can built a system for the theatre tickets booking.

3. Medallion Theatre Booking System

Add/edit patron

Add/edit production

Add/edit performance

Add/edit seats

Purchase tickets

Generate Tickets Sold Report

4.GUI or graphical user interface allows the user to connect through graphical icons.

Explanation:

The main purpose is to avoid problems of duplicate tickets sales in future. The system will enable the selling of each seat to one customer only and when an attempt is made to resold the seat the system warns the user creating a check for original sale. This will help theatre to avoid any issues in future and customers will be happy with their ease of confirmation of booking.

7 0
3 years ago
Sample outputs with inputs 9 5 2 -1 in python.
Nezavi [6.7K]
Sorry phsnjajajajqjkakw
7 0
3 years ago
Molly needs to access a setting in microsoft windows group policy to change the type of a network to which a computer is attache
creativ13 [48]

A computer is made up of different network. The setting that molly must change is network type.

A computer network is known to be a group of computers that are linked to each other so as to help the computer to communicate with another computer and share their resources, data, and applications.

A computer network can be classified based on their sizes. A computer network is of four types. They are:

  • LAN(Local Area Network)

  • PAN(Personal Area Network)

  • MAN(Metropolitan Area Network)

  • WAN(Wide Area Network)

Learn more from

brainly.com/question/14200752

5 0
2 years ago
Bob received a message from Alice which she signed using a digital signature. Which key does Bob use to verify the signature?Gro
alexira [117]

Answer:

Alice's public key

Explanation:A Public key is a key that can be used for verifying digital signatures generated using a corresponding private key which must have been sent to the user by the owner of the digital signature.

Public keys are made available to everyone required and they made up of long random numbers.

A digital signature signed with a person's private key can only be verified using the person's private key.

7 0
3 years ago
Using the spreadsheet below, which formula can be used to determine Albert's hourly wage?
algol13

Answer:

It will be average (B2:C2)

as it will select all the data between B2 and C2

7 0
2 years ago
Read 2 more answers
Other questions:
  • Driving while wearing headphones or earphones
    12·2 answers
  • Define a function below called average_strings. The function takes one argument: a list of strings. Complete the function so tha
    11·1 answer
  • The most common types of utility programs fall into these categories. accessibility calculation communication data entry enterta
    6·2 answers
  • A ___ is an organized collection of data in digital format that helps users to keep
    5·1 answer
  • Leonardo is having difficulty accessing the course website. he should contact the for assistance. (points:1)
    13·1 answer
  • ☢☢☢does anyone know how to do the TYNKER CANNON assignment ( lesson 2 intro to game design) I'll give BRANLIEST(¬‿¬)❤ dont answe
    11·2 answers
  • PLZZZZZZZZZZ HELP ME OUT THIS DUE TODAY AND NEED SOMEONE HELP!!!!!plzzzzzzzzzzz i begging you!!!
    11·1 answer
  • We will create a shopping cart, it is a dictionary mapping items in the car to the amount of that item. For example if there is
    9·1 answer
  • A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input, output the subtotal for the
    12·1 answer
  • In a relational database, information is organized into tables in which each row represents a(n ) ________. Group of answer choi
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!