write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line.

Answers

Answer 1

The program takes an integer input representing the total change amount and outputs the fewest number of coins needed to make that change, with each coin type on a separate line.

To solve this problem, we can use a greedy algorithm approach. We start by defining the available coin types and their respective values. Let's assume we have coins with denominations of 25, 10, 5, and 1 unit.

The program begins by taking an integer input representing the total change amount. Let's say the input is 87.

We initialize a counter variable to keep track of the number of coins used. Initially, the counter is set to 0. We also initialize an empty list to store the coin types used.

Next, we iterate through the available coin types in descending order (from the highest denomination to the lowest). For each coin type, we check if the current change amount is greater than or equal to the coin's value. If it is, we subtract the coin's value from the change amount, increment the counter by 1, and add the coin type to the list.

In our example, we start with the highest coin denomination, 25. Since 87 is greater than 25, we subtract 25 from 87, increment the counter, and add 25 to the list. The new change amount becomes 62.

Next, we move to the next coin denomination, 10. Since 62 is still greater than 10, we subtract 10 from 62, increment the counter, and add 10 to the list. The new change amount becomes 52.

We repeat this process for the remaining coin types. We subtract 10 from 52 again, increment the counter, and add 10 to the list. The new change amount becomes 42.

Next, we subtract 10 from 42 once more, increment the counter, and add 10 to the list. The new change amount becomes 32.

Since 32 is no longer greater than 10, we move to the next coin denomination, 5. We subtract 5 from 32, increment the counter, and add 5 to the list. The new change amount becomes 27.

We repeat this process for the remaining coin types. We subtract 5 from 27 again, increment the counter, and add 5 to the list. The new change amount becomes 22.

Next, we subtract 5 from 22 once more, increment the counter, and add 5 to the list. The new change amount becomes 17.

Finally, we move to the lowest coin denomination, 1. We subtract 1 from 17, increment the counter, and add 1 to the list. The new change amount becomes 16.

To learn more about denomination - brainly.com/question/16839801

#SPJ11


Related Questions

What is the difference between weak AI and strong AI?

Answers

Explanation:Strong AI has a complex algorithm that helps it act in different situations, while all the actions in weak AIs are pre-programmed by a human. Strong AI-powered machines have a mind of their own. They can process and make independent decisions, while weak AI-based machines can only simulate human behavior.

PLS HURRY!!! Look at the image below!
The choices for the second part are number +1, number, number -1

PLS HURRY!!! Look at the image below!The choices for the second part are number +1, number, number -1

Answers

1. <1

2. -1

Explanation:

Which finger is used to press SHIFT key while typing!
A. Little finger
B. Thumb
C. Index finger
D. Ring Finger ​

Answers

Answer:

Little Finger (A)

Explanation:

it would be A. little finger i’m pretty sure

what is the smallest value of n such that an algorithm whose running time is 100????????2 runs faster than an algorithm whose running time is 2???????? on the same machine?

Answers

15 is the smallest integer value that satisfies the equation

To determine the smallest value of n for which an algorithm with a running time of 100n² is faster than an algorithm with a running time of 2ⁿ, we can set up an equation and solve for n.

Let's equate the two running times:

100n² = 2ⁿ

To simplify the equation, we can take the logarithm base 2 of both sides:

log₂(100n²) = log₂(2ⁿ)

Using logarithm properties, we can simplify further:

log₂(100) + log₂(n²) = n

Simplifying the left side:

log₂(100) + 2log₂(n) = n

Let's evaluate the left side:

log₂(100) ≈ 6.64

Now we have:

6.64 + 2log₂(n) = n

We need to find the value of n that satisfies this equation. By trial and error, we find that n = 15 is the smallest value that satisfies the equation:

6.64 + 2log₂(15) ≈ 6.64 + 2(3.91) ≈ 6.64 + 7.82 ≈ 14.46

Since 15 is the smallest integer value that satisfies the equation, the smallest value of n for which the algorithm with a running time of 100n² is faster than the algorithm with a running time of 2ⁿ is indeed 15.

Learn more about algorithm click;

https://brainly.com/question/32283748

#SPJ4

Alright Brainly I need you to ask me some random funny questions PLZ THANK YOU

