how do you write a program that converts number of coins to dollars and cents?
612486
This is pretty straighforward in C - I won't write the assignment for you, but the general proccess is as follows:  \n\n1.  Count the number of each coin - store that number in some variable (say, int num_dimes;  )  If you're reading from a file, it's a little more complicated, but if your user is entering something from a command line (as is the case with beginning programming assignments, usualy) it's just a matter of having them enter a number and using a function like get() to read the input.  \n\n2.  Multiply the number of each coins by the appropriate denomination.  For example - if you counted 6 dimes in the previous step, multiply 6 by .10.  Make sure that you store the result in a floating point variable, and it's generaly a good idea to ensure that you're multiplying two floats together in order to get a float answer.  Use something like this:\n  \nfloat dimes_total; \ndimes_total = (float)num_dimes * 0.10;   \n\nthe (float) in front of num_dimes casts that variable as a floating point number.  \n\n3.  After you've done this for each coin, simply add up the totals: \n\nfloat total; \ntotal = pennies_total + nickles_total  ... etc, etc.\n\n4.  print your answer to the screen - since dollars and cents use the same number base as arithmetic done by the compiler, nothing fancy is needed here.    In cases where you're dealing with different number bases, however, it gets to be a little more tricky.
604893
seperate them into 4s then count them as 1 dollar
1172156
5 nickels , 2 quarters, and 1 pennie = 8 coins
596652
I used to do that before I decided what a pain in the neck it was and took the 8-9% hit from going to the change machine at the market.\n\nI got a box top and raised the big flat side up with a book at an angle.  Then I counted out the coins and laid them in the groove made by the side of the box top, and marked the spot where the required amount ended,  and then pushed the wrapper along the coins, then scooped it up and tidied up and folded the ends down.  Repeat, but you don't have to count the coins anymore because you marked the spot where they ended for that amount.\n\nThere are gizmos you can buy that "count" the coins by allowing only so many in the various columns and then you can slip the wrapper along the columns....
302046
40 pennies, 8 nickels, 2 dimes\n45 pennies, 2 nickels, 2 dimes, 1 quarter
562346
This problem has a simple solution as a recursive procedure. Suppose we think of the types of coins available as arranged in some order (e.g. 100, 50, 20, 10, 5, 2, 1). Then the following relation holds:\n\nThe number of ways to change amount a using n kinds of coins equals\n\nthe number of ways to change amount a using all but the first kind of coin, plus\n\nthe number of ways to change amount a - d using all n kinds of coins, where d is the denomination of the first kind of coin. \n\nTo see why this is true, observe that the ways to make change can be divided into two groups: those that do not use any of the first kind of coin, and those that do. Therefore, the total number of ways to make change for some amount is equal to the number of ways to make change for the amount without using any of the first kind of coin, plus the number of ways to make change assuming that we do use the first kind of coin. But the latter number is equal to the number of ways to make change for the amount that remains after using a coin of the first kind.\n\nThus, we can recursively reduce the problem of changing a given amount to the problem of changing smaller amounts using fewer kinds of coins.  It helps to specify the following degenerate cases:\n\nIf a is exactly 0, we should count that as 1 way to make change.\n\nIf a is less than 0, we should count that as 0 ways to make change.\n\nIf n is 0, we should count that as 0 ways to make change. \n\nIf you do it correctly, you should get answers like the link below.  Note: if a valid way to form 100Rs is with a 100rs note (which I assume it is), then include '100' in your list.  This is essentially one more than if it isn't included.\n\nI created a small recursive VB function as follows:\n\nFunction CoinChange(n As Integer, a As Integer)\n    If a < 0 Or n = 0 Then\n        CoinChange = 0\n        Exit Function\n    End If\n    If a = 0 Then\n        CoinChange = 1\n        Exit Function\n    End If\n    Dim coin As Integer\n    Select Case n\n    Case 7\n        coin = 100\n    Case 6\n        coin = 50\n    Case 5\n        coin = 20\n    Case 4\n        coin = 10\n    Case 3\n        coin = 5\n    Case 2\n        coin = 2\n    Case 1\n        coin = 1\n    End Select\n    CoinChange = CoinChange(n - 1, a) + CoinChange(n, a - coin)\nEnd Function\n\nRunning this I got:\n1=1\n2=2\n3=2\n4=3\n5=4\n6=5\n7=6\n8=7\n9=8\n10=11\n11=12\n12=15\n13=16\n14=19\n15=22\n16=25\n17=28\n18=31\n19=34\n20=41\n...\n95=3778\n96=3925\n97=4072\n98=4219\n99=4366\n100=4563\n\nSo the answer is there are 4,563 ways to form 100 using 1, 2, 5, 10, 20, 50, 100
974209
Four pennies\nTwo Nickles\nOne Dime\nOne Quarter\nOne Half Dollar\n\nThough you really need one coin (a dollar coin) -- since you don't specify that it has to be paid for with exact change.
801304
x = dimes\n2x = nickels\n2x-3 = quarters\n\nNow multiply in the values of the coins:\n\n.10(x) for dimes               .10x\n.05(2x) for nickels            .10x\n.25(2x-3) for quarters       .50x-.75\n\nall of which sums to 2.05.\n\nMultiply everything by 100 to get rid of the pesky decimals and you get to:\n\n10x + 10x + 50x - 75 = 205\n\n70x = 280\n\nx = 4\n\nSO.....\n\nThere are 4 dimes for 40 cents\nthere are 8 nickels for 40 cents\nand there are 5 quarters for 1.25\n\nFor a grand total of 2.05.\n\nHappy happy!!
210388
10 nickels =  .50      - 1.00\n2 quarters =  .50      -\n\n\n4 dimes       =.40\n1 quarters    =.25\n7 nickels     =.35\n\n2 quarters 10 nickels\n1 quarter 4 dimes 7 nickels\n8 dimes 4 nickels
49715
use bitwise operators. something like:\n\nnum_bits = 0;\nfor(i = 0; i < 32; i++) {\nif number & (1<<i) num_bits++;\n}\n\nnow num_bits holds the number of bits that were set in number. The "<<" operator does bit shifting. So "1<<i" equals a number that's all 0's except for a 1 at position i. If you bitwise and that with something, that tells you if that bit is set in the number. So we do this for each of the bits and add up the results.\n\nThis is assuming 32-bit integers. Adjust accordingly for 64-bit integers.
472542
Take each one and put in over 1000 and then reduce.\nYou use 1000 because there are 3 decimal places.
890204
1 quarter\n5 dimes\n2 pennies\n\n1+5+2 = 8 coins\n.25 + 5(.10) + 2(.01) = .25 + .50 + .02 = $0.77
172025
This problem is easy because we can only have 2 coins.  Each penny is worth 1 cent, but also 1 coin.  What I did to solve this problem was use a guess and check method.  \n82 cents- 22 cents (all in pennies) = 60 cents.  Because there are 34 coins, we subtract 22 from 32 to get 12.  That means that 12 coins have to be nickels and to check that this is correct:\n12 * 5 = 60 (cents from nickels) + 22 (cents from pennies)= 82 cents.  12 nickels were found.
896257
1. \nLet n be the number of nickels\nLet d be the number of dimes\nLet q be the number of quarters\n\nNumber of coins is 30:\n#1) n + d + q = 30\n\nThere are twice as many nickels as quarters:\n#2) n = 2q\n\nTotal value of the coins is $3.35.  (Use the value in cents, rather than dollars).\n#3) 5n + 10d + 25q = 335\n\nThree equations and three unknowns...\n\nSubstitute #2 into #1:\nd + 3q = 30\nAnd into #3:\n10d + 35q = 335\n\nNow solve for d:\nd = 30 - 3q\n\nSubstitute into the last one:\n10(30 - 3q) + 35q = 335\n300 - 30q + 35q = 335\n5q = 35\nq = 7\n\nPlug q back into d = 30 - 3q:\nd = 30 - 3(7)\nd = 9\n\nPlug q back into n = 2q\nn = 2(7)\nn = 14\n\nSo you have 14 nickels, 9 dimes, 7 quarters\n\n(As a double check --> 0.70 + 0.90 + 1.75 = 3.35)\n\n2. \nKaren is Anthony (statement #3)\nSince Karen is Anthony, John must be Juliet (statement #1)\nBeth is not Cleopatra, so she must be Romeo (statement #4)\nThat leaves Dan to be Cleopatra.\n\nFinal result:\nKaren = Anthony\nJohn = Juliet\nBeth = Romeo\nDan = Cleopatra\n\nThose cross-dressing friends...
1066868
www.xe.com \n\nbest site ever for currency conversions of any sort.\n\ncheers!
611673
There are 4,563 ways to make exactly $100 using $1, $2, $5, $10, $20, $50, and $100 bills.  I made an Excel spreadsheet that found them all, but please don't ask me to list them:)\n\nGood luck.
779807
Yiu would first decide how many decimal places you are going to consider.  The usual is 3.  Then work it from there...;