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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education