Answers

Answer:

ok bet

Explanation:

if a king farts, is it a noble gas?

plzzz help i need this today :(

plzzz help i need this today :(

Answers

Answer:

C

Explanation:

a mobile operating system is optimized for ____. select all that apply.a. Touch screenb. File transferc. Wifi connectivity

Answers

A touch screen, quick file transfers, and WiFi connectivity are all supported by mobile operating systems.

Why would someone use a mobile operating system?

Software that enables smartphones, tablet PCs (personal computers), and other devices to run programmes and applications is known as a mobile operating system (OS). A mobile OS typically launches when a device is turned on, displaying a screen with icons or tiles that display information and give access to applications.

What of the following operates on mobile devices?

The mobile operating system known as Android OS is based on a modified Linux kernel. It is free software that is primarily intended for touchscreen mobile devices like smartphones and tablets. This OS is based on a GUI.

To know more about mobile operating systems visit :-

https://brainly.com/question/28930385

#SPJ4

ASAP

There are two competing scientific theories that try to explain the illusion of animation. Which of these answers is NOT one of the competing theories?


Persistence of Vision


Image-permanence


Phi Phenomenon


The first who answers correct will get brainlest and those that are incorrected will be marked with a red flag.

Answers

It’s image-permanence. Hope that helps

Understanding others so I can effectively work with them is ___________. meekness discretion cooperation diligence

Answers

Answer:

cooperation

Explanation:

Cooperation is defined as the teamwork or the process in which few people work together to achieve a single goal.

In the given statement also, the person wants to understand other members in the team so that they can work together or cooperate with each other towards the same goal. Cooperation or teamwork will be successful only when team members will each other and will help each other to done the work effectively.

Hence, the correct answer is "cooperation".

A difference between the Program Evaluation and Review Technique (PERT) and critical path method (CPM) is that: Group of answer choices CPM involves more work than PERT because it requires several duration estimates. CPM addresses the risk associated with duration estimates whereas PERT does not. PERT uses different duration estimates whereas CPM uses one specific duration estimate. unlike CPM, PERT estimates only when there is no risk of uncertainty.

Answers

CPM addresses the risk associated with duration estimates whereas PERT does not.

What is PERT?
Program Evaluation and Review Technique (PERT) is a project management tool used to analyze and represent the tasks involved in completing a given project. It is a statistical tool used in project management, which is used to estimate the amount of time required to complete each task of a project. PERT diagrams are used to identify the critical path of a project and to calculate the expected time for the completion of the entire project. It can also be used to identify potential risks and delays in a project, and to plan for contingencies.

To know more about PERT
https://brainly.com/question/26523302
#SPJ4

write a program to input a number and display it's square root and cube root​

Answers

Answer: Here you go, change it however you like :)

Explanation:

x = int(input("Enter number: "))

print(f"\nSquare root: {x**(1./2.)}")

print(f"\nCube root: {x**(1./3.)}")

Determine if the following problems exhibit task or data parallelism:
•Using a separate thread to generate a thumbnail for each photo in a collection
•Transposing a matrix in parallel
•A networked application where one thread reads from the network and another
writes to the network
•The fork-join array summation application described in Section 4.5.2
•The Grand Central Dispatch system.

Answers

Data parallelism: using a separate thread to generate a thumbnail for each photo in a collection.Data parallelism: transposing a matrix in parallel.Task Parallelism: a networked application where one thread reads from the network and another writes to the network.Data parallelism: the fork-join array summation application described in Section 4.5.2.Task parallelism: the Grand Central Dispatch system

What is parallelism?

In Computer technology, parallelism can be defined as a situation in which the execution of two (2) or more different tasks starts at the same time. Thus, it simply means that the two (2) tasks or threads are executed simultaneously and as such making computation faster.

The types of parallelism.

Generally, there are two (2) main types of parallelism that is used in computer programming and these are:

Data parallelismTask parallelism

Read more on parallelism here: https://brainly.com/question/20723333

when technology improves, the firm's marginal cost curve shifts

Answers

When technology improves, the firm's marginal cost curve shifts. A firm's marginal cost curve is the cost of producing one more unit of the product. The marginal cost (MC) curve typically slopes upward and to the right.

Technological improvements in production processes might result in the marginal cost of a product lowering. It implies that it would become less expensive for the firm to produce an additional unit of product. If the marginal cost curve shifts downwards, it will have an impact on the supply curve in the market.The supply curve is the relationship between the quantity of a good supplied and the price of the good, all other things remaining constant. A change in marginal costs, as we saw, alters the supply curve. When marginal costs drop, supply increases. The supply curve shifts to the right in this scenario.

The technological improvement affects the supply curve by shifting it to the right, which lowers the product's price, causing the demand for it to rise. This shift will continue until the price reaches the market's equilibrium level. The equilibrium point is where supply and demand curves meet. It is a price and quantity that no longer changes over time.To conclude, the marginal cost curve shifting due to technological improvements can lead to a decrease in marginal costs and an increase in supply. This, in turn, can lead to a decrease in product prices, an increase in demand, and a shift of the supply curve to the right.

Learn more about Equilibrium here,https://brainly.com/question/517289

#SPJ11

When technology improves, it can have both positive and negative effects on a firm's marginal cost curve. Technological advancements can lead to lower marginal costs by improving production processes and efficiency. However, if technology upgrades require significant investments or result in higher maintenance costs, the firm's marginal cost may increase.

When technology improves, it can have a significant impact on a firm's marginal cost curve. Marginal cost refers to the additional cost incurred by a firm to produce one more unit of output.

Technological advancements can lead to improvements in production processes, efficiency, and productivity, which can ultimately affect a firm's marginal cost. For example, the adoption of new machinery or automation can reduce labor costs and increase production efficiency, resulting in a lower marginal cost. This means that the firm can produce additional units of output at a lower cost.

On the other hand, if technology upgrades require substantial investments or result in higher maintenance costs, the firm's marginal cost may increase. In such cases, the firm may experience higher costs per unit of output, leading to a higher marginal cost.

Overall, the relationship between technology and a firm's marginal cost curve is complex and depends on various factors such as the nature of the technology, its cost, and its impact on production processes. It is important for firms to carefully evaluate the costs and benefits of adopting new technologies to determine their impact on the marginal cost curve.

Learn more:

About technology improves here:

https://brainly.com/question/28504690

#SPJ11

How do libraries let you write programs at a higher level? Why is testing important when building and sharing libraries?

Answers

Answer:

libraries do this so that you dx chae

Explanation:

Which specific type of attack occurs when a threat actor redirects network traffic by modifying the local host file to send legitimate traffic anywhere they choose

Answers

The specific type of attack that occurs when a threat actor redirects network traffic by modifying the local host file is DNS Poisoning.

What is DNS poisoning?

DNS poisoning is known to be a type of attack where the  hacker uses a method that alters some seen vulnerabilities that are found in the domain name system (DNS).

Conclusively, The type of attack that takes place when a threat actor redirects network traffic by modifying the local host file is DNS Poisoning as it alters it and change it to what they want thereby redirecting users elsewhere.

Learn more about attack from

https://brainly.com/question/76529

#SPJ1

Riley wants to highlight a paragraph by placing it inside a box. Which menu option could Riley use?
O Justify Paragraph options
O Font Styles and Colors
O Borders and Shading
O Bulleted or Numbered Lists

Answers

Riley wants to highlight a paragraph by placing it inside a box. The menu option that could Riley use is borders and Shading. The correct option is c.

What are Borders and Shading?

In Word documents, borders and shading are used to draw the viewer's attention to certain text or paragraphs, making them the viewer's first impression.

To make written text, paragraphs, and other elements look attractive and appealing like they spring out of the page, we can apply Borders and Shading in MS Word.

Therefore, the correct option is c. Borders and Shading.

To learn more about Borders and Shading, refer to the link:

https://brainly.com/question/1553849

#SPJ1

Convert the following denary numbers into binary using 8-bit register:

00000011

00000101

00010101

00111001

01001100

01000001

00101011

10010011

10101010

11111111

Answers

Answer:

1) 3

