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
Ivahew [28]
2 years ago
7

8.6 Code Practice: Question 2

Computers and Technology
1 answer:
Rina8888 [55]2 years ago
4 0

Answer:

import random

def buildArray(a, n):

   for i in range (n):

      a.append(random.randint(10,99))

     

arr = []

def sumArray(a):

   tot = 0

   for i in range(len(a)):

       tot = tot + a [i]

   return tot

       

   

arr = []

numbers = int(input("How many values to add to the array:\n"))

buildArray(arr, numbers)

print(arr)

print("Total " + str(sumArray(arr)) )

Explanation:

You might be interested in
Michael a programmer, is writing an algorithm to solve programming problems, Guide him to write an algorithm
Nadusha1986 [10]

Answer:

Algorithms need to be simple, factual, and explained in simple but relevant vocabulary, and must be step by step, and none of the step should be missing.

Hence, first you need to understand the requirement, which can be yours or your clients.

Then consider each module of the problem, and separate each of them from the others. Now, understand the relationship between each module. And then you need to understand how you can combine them in one algorithm.

Also remember, the modules are functions. and various functions combine together to form an algorithm. We can have separate algorithms for each module as well, and then you can combine them together in right continuity to form the one single program.

Also, a project can have a loads of programs with other parts like images and various other assets and technologies.

However, everything starts with algorithms. And if are good at explaining, and a sound vocabulary, plus can explain the process well, you can explain the process well, and write a good algorithm definitely. Learn languages like Python, C, and C++  to start with, and then continue with Java, R etc. Remember we still uses functional programming as well like through Haskell etc.

The below is an example of sample algorithm. John wants to check what Ana has brought for him.

Step 1: Ana arrives with meat, which can be of goat or chicken

Step 2: John: Hi Ana

Step3: Yes John

Step 4 What meat is that Ana

Step 5: Goat

Step 7: Thanks Ana for Bringng Goat Meat

Step 8: Stop

In the above algorithm John confirms that what meat Ana has brought for him. And he comes to know She has bought Goat meat. This is the simplest of algorithm with no loop. And the complexity can be increased to any level.

Explanation:

The Answer is self explanatory, and has all that is required.

7 0
3 years ago
Read 2 more answers
What type of font color should Kim select if she chooses a dark-colored design theme for her presentation?
enot [183]

white or light colors

5 0
3 years ago
Read 2 more answers
How can you insert an image file in your word document?​
Margarita [4]

Click the insert tab, it'll show a pop up window. Go to the location of where your picture may be. Double click on the photo, and it will be inserted into the word document.

6 0
3 years ago
Your organization has hired a penetration tester to validate the security of your environment. The penetration tester needs to d
yulyashka [42]

Answer:

Port scanner

Explanation:

The penetration tester would most likely use a port scanner. A port scanner can be explained to be an application that is made to check a server or host for ports that are open. This application can also be used by administrators to check their security networks so as to know those network services that are running on a host and also to know existing vulnerabilities. Attackers also use this to exploit victims.

5 0
3 years ago
Why can't we sign up to brainly.com??????????????????
LiRa [457]

Answer:

Explanation:

so why are you doing sign up

8 0
3 years ago
Other questions:
  • Typically, when an organization purchases Internet access from an Internet Service Provider (ISP), the ISP will grant it
    10·1 answer
  • In addition to the four primary computer operations, today's computers almost always perform ____ functions.
    7·1 answer
  • Why do we need vram​
    6·1 answer
  • What pointer appears when pointing to a hyperlink?
    9·1 answer
  • Kelly is a college sophomore majoring in computer science. She is interested in gaining exposure to the most useful and current
    14·1 answer
  • Of all excavation hazards, _______ poses the greatest risk
    8·1 answer
  • Which statement describes Augmented Reality (AR) technology?
    12·1 answer
  • Some scientists say that robots my become self - aware in the near future Do you think this is possible?​
    10·1 answer
  • 14 Copy a picture of a crane on the next page. Do not trace them. Make a freehand sketch. (2) 2 Look at the placed where the Mar
    11·1 answer
  • Pls need this asap
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!