1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
True [87]
3 years ago
14

The 0-1 knapsack problem is the following. A thief robbing a store finds n items. The ith item is worth vi dollars and weighs wi

pounds, where vi and wi are integers. The thief wants to take as valuable a load as possible, but he can carry at most W pounds in his knapsack, for some integer W . Which items should he take?
Computers and Technology
1 answer:
icang [17]3 years ago
3 0

Step by step Explanation:

Based on what we could deduce from the above statement, the items he should take are:

  • must either take one single item or must leave the other behind,
  • and only a whole amount of an item must be taken,
  • in which an item cannot be taken more than once into his knapsack.

Hence, the thief needs to carefully determine items with an optimal value which still falls within his specified weight (W).

You might be interested in
assuming the default gateway is connected to the internet, what type of internet access would this server have?
erik [133]

If the default gateway is connected to the internet, the type of internet access that the server would have is:

  • Full Access

<h3>What is a Default Gateway?</h3>

A default gateway is a functionality in a computer system that allows access or communication with other networks.

It is the primary channel of interaction with other networks. Once this default gateway is connected to the internet, it will be given full access.

Learn more about the default gateway here:

brainly.com/question/2692918

#SPJ11

3 0
2 years ago
Data is communicated through various input devices true or false​
kipiarov [429]
I would believe this is true if the following are also true.

Input devices are things like keyboards, mouses, buttons, e.c.t.

If that is true then I would believe it to be true due to multiple inputs are being used to communicate.
3 0
3 years ago
What part of the System Model is a Flow Chart primarily developed for?
Morgarella [4.7K]

A, I believe... I could be wrong

3 0
3 years ago
(Package Inheritance Hierarchy) Package-delivery services, such as FedEx®, DHL® and UPS®, offer a number of different shipping o
lys-0071 [83]

Answer:

Check the explanation

Explanation:

note: code is implemented as per the main method provided:

code:

using System;

public class Package

{

string senderName11;

string senderAddress1;

string senderCity1;

string senderState1;

string senderZip1;

string recipientName1;

string recipientAddress1;

string recipientCity1;

string recipientState1;

string recipientZip1;

decimal weight1;

decimal costPerOunce1;

public string SenderName11

{

get { return senderName11; }

set { senderName11 = value; }

}

public string SenderAddress1

{

get { return senderAddress1; }

set { senderAddress1 = value; }

}

public string SenderCity1

{

get { return senderCity1; }

set { senderCity1 = value; }

}

public string SenderState1

{

get { return senderState1; }

set { senderState1 = value; }

}

public string SenderZip1

{

get { return senderZip1;}

set { senderZip1 = value; }

}

public string RecipientName1

{

get { return recipientName1; }

set { recipientName1 = value; }

}

public string RecipientAddress1

{

get { return recipientAddress1; }

set { recipientAddress1 = value; }

}

public string RecipientCity1

{

get { return recipientCity1; }

set { recipientCity1 = value; }

}

public string RecipientState1

{

get { return recipientState1; }

set { recipientState1 = value; }

}

public string RecipientZip1

{

get { return recipientZip1; }

  set { recipientZip1 = value; }

}

public decimal Weight1

{

get { return weight1; }

set

{

if (value > 0)

weight1 = value;

else

Console.WriteLine("Weight1 can't be less tha zero");

}

}

public decimal CostPerOunce1

{

get { return costPerOunce1; }

set

{

if (value > 0)

costPerOunce1 = value;

else

Console.WriteLine("Cost per ounce can't be less than zero");

)

{

SenderName11 = senderName11;

SenderAddress1 = senderAddress1;

)

{

TwoDayDeliveryFee = twoDayDeliveryFee;

}

public override decimal CalculateCost()

{

return base.CalculateCost() + TwoDayDeliveryFee;

}

OvernightDeliveryFeePerOunce = overnightDeliveryFeePerOunce;

}

public override decimal CalculateCost()

{

return (CostPerOunce1 + OvernightDeliveryFeePerOunce) * Weight1;

}

}

class TestPackages

{

static void Main(string[] args)

{

Package regularPackage = new Package

(

"Peter Anderson",

"123 Main St, Ashville, NC 27111 ",

"Ashville",

"NC 27111",

"MN 55416",

"Mary Brown",

"456 Broad St Benson, NC 27222",

"St. Petersburg",

"Benson",

"NC 27222",

160M,

0.1M

);

Console.WriteLine("\nRegular Package: ");

  Console.WriteLine(" Sender's Name: {0}",

      regularPackage.SenderName11);

  Console.WriteLine(" Sender's Address: {0}",

      regularPackage.SenderAddress1);

  Console.WriteLine(" Recipient's Name: {0}",

       regularPackage.RecipientName1);

  Console.WriteLine(" Recipient's Address: {0}",

       regularPackage.RecipientAddress1);

  Console.WriteLine(" Weight1: {0}"

, regularPackage.Weight1);

  Console.WriteLine(" Cost Per Ounce: {0:C}",

       regularPackage.CostPerOunce1);

  Console.WriteLine("Shipping Cost: {0:C}",

       regularPackage.CalculateCost());

Console.WriteLine(regularPackage.CalculateCost());

 

TwoDayPackage twoDayPackage = new TwoDayPackage

(

"Peter Anderson",

"123 Main St 123 Main St, Ashville, NC 27111",

"Ashville",

"NC 27111",

"MN 55416",

"Mary Brown",

"456 Broad St",

"St. Petersburg",

"Benson",

"NC 27222",

160M,

0.1M,

1.5M

);

  Console.WriteLine("\nTwo-Day Package: ");

  Console.WriteLine(" Sender's Name: {0}",

  twoDayPackage.SenderName11);

Console.WriteLine(" Sender's Address: {0}",

twoDayPackage.SenderAddress1);

  Console.WriteLine(" Recipient's Name: {0}",

   twoDayPackage.RecipientName1);

  Console.WriteLine(" Recipient's Address: {0}",

   twoDayPackage.RecipientAddress1);

  Console.WriteLine(" Weight1: {0}", twoDayPackage.Weight1);

  Console.WriteLine(" Cost Per Ounce: {0:C}",

   twoDayPackage.CostPerOunce1);

  Console.WriteLine(" Flat Fee: {0:C}",

   twoDayPackage.Weight1);

  Console.WriteLine(" Shipping Cost: {0:C}",

   twoDayPackage.CalculateCost());

OvernightPackage overnightPackage = new OvernightPackage

(

"Peter Anderson",

"123 Main St 123 Main St, Ashville, NC 27111",

"Ashville",

"NC 27111",

"MN 55416",

"Mary Brown",

"456 Broad St Benson, NC 27222",

"St. Petersburg",

"Benson",

"NC 27222",

160M,

0.1M,

1.5M

);

Console.WriteLine("\nOvernight Package: ");

  Console.WriteLine(" Sender's Name: {0}",

   overnightPackage.SenderName11);

  Console.WriteLine(" Sender's Address: {0}",

   overnightPackage.SenderAddress1);

  Console.WriteLine(" Recipient's Name: {0}",

   overnightPackage.RecipientName1);

  Console.WriteLine(" Recipient's Address: {0}",

   overnightPackage.RecipientAddress1);

  Console.WriteLine(" Weight1: {0}",

   overnightPackage.Weight1);

  Console.WriteLine(" Cost Per Ounce: {0:C}",

   overnightPackage.CostPerOunce1);

  Console.WriteLine(" Additional Cost Per Ounce: {0:C}",

   overnightPackage.OvernightDeliveryFeePerOunce);

  Console.WriteLine(" Shipping Cost: {0:C}",

   overnightPackage.CalculateCost());

Console.WriteLine(overnightPackage.CalculateCost()); Console.ReadKey();

}

}

The Result can be seen below:

8 0
3 years ago
Question very important cause after my school is over at 5 'oclock I will be playing rocket league if anyone wants to play just
jarptica [38.1K]

Answer:

So can u tell me wut is ur question...It is not understandable

6 0
3 years ago
Other questions:
  • How to tell if screen or screen protector is cracked?
    5·2 answers
  • What is a main cause of a virus on a computer
    6·1 answer
  • Most OEMs recommend that the engine oil be replaced and a new filter installed at which of the following mileage intervals ?
    7·1 answer
  • Select the correct answer. Ryan received an email from a person claiming that he is an employee of the bank in which Ryan has a
    11·2 answers
  • A programmer is writing a system that is intended to be able to store large amounts of personal data. As the programmer develops
    11·1 answer
  • Which of these consoles have 64 bit architecture
    13·1 answer
  • In one to two sentences, explain why citizens pay taxes
    8·1 answer
  • Morena has been assigned to develop a program that will analyze data for a real estate firm. She needs to study the patterns in
    11·1 answer
  • In the Business world people are often measured by their???
    14·1 answer
  • Why is internet download speed slower on a computer vs phone
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!