Create an 80x86 program that define an array of doubleword numbers then read two values, first one indicates how many actual numbers will be in the array, and an integer n. The program should display all of the numbers in the array that are greater than the number n.

Respuesta :

fichoh

The program requires user to read a specified number of values beyond a set limit from a given array. The program which performs this task is written in python 3 thus :

from random import randint

#import the randomint module

import random

#import the random module

double_list = [randint(11, 99) for p in range(0, 10)]

#randomly selects a list of 10 double integer values

def rand_num(lis, n_values , n):

#initialize a function named rand_num which takes in 3 parameters

filter = [val for val in lis if val > n]

#filters the variables to contain those only greater than the specified limit

arr_ = random.sample(filter, n_values)

#using the sample function, select the stated number of values from the filtered list

return arr_

#return the selected values

n_values = int(input('Enter number of values : '))

#prompts user for the length of array

n = int(input('Enter limit : '))

#prompts user for the limit of the values to be included in the array

print(rand_num(double_list, n_values, n))

#A sample run of the program is given and output attached.

Learn more :https://brainly.com/question/25434178

Ver imagen fichoh