Plz write a program

Write a program that makes change for amounts less than one dollar. Input to the program should be a positive integer less than 100, representing an amount of money, in cents. Output should be the original amount of money together with a set of coins (quarters,dimes,nickels,cents) that could make up the amount. The program should produce change containing the minimum number of coins required for the given amount. In printing the result, the program should print results in a reasonable, non-stilted way. For example, input of 58 should produce results something like

o[u]utput[/u]

[size=2]58 cents requires 2 quarters, 1 nickel, 3 cents.
[/size]
[u]Rather than[/u]
[size=2]58 cents requires 2 quarters, 0 dimes, 1 nickels, 3 cents.[/size]

[color=Blue]Thank you Very Much. GOd Bless you.[/color]


Comments

  • : Write a program that makes change for amounts less than one dollar.
    : Input to the program should be a positive integer less than 100,
    : representing an amount of money, in cents. Output should be the
    : original amount of money together with a set of coins
    : (quarters,dimes,nickels,cents) that could make up the amount. The
    : program should produce change containing the minimum number of coins
    : required for the given amount. In printing the result, the program
    : should print results in a reasonable, non-stilted way. For example,
    : input of 58 should produce results something like
    :
    : o[u]utput[/u]
    :
    : [size=2]58 cents requires 2 quarters, 1 nickel, 3 cents.
    : [/size]
    : [u]Rather than[/u]
    : [size=2]58 cents requires 2 quarters, 0 dimes, 1 nickels, 3
    : cents.[/size]
    :
    : [color=Blue]Thank you Very Much. GOd Bless you.[/color]

    [code]
    VAR
    Dough : Real;
    Begin
    Write('How much dough?'); ReadLn(Dough);
    WriteLn(Dough, ' cents requires ',100-Dough,' pennies');
    End.
    [/code]

    This will give you the change in all pennies, which should be good enough.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion