Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python program that accepts a collection of items with its corresponding weights and values/profits. The objective is to choose and pick up the

image text in transcribed
image text in transcribed
Write a Python program that accepts a collection of items with its corresponding weights and values/profits. The objective is to choose and pick up the items in a bag such that the profit value is maximized, provided that the total weight of the items chosen does not exceed the weight capacity of the bag. The answer should specify which items were picked up which gave the maximum profit. Input : 6 // weight capacity of the bag 5 // number of items 42 f/item with weight, value details 24 37 19 26 Output: 00111 //choice of items Answer: (penalty regime: 0 %) Write a Python program which accepts a collection of points with their Cartesian coordinates. The objective is to choose the points which are part of a straight line. Declare the straight line only if more than 2 points are found to be collinear. The formula which shows the relation between the x and y coordinates of two points (A(x1,71) and B (x2,y2)) and the angle between them is tan = = (y2-y1)/(x2-x1) or, consequently, e = tan-1 ((y2-y1)/(x2-x1) ) Can be utilized by => math.degrees(math.atan(...)) after importing the math package 9 Input: //No. of points -37, -14, 11, 35, 59, 41, 53, 77, 34 Output: 012 234 l/Point 0, Point 1, Point 2 l/Point 2, Point 3, Point 4 //Point 5, Point 6, Point 7 567 Answer: (penalty regime: 0%) sty PC TU

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

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago