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
A strategy to solve a logic problem is to break it into steps. Using the drop-down menu, complete these sentences about solving
PSYCHO15rus [73]
I think the answer is 3!!
3 0
2 years ago
Read 2 more answers
Jason is working on a project that requires him to manage a huge amount of data. The spreadsheet he is working on has data relat
Alinara [238K]

A. use split worksheet view to break the worksheet into different visible sections

<u>Explanation:</u>

Jason is working on a project that requires him to manage a huge amount of data. There are numerous instances when a user has to manage a huge amount of data within a single spreadsheet. It will cause trouble for the user to simultaneously access the data from more than one table in the same sheet.

To deal with this problem, Jason can track and compare this data as he works on the spreadsheet by using the split worksheet view to break the worksheet into different visible sections. The different sections provide a better view of the tables and data extraction and manipulation become easy.

6 0
3 years ago
What is a motherboard​
aleksandr82 [10.1K]

Answer:

A motherboard is the main printed circuit board in general-purpose computers and other expandable systems. It holds and allows communication between many of the crucial electronic components of a system

Explanation:

8 0
2 years ago
What were the technological innovations that allowed for the rapid expansion of the railroads?
liraira [26]

Answer:

There are different phases of railroad expansion with the innovations in technology.

Explanation:

Few of the technological innovations are described below that leads in railroad expansion more rapid.

1. Centralized Traffic control (CTC) is introduced in 1960's that is used to control the traffic on railroads using different signal control.

2. In 1990's after computer technology involvement, railway ticket and reservation system is automate and being centralized. That makes the railroad expansion improve.

3. Bullet train technology has been introduced, that makes the railway trains more faster.

4. Electric trains has been introduced to use green energy and reduce the dependency on the fuel to make environment clean and green.

5 0
2 years ago
( answer goes here) are pictures that you can click on to tell your computer what to do.
rosijanka [135]
Um what are you asking here?
8 0
3 years ago
Read 2 more answers
Other questions:
  • George borrowed some equipment from his friend for recording his monologue for his art class. He got all the equipment except th
    15·1 answer
  • teve wants to use Google Display Ads to reach new customers who are looking to purchase products similar to his. Which audience
    14·1 answer
  • _____ _____ deals with the definitions properties of mathematical models of computation.
    8·1 answer
  • If a code word is defined to be a sequence of different letters chosen from the 10 letters A, B, C, D, E, F, G, H, I, and J, wha
    15·1 answer
  • The __________ tag is used to create a forced line break without starting a new paragraph.
    13·1 answer
  • Describe the procedure for creating a table or spreadsheet in a presentation slide.
    13·1 answer
  • Write a test program that prompts the user to enter three sides of the triangle (make sure they define an actual triangle), a co
    5·1 answer
  • Which function calls would provide the most helpful test of this function? Remember: With tests, you are attempting to figure ou
    5·1 answer
  • When measuring processor speed,a megahertz is much faster than a gigahertz.true or fals
    12·1 answer
  • You are designing an exciting new adventure game and you want to attempt to explain where items that are carried by the player a
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!