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
What safety feature melts to protect a circuit? a. fuse b. diode c. three-prong plug d. transistor
babunello [35]
The correct answer is A. fuse.
8 0
3 years ago
Read 2 more answers
A network administrator is implementing multifactor authentication for employees who travel and use company devices remotely by
devlian [24]

Answer:

A networking administrator is a multi-factor authentication for employees who use company devices by using a VPN. The level of authentication is 802.1X and OTP.

Explanation:

Network administration is the computer network and uses multiple computers. A company and organization uses multiple computers and need a network admin to connect with a different system. Network administrators depend upon the organization. Some duties of the network administration are split and clearly defined such as

Configure the network hardware, servers, and routers

Upgrade the computer networks

Troubleshooting network issues

Assigning the network models

Deploying the software

Managing the servers

Implementing the security and measure

Network administration requires technical competence and will benefit as a network administrator.

For the level of authentication 802.1, X and OTP are suitable for network administration.

5 0
4 years ago
Gunther is filling in his own input mask. He wants to format the Social Security numbers of his clients. The field must contain
a_sh-v [17]
Last one I am not sure they
3 0
3 years ago
Someone, please answer this.
Sav [38]

Answer: A loop will continue running until the defined condition returns false . ... You can type js for , js while or js do while to get more info on any of these. ... initialization - Run before the first execution on the loop. ... But it can be used to decrement a counter too. statement - Code to be repeated in the loop.

Explanation:

7 0
3 years ago
Write a python program stored in file extra_credit.py that takes three different inputs from the user where : First Input: The p
LUCKY_DIMON [66]

Answer:

Check the explanation

Explanation:

print("************************************************************")

sentence = input("Enter a sentence : ").split()

replace_words = input("\nEnter the words that should be replaced : ").split()

special = input("\nEnter the replacing special Character : ")

result = []

for word in sentence:

   if word not in replace_words:

       result.append(word)

   else:

       result.append(special * len(word))

result = ' '.join(result)

print("\nThe Sentence with words censored is : " + result)

print("************************************************************")

4 0
3 years ago
Other questions:
  • Individuals with desirable traits will be __________ to have young that survive than individuals without these traits. (2 points
    5·2 answers
  • 4. How does distance affect the strength of the force of gravity?_
    5·1 answer
  • I like potatoes do you like potatoes
    15·2 answers
  • To move to the beginning of the line with the keyboard, press the _______ key(s).
    6·1 answer
  • In which circumstances would the view side by side feature be useful or helpful.
    15·2 answers
  • To use appropriate personal protective equipment we should​
    12·1 answer
  • WILL GIVE BRAINLIEST
    5·2 answers
  • Which of the following events happened first
    15·2 answers
  • Which of the following commands should be used if a user does NOT want the header which has been created to appear on the first
    13·1 answer
  • The following procedure is intended to return the number of times the value val appears in the list nylist. The procedure does n
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!