Python 3
Create a function that takes an array and an integer v, and returns the number of v occurrences in the array. Add a variable Nsteps to count how many times the loops have executed and display that information in a message
The main program must take an array / list 2D, call the function, and display the result.
>>>l3 = [52, 14, 14, 8, 85, 69, 1, 77, 94, 96, 51, 65, 35, 32, 87, 92, 74, 47, 27, 88, 11, 11, 26, 14, 100, 37, 62, 3, 63, 5, 20, 53, 28, 10, 43, 16, 94, 6, 82, 49, 74, 55, 89, 97, 12, 38, 72, 94, 3, 77, 42, 26, 25, 16, 89, 10, 8, 63, 93, 77, 68, 56, 74, 46, 54, 50, 80, 33, 69, 95, 2, 79, 73, 6, 31, 41, 38, 81, 88, 12, 39, 77, 49, 30, 18, 22, 40, 40, 12, 51, 69, 32, 76, 77, 90, 60, 41, 12, 30, 65]
>>> count(l3,6)
Number of steps 100
def count(lst, v):
c = 0
Nsteps = 0
for item in lst:
Nsteps += 1
if item == v:
c += 1
print("Number of steps", Nsteps)
return c
l3 = [52, 14, 14, 8, 85, 69, 1, 77, 94, 96, 51, 65, 35, 32, 87, 92, 74, 47, 27, 88, 11, 11, 26, 14, 100, 37, 62, 3, 63,
5, 20, 53, 28, 10, 43, 16, 94, 6, 82, 49, 74, 55, 89, 97, 12, 38, 72, 94, 3, 77, 42, 26, 25, 16, 89, 10, 8, 63,
93, 77, 68, 56, 74, 46, 54, 50, 80, 33, 69, 95, 2, 79, 73, 6, 31, 41, 38, 81, 88, 12, 39, 77, 49, 30, 18, 22, 40,
40, 12, 51, 69, 32, 76, 77, 90, 60, 41, 12, 30, 65]
print(count(l3, 6))

Python 3 Create a function that takes an array and an integer v, and returns the...
Write a C program to assign natural numbers 1 to 100 into a one-dimensional integer array. Display all the values in the array on the screen. For each number in the array, determine if the number contains digit 7 or is divisible by 7. Display all those numbers on the screen. Original array: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27...
Please show how you did this in excel.
:13-19 Every home football game for the past eight years at Eastern State University has been sold out. The revenues from ticket sales are significant, but the sale of food, beverages, and souvenirs has contrib- uted greatly to the overall profitability of the football program. One particular souvenir is the football pro- gram for each game. The number of programs sold at each game is described by the following probabil- ity distribution:...
Write a python nested for loop that prints out the following pattern 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33...
Problem #1: Consider the below matrix A, which you can copy and paste directly into Matlab. The matrix contains 3 columns. The first column consists of Test #1 marks, the second column is Test # 2 marks, and the third column is final exam marks for a large linear algebra course. Each row represents a particular student.A = [36 45 75 81 59 73 77 73 73 65 72 78 65 55 83 73 57 78 84 31 60 83...
The ExceptionLab class provided: – Creates an array of 100
elements and fills it with random numbers from 1 to 100. – It asks
the user for an index value between 0 and 99. – Prints the element
at that position. – If a number > 99 is entered by the user, the
class will abort with an ArrayIndexOutOfBoundsException • Modify
the ExceptionLab: – Add a try-catch clause which intercepts the
ArrayIndexOutOfBounds and prints the message: Index value cannot be...
1. Forecast demand for Year 4.
a. Explain what technique you utilized to forecast your
demand.
b. Explain why you chose this technique over others.
Year 3 Year 1 Year 2 Actual Actual Actual Forecast Forecast Forecast Demand Demand Demand Week 1 52 57 63 55 66 77 Week 2 49 58 68 69 75 65 Week 3 47 50 58 65 80 74 Week 4 60 53 58 55 78 67 57 Week 5 49 57 64 76 77...
Suppose a binary tree data (in tiny written size) is stored in an array (A) as given below and root is placed at “0”index. Note the array indices are in larger written size (0 to 74). Show the traversal data of the given tree for a) In-Order Traversal b) Post Order Traversal A 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 28 13 36 15 9 22 44 7 10 75 33 19 15...
RANGES
FREQUENCY
RELATIVE FREQUENCY
CUMULATIVE REL. FREQ.
1 - 10
11 - 20
21 - 30
31 - 40
41 - 50
51 - 60
61 - 70
71 - 80
81 - 90
91 - 100
'= 100 DATA
VALUES??
SO, WHAT DOES A FREQUENCY TABLE TELL US?
If
you wrote each of the above data values on a ping pong ball,, put
them in a jar and blindly pulled one out:
What is the probability that this ball...
Compter le nombre d’occurrences d'un élément dans une matrice •Create a function that takes an array and an integer v, and returns the number of v occurrences in the array. Add a variable Nsteps to count how many times the loops have executed and display that information in a message. •The main program must take an array / list 2D, call the function, and display the result
I need it in JAVA Write a program that randomly populates an array of size 100, sorts it, and then finds the median. The random numbers must be from 0-99 and all integer values. Also since there is an even set of numbers the median is found by taking the mean of the two middle numbers (In other words the 50th and 51st). You have to code your own sorting method. You may not use a built in java sorter....