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
IrinaK [193]
3 years ago
11

Given coins of denominations (value) 1 = v1 < v2< … < vn, we wish to make change for an amount A using as few coins as

possible. Assume that vi’s and A are integers. Since v1= 1 there will always be a solution. Solve the coin change using integer programming. For each the following denomination sets and amounts formulate the problem as an integer program with an objective function and constraints, determine the optimal solution.
What is the minimum number of coins used in each case and how many of each coin is used? Include a copy of your code.

a) V = [1, 5, 10, 25] and A = 202.
b) V = [1, 3, 7, 12, 27] and A = 293
Computers and Technology
1 answer:
astraxan [27]3 years ago
3 0

Answer:

Answer given below

Explanation:

a) 10 coins ( 25*8 + 1*2)

b) 14 coins (27*10 + 12*1 + 7*1 + 3*1 + 1*1)

<u></u>

<u>Source Code in C++: </u>

#include <iostream>

using namespace std;

//main function

int main()

{

int n,n1;

cout << "Enter the amount : "; //taking amount as input

cin >> n;

if(n<=0)

{

cout << "Fatal Error : Input Failure." << endl;

return 1;

}

cout << "Enter the number of denominations : "; //taking number of denominations as input

cin >> n1;

if(n1<=0)

{

cout << "Fatal Error : Input Failure." << endl;

return 1;

}

int a[n1],c[n1],sum=0; //array to keep count of each amount, and sum to store total coins

cout << "Enter the denominations in descending order : ";

for(int i=0;i<n1;i++)

{

cin >> a[i];

}

for(int i=0;i<n1;i++)

{

c[i]=n/a[i];

sum=sum+c[i];

n=n%a[i];

}

for(int i=0;i<5;i++)

{

cout << a[i] << " : " << c[i] << endl;

}

return 0;

}

You might be interested in
Software and technology that allow people to work together on a task are known as
exis [7]

Collaborative software or groupware.

5 0
2 years ago
Read 2 more answers
Which term describes the order of arrangement of files and folders on a computer?
Novay_Z [31]
Computer, video pictures, and Album.
5 0
2 years ago
1) Using the density equation d=m/V: What is the density of a piece of metal with a mass o
kolezko [41]

Answer:

density= 7.8214 g/cm^3

Explanation:

Mass = m = 87.6 g

Volume = V = 11.2 cm^3

density = m/v

            = 87.6 g/ 11.2cm^3

            = 7.8214 g/cm^3

4 0
3 years ago
To open a Google Doc in another software application, the user must first download it. True or false?
alexira [117]

Answer:

True

Explanation:

5 0
2 years ago
Read 2 more answers
List out any four hardware and software components required for multimedia​
natta225 [31]

Answer:

The list of hardware components required in multimedia are as follows:

  • Microprocessor.
  • High storage hard disk.
  • RAM.
  • High resolution graphics cards.

The list of software components required in multimedia are as follows:

  • Text
  • Audio
  • Graphics
  • Video
3 0
2 years ago
Other questions:
  • In what stage of writing does publishing occur
    14·1 answer
  • What is the operating system?
    9·1 answer
  • Lesson 15: Integrated Literacy Connections Education Introduction to Computer Applications Unit 6: Internet Safety
    5·1 answer
  • What's the difference between intranet and extranet ​
    9·1 answer
  • Does anyone know the answer for this? I’m extremely confused.
    8·2 answers
  • You are asked to check your company’s configurations to determine if any filters should be built to stop certain ICMPv6 traffic.
    9·1 answer
  • Tara and Zach are leading a systems development project and they want the investigation phase to go smoothly and quickly. They d
    10·1 answer
  • What would be used by a business to assess how the business is working within its organization goals? O A. Information systems B
    8·1 answer
  • What is the full form of 'Rom<br>​
    7·2 answers
  • Consider the following code segment.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!