2) 5

3) 21

4) 57

5) 76

It would be much more easier if there were a grid containing all the numbers.

HELP PLSSSSS!!! I WILL MARK BRAINLIEST FOR THE FIRST AND CORRECT ANSWER!!!

How does hardware differ from software?

Hardware can be an external tool, whereas software is an internal tool.
Hardware performs tasks, whereas software provides instructions.
Hardware runs the computer, whereas software performs tasks.
Hardware is the brain of a computer, whereas software is the heart.

Answers

The answer you are looking for would be A. Hardware can be an external tool, where as software is an internal tool. Hope this helped!

Answer:

The correct answer is A

Explanation:

in 100 word, tell me who is a significant public figure who has the job profile as a "set designer" and explain why

Answers

A significant public figure who holds the job profile of a set designer is Sarah Jones.

Sarah Jones is a highly regarded and influential public figure in the field of set design. With her exceptional talent and creativity, she has made a significant impact on the world of film and theater. As a set designer, Sarah Jones is responsible for conceptualizing and creating the visual environment of a production. She collaborates closely with directors, producers, and other members of the production team to bring their vision to life. Sarah's expertise lies in her ability to transform abstract ideas into tangible and captivating sets that enhance the overall storytelling experience.

Sarah Jones' work is characterized by her meticulous attention to detail and her ability to capture the essence of a story through her designs. She carefully considers the mood, time period, and thematic elements of the production, ensuring that the set not only complements the performances but also adds depth and authenticity to the narrative. Sarah's portfolio includes a diverse range of projects, from period dramas to futuristic sci-fi films, each demonstrating her versatility and artistic vision.

In addition to her creative talents, Sarah Jones is known for her professionalism and effective communication skills. She understands the importance of collaboration and works closely with the entire production team to ensure a seamless integration of the set design with other elements such as lighting, costumes, and sound. Her ability to effectively translate ideas into practical designs, coupled with her strong organizational skills, makes her an invaluable asset to any production.

Learn more about job profile

brainly.com/question/884776

#SPJ11

Which dns server offers the most current resolution to a dns query?

Answers

Recursive, iterative, and non-recursive DNS query types. IP addresses are converted to domain names through a process known as DNS (Domain Name Server) resolution.

Which DNS protocol resolves names fully?

Recursive DNS requests are those that go back and forth between the client and the recursive server. Either the full name resolution or an error message stating that the name cannot be found is sent as the response. Recursive queries either produce the correct response or an error.

A DNS query name is what?

A fully qualified domain name, which is displayed as a DNS domain name, is referred to by a DNS query name (FQDN). You can change, add, or remove rules. Pick the Query Names tab in the DNS-Proxy Proxy Action configuration.

To know more about DNS visit:-

https://brainly.com/question/30408285

#SPJ4

Does any one know how to code? If you do can you help me with my project?

Answers

Answer:

kinda look it up!!!

Explanation:

go to code.org free coding

i can help you man

-scav aka toby

Constructive criticism
Brainstorming possible solutions means one person generates all the ideas.

True
False
Question 2(Multiple Choice Worth 3 points)
(03.04 MC)

Your friend has asked you to provide one tip for accepting constructive criticism. Which of the following is the best technique?

Become defensive about the criticism
Reflect upon the criticism
Resist seeking solutions to the behavior that prompted the criticism
Tune out the critic's criticism
Question 3 (True/False Worth 3 points)
(03.04 LC)

Constructive criticism deals with a person, not his or her behavior.

True
False
Question 4 (True/False Worth 3 points)
(03.04 LC)

Project managers have the overall responsibility for planning, executing, and completing a project.

True
False
Question 5(Multiple Choice Worth 3 points)
(03.04 MC)

Read the following scenario:

A project will require more people than originally estimated.

Identify the possible risks to the project.

Ideas and creativity
Money and resources
Policies and procedures
Time and work ethic is intended as a possible solution. True False

Answers

Answer:

1. False

2. Reflect upon the criticism

3. True

4. False

5. True?

Answer:

1. True

2.Reflect upon the criticism

3.True

4.False

5.Time and work ethic is intended as the possible solution

Use______ to format cells when they meet a certain criteria.

data calculations
conditional formatting
data formatting
data input

Answers

Data Calculations

Good luck

what is the general procedure to access the content on a mobile phone sim card?

Answers

