Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help with the problems 5 and 6, the program have to be in python. thank you. 4. (1 ponts) Create a program that

i need help with the problems 5 and 6, the program have to be in python. thank you. image text in transcribed
4. (1 ponts) Create a program that receives as input two lists of numbers: list y and list x. The lists have the same number of iscms let n represent the namber of numbers in the lists. The program must compute the following quantity For example, if y [53,2,3] and x 2,3,6], then d (53 -2)2+(2-3)2+(3- 6I/3. Write two versions of the program: in one use a for loop, and in the other use a while loop. 5. (2 point) Imagine you work for a disaster relief agency . The agency has a fixed number of power generators. Call this quantity supply .A disaster occurs, and the agency receives a series of power generator requests from different regions These requests are stored in a list called orders. . The names of the regions that make the roquests are stored in the list regions Each number in the list orders represents the number of power gencrators requested by a particulan regon Naturally, the lists orders and regions have the same length Create a program that receives as imput the lists orders and regions, as well as the quantity supply . The program must determine, sequentially, a) which regions will receive their requested power generators based on the number of available generators, and b) the number of generators assigned to each region. All roquests are satistied, sequentially, up to the mumber of available generators . Store the names of the selected regions in list selected, and the number of assigned generaoes in list quantity .Forexample, fsupply-100 orders [10,85, 10,4 regions- Yauco,"Moca. "Utuado. "Lares then selected Yauco. "Moca, Utuado and quantity [10,855]. 6. (1.5 point) Create a program that has as input a list of numbers, and produces as output the minimum and the maximam number in the list. (Example: Input, 100, 2,4]: Output -[1.100. Do not use 7, (0.5 points) Create a Python peogram that takes as input a list of numbers, and outputs the position of Output Position- 1, Output Number-1). If there are no negative numbers in the list the program min or max functions. the first negative number in the list, and the negative number itself. (Example Input -. 2 should print "No negative numbers in the list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions