Question
Useing Jython Environment for Students (JES), Version 5.0 Please but pic for the Inputs and the outputs. This project we will create our first Jython
Useing Jython Environment for Students (JES), Version 5.0
Please but pic for the Inputs and the outputs.
This project we will create our first Jython functions that will allow us to calculate the average and we will move our min and max code to functions as well.
We will take our code we will do the following things. Create a function that returns the minimum of our set of numbers. Create a function that return the maximum of our set of numbers. Create a function that returns the average of our set of numbers.
As a preview over the next few parts of this project will add the following analysis functions. Median Standard Deviation Variance Mode Graph the distribution.
Inputs to the program: 70 75 76 49 73 76 52 63 11 25 19 89 17 48 5 48 29 41 23 84 28 39 67 48 97 34 0 24 47 98 0 64 24 51 45 11 37 77 5 54 53 33 91 0 27 0 80 5 11 66 45 57 48 25 72 8 38 29 93 29 58 5 72 36 94 18 92 17 43 82 44 93 10 38 31 52 44 10 50 22 39 71 46 40 33 51 51 57 27 24 40 61 88 87 40 85 91 99 6 3 56 10 85 38 61 91 31 69 39 74 9 17 80 96 49 0 47 68 12 5 6 60 81 51 62 87 70 66 50 30 30 22 45 35 2 39 23 63 35 69 83 84 69 6 54 74 3 29 31 54 45 79 21 74 30 77 77 80 26 63 84 21 58 54 69 2 50 79 90 26 45 29 97 28 57 22 59 2 72 1 92 35 38 2 47 23 52 77 87 34 84 15 84 13 23 93 19 50 99 74 59 4 73 93 29 61 8 45 10 20 15 95 58 43 75 19 61 39 68 47 69 58 88 82 33 30 72 21 74 12 18 0 52 50 62 21 66 26 56 84 16 12 7 45 58 22 26 95 82 6 74 12 16 2 61 58 22 39 0 53 88 79 71 13 54 25 31 93 48 91 90 45 23 54 42 39 78 25 95 58 2 41 61 72 98 91 48 97 93 11 12 1 35 80 81 86 38 70 67 55 55 87 73 79 31 43 97 79 3 51 17 58 70 34 59 61 28 46 13 42 18 0 18 75 75 62 50 62 85 49 83 71 63 32 27 59 42 46 8 13 39 25 13 94 17 48 73 40 31 31 86 23 81 40 92 24 94 67 30 18 74 78 62 89 1 27 95 99 33 53 74 5 84 88 8 52 0 24 21 99 1 74 84 94 29 25 83 93 98 40 21 66 93 28 72 63 77 9 71 18 87 50 77 48 68 88 22 33 16 79 68 69 94 64 5 28 33 22 21 74 44 62 68 47 93 69 9 42 44 87 64 97 42 34 90 70 91 12 18 84 65 23 99 1 55 6 1 23 92 50 96 96 68 27 17 98 42 10 27 26 20 13 94 73 75 12 12 25 33 1 33 67 61 0 98 71 35 75 6 56 45 11 1 69 57 9 15 96 69 2 0 65 44 86 78 97 17 4 81 23 4 43 24 72 70 57 21 91 84 94 40 96 40 78 46 67 6 7 16 49 24 14 12 82 73 60 42 76 62 10 84 49 75 89 43 47 31 68 15 11 32 37 98 72 40 25 69 30 64 60 48 21 11 74 54 24 6010 96 29 39 53 48 24 68 4 52 12 6 91 15 86 77 65 68 22 91 36 72 82 81 9 77 0 5 83 27 88 17 35 66 76 78 81 19 51 87 66 26 59 65 2 37 37 73 34 98 37 78 92 17 52 62 40 50 84 34 22 25 42 90 19 86 76 68 42 9 89 57 78 64 89 12 34 94 9 77 58 32 27 97 93 79 35 32 75 97 79 65 90 53 43 98 4 99 5 79 38 99 60 78 64 90 2 39 42 52 2 21 77 15 8 87 13 0 4 7 43 76 31 74 16 87 50 73 49 14 35 10 37 91 44 88 71 95 75 98 7 17 23 13 16 77 20 50 50 74 78 58 30 21 74 76 93 5 74 94 83 23 67 18 5 50 47 56 79 26 84 78 48 71 43 41 8 91 23 7 11 96 87 12 42 32 44 99 67 99 64 96 52 19 79 60 66 52 62 17 61 54 24 25 36 4 78 3 94 91 62 65 76 94 2 52 25 61 55 49 88 85 96 5 46 56 48 17 25 3 70 62 3 50 45 47 58 12 41 27 42 90 91 71 53 4 79 47 68 43 87 35 63 10 49 4 81 45 88 80 6 92 47 70 40 7 33 70 61 30 9 55 42 83 26 72 57 77 91 13 15 33 13 62 49 43 65 73 98 59 56 77 62 12 25 33 53 78 73 1 17 44 56 95 10 33 89 33 20 56 69 66 60 53 83 58 43 33 25 21 8 28 65 51 70 53 78 49 30 64 17 76 9 2 32 87 77 39 25 21 66 65 54 81 49 15 27 7 14 4 11 94 9 84 23 13 95 45 67 57 20 3 58 50 97 35 68 47 41 84 59 46 34 19 25 77 29 41 89 80 61 70 40 1 18 32 70 86 76 25 98 99 40 43 92 43 4 70 78 72 71 85 14 84 73 92 60 23 57 44 56 6 96 39 91 63 43 39 71 80 18 93 54 1 4 46 68 93 74 74 88 52 88 55 24 19 92 53 59 1 91 48 47
Outputs of the program: Average Minimum Maximum The list of numbers
To help you get started this is how you open and read the numbers from a file and append it to a list called dataset.
To define a function we will use
def function_name(parameters)
and to return a value from a function we will use return value
For example our minimum function could be outlined as follows.
def min(dataset):
min = dataset[0]
for num in dataset:
if num < min:
min = num
return min
and to use it, in our program we could do the following
minimum = min(dataset)
Find the minimum, maximum values in your list as well as the average. Create a function for each calculation.
Print out your entire list. Print out the minimum and maximum values.
Write the code in Jython and test your program. Remember to include comments in the code!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started