The content on a SIM card should be done with proper authorization and for legitimate purposes. Additionally, the ability to access certain types of data may depend on the SIM card's capabilities and the device or software being used.

To access the content on a mobile phone SIM card, you typically follow these general procedures:

1. Obtain the necessary tools: You'll need a SIM card reader or a compatible device to connect the SIM card to a computer or another device.

2. Power off the mobile phone: Before removing the SIM card, power off the mobile phone to prevent any potential data corruption or damage.

3. Locate and remove the SIM card: The SIM card is usually located under the back cover or in a slot on the side of the phone. Refer to the phone's user manual or manufacturer's instructions to locate and remove the SIM card correctly.

4. Connect the SIM card to a computer or device: Insert the SIM card into a SIM card reader or a compatible device, such as a SIM card adapter connected to a computer.

5. Install SIM card software: Depending on the SIM card reader or the device you're using, you may need to install specific software or drivers to access the SIM card's content. Follow the instructions provided with the reader or device to install the necessary software.

6. Access the SIM card's content: Once the SIM card is connected and the required software is installed, you can access its content using the provided software or through the file explorer on your computer. The specific steps may vary depending on the software or device you're using.

7. Retrieve data from the SIM card: With access to the SIM card's content, you can retrieve various types of data, including contacts, text messages, call history, and possibly other data stored on the SIM card.

To know more about  SIM card

brainly.com/question/31445771

#SPJ11

What are cascading style sheet?

Answers

Cascading Style Sheets is a style sheet language used for describing the presentation of a document written in a markup language such as HTML. CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript.

Answer:

It is used to describe the presentation of a document written up in a markup language such as HTML....

Explanation: Hope this helps<3

if a network admin needs to know if a computer is connected to the network and can respond what tool should the admin use? (4 points)

Answers

As a network admin, if you need to know if a computer is connected to the network and can respond, you can use a ping tool.

A ping is a command that is used to test the connectivity between two devices on the network. Ping sends a signal to the device and waits for a response. It is a network utility tool that network administrators use to check the connectivity of a host on a TCP/IP network. It is an effective way to determine whether a device on the network is available or not.

There are a few different ways to use the ping command. One is to use it to test the connectivity between two devices on the network. Another is to use it to test the connectivity between a device on the network and an outside resource, such as a website or server.

Ping is a useful tool for network administrators, as it can help them troubleshoot network connectivity issues. By using the ping command, a network administrator can quickly determine whether a device on the network is available or not, and can take the appropriate steps to resolve the issue.

More on network admin: https://brainly.com/question/29462344

#SPJ11

Contrast the ways that Maggie walker and Sarah “madam C.J” Breedlove walker supported the black community through their work

Answers

Although Madam C.J. Walker assisted the community by developing hair and beauty products for black women, Maggie Walker supported the community by starting a bank and offering financial services.

How did Madam C.J. Walker support the African-American community?

Her political and philanthropic influence grew along with her money. Walker gave to the YMCA, covered the Tuskegee Institute tuition for six African Americans, and participated in the fight against lynching by giving $5,000 to the NAACP's programmes.

What was the Walker approach she promoted in her goods?

The name of her initial line of goods was "Madam Walker's Amazing Hair Grower." The "Walker Way" was her own strategy for selling goods. She employed "The Walker Way" by selling door to door.

To know more about beauty products visit:-

https://brainly.com/question/26455031

#SPJ1

the disadvantages of the waterfall approach to software development relate primarily to _____.

Answers

Answer:

the disadvantages of the waterfall approach to software development relate primarily to figure it out yourself bozo.

Explanation:

Problem 3-28 (hint: You can fully use one 3-8 decoder so that you can have 3 inputs and 8 outputs. Meanwhile, you can partially use the second 3-8 decoder so that you have 1 input and 2 outputs. For this second 3-8 decoder, you only need to use one of its inputs [you can connect the other two inputs to the ground so that these two inputs are always zero] and two of its 8 outputs [the other six outputs are simply not used]. Note that each of the two outputs of the second 3-8 decoder controls 8 2-input AND gates).

3-28. Design a 4-to-16-line decoder using two 3-to-8-line decoders and 16 2-input AND gates.

Answers

The truth table for the 4-to-16-line decoder is shown below. The table has inputs A, B, C, and D. The outputs are labeled Y0 through Y15.

Design a 4-to-16-line decoder using two 3-to-8-line decoders and 16 2-input AND gates.The equation for each of the 16 outputs will be calculated using the given truth table as a reference.

Each output equation will be constructed using AND gates and OR gates. The truth table indicates which AND gates should be used for each output equation as well as which inputs should be inverted.Using the hint provided in the problem, the first decoder will be connected to A, B, and C.

The second decoder will be connected to D. 8 of the outputs from the first decoder will be connected to the 8 AND gates associated with each of the first 8 outputs of the second decoder. The remaining 8 outputs from the first decoder will be connected to the 8 AND gates associated with each of the last 8 outputs of the second decoder.

The two outputs from the second decoder will be used to control the 8 AND gates associated with each of the first 8 outputs of the first decoder. To do this, one output will be inverted using a NOT gate before it is connected to the AND gates.

The other output will be connected directly to the AND gates.A total of 16 AND gates are needed. Each AND gate should have two inputs. The output of each AND gate will be connected to a single output pin.

To learn more about "Truth Table" visit: https://brainly.com/question/28605215

#SPJ11

if users access only certain fields in a table, how can you improve performance?

Answers

To improve performance when users access only certain fields in a table, you can implement the following techniques:

1. Use SELECT queries to retrieve specific fields instead of using SELECT * to fetch all fields. This reduces data transfer and processing time.

2. Create indexed views or materialized views for frequently accessed fields, as these store precomputed results and speed up query execution.

3. Normalize the database schema to eliminate redundancy and optimize storage, making it easier to access relevant fields.

4. Utilize partitioning to divide the table into smaller, more manageable pieces, allowing faster access to specific fields.

5. Optimize queries using proper indexing strategies, including the use of covering indexes to include all requested fields.

By implementing these strategies, you can significantly improve the performance when users access only certain fields in a table.

learn more about users access here:
https://brainly.com/question/30461919

#SPJ11

Other Questions
The party with 15. The party with the short position 7. An interest rate is 158 with semiannual compounding compoundin 14.46% (B) 15.008 6) 15.0\%\% D) 13.98% F) 12.67% Pls help Its math give me a real answer and explanation pls!Will give brainly The linear impulse delivered by the hit of a boxer is 287 N s during the 0.523 s of contact.What is the magnitude of the average force exerted on the glove by the other boxer?Answer in units of N. Front Elevation = What you see looking at the front of an objectPlan = What you see looking down on top of an object Identify behaviors that can help prevent accidentsHelp quick please!! the poet william wordsworth believed that _________ was the most trustworthy teacher and the source of all true feelings. help pleaseeeeeeee!!!!!!!! please help with the top 3 ill give u brainliest, what is the volume of the figures below? Use the diagram to answer the following question.What is the BEST title for this diagram?A. Factories and the Great DepressionB. The Purchasing Cycle and the Great DepressionC. Supply and Demand During the Great DepressionD. The Role of Unemployment in the Great DepressionFactories produced more goods than people could buy. Prices dropped. Companies lowered wages and laid off workers. People had less money to buy goods. 54 x 11 = ( 34 +) x 11 Cash and other assets that are expected to be converted to cash or sold or used up within one year or less through the normal operations of the business are called ______. When meiosis occurs, four daughter cells containing 50% of a parents genetic material are produced. The genes contained in these cells are divided randomly. When fertilized with another haploid cell, a full genetic code is formed. Because genes are divided randomly during this process, the resulting offspring - A) express the same inherited traits B) contain only half of the genetic codeC) will differ in expressed traits D) lack differentiated cells Give 3 reasons on why you like the movie Agent Cody Banks!-Asking for public opinions for a project, please give me a good response not nonsense-1.2.3.( Best Response will be marked brainiest! ) you have an image selected in your document. you would expect the crop image command to be: Need the answer quick please thanks Determine the interval(s) for which the function shown below is decreasing. Describe how population distribution affects the cultural landscape. Z= [?] i dont know how to type out the question The majority of american settlers who traveled west to california did so by sea during the 1830s and 1840s, leading up to the discovery of gold in 1848.a. Trueb. False What is an acid and a bases?