SIZE = 1 All the numbers... [0] All the numbers... [10] Min: 10 Max: 10 Total: 10 Average: 10 SIZE = 2 All the numbers... [0 0] All the numbers... [10 20] Min: 10 Max: 20 Total: 30 Average: 15 SIZE = 100 All the numbers... All the numbers... [ 10 20 30 40 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690 700 710 720 730 740 750 760 770 780 790 800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990 1000] Min: Max: Total: 50500 Average: 505 10 1000

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 19VE
icon
Related questions
icon
Concept explainers
Question
100%

Hello there:

I must complete the following lesson as exactly as the instructions are given in the Python code. After I have completed the lesson, I must test it by changing SIZE to any number between 1 and 'whatever' and your whole program will still work. You should test at least with the cases 1, 2, 3, 4, 10, 20, 100, 1000. It must work in at least all those cases. When you are ready to turn in, return SIZE to 10.

Please can you help me with this lesson? Thanks in advance!

The instructions are in the code:

import numpy as np

# SIZE is a global constant, use this throughout your program.

# you should be able to change this to any int and your

# whole program will still work correctly. TEST THIS!

SIZE = 10

# creates a numpy array of size SIZE filled with 0s.

numbers = np.array([0] * SIZE, dtype=int)

# show the array

print("All the numbers...")

print(numbers)

print()

# now fill it with 10,20,30, etc ***using a loop***

#########################

# code here

#########################

 

# show the array again

print("All the numbers...")

print(numbers)

print()

# now make an integer array of size 4 to hold stats, call it stats

# calculate four basic stats and put them in the size 4 array in this order:

# min, max, total, average

# min and max will just be the first and last numbers from the numbers array

# average may calculate as a float, make it an int to store it in the stats array

# you should use a simple print(stats) to see your array as you code, then erase

# that print statement and uncomment the print statements below to see your stats

#########################

# code here

#########################

 

# When you have your stats array working, uncomment this code to display the stats.

#

#print("Min: ", stats[0])

#print("Max: ", stats[1])

#print("Total: ", stats[2])

#print("Average: ", stats[3])

print()

The output must be as the following examples:

 

SIZE = 1
All the numbers...
[0]
All the numbers...
[10]
Min: 10
Max: 10
Total: 10
Average: 10
SIZE = 2
All the numbers...
[0 0]
All the numbers...
[10 20]
Min: 10
Max: 20
Total: 30
Average: 15
Transcribed Image Text:SIZE = 1 All the numbers... [0] All the numbers... [10] Min: 10 Max: 10 Total: 10 Average: 10 SIZE = 2 All the numbers... [0 0] All the numbers... [10 20] Min: 10 Max: 20 Total: 30 Average: 15
SIZE = 100
All the numbers...
All the numbers...
[ 10 20 30 40
60
70
80
90 100 110 120 130 140
150 160
170
180
190 200 210 220
230 240 250 260 270 280
290
300
310
320
330
340
350
360
370
380
390
400
410 420
430
440
450
460
470
480 490
500
510
520 530
540
550 560
570
580
590
600
610
620 630
640
650 660 670
680
690 700
710 720
730
740
750
760 770
780
790 800
810
820 830 840
850 860
870 880
890
900 910 920 930 940
950
960 970 980
990 1000]
Min:
Max:
Total: 50500
Average: 505
10
1000
Transcribed Image Text:SIZE = 100 All the numbers... All the numbers... [ 10 20 30 40 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690 700 710 720 730 740 750 760 770 780 790 800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990 1000] Min: Max: Total: 50500 Average: 505 10 1000
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage