|
Java Exercises - Selection
Page history
last edited
by Steve Sweeney 14 years, 1 month ago
- In the country of Rahmania, the cost of mailing a letter is 40 sinas for letters up to 30g, 55 sinas for letters over 30g and up to 50g, 70 sinas for letters over 50g and up to 100g, and then an additional 25 sinas for each additional 50g or part thereof. Write a program tha prompts the user for a mass and then gives the cost of mailing a letter having that mass.
- 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, pennies) that could make up that amount.
Improvements:
- The program should produce change containing the minimum number of coins required.
- The output should be expressed in a natural form. For example, don't refer to zero coins of a particular type, or the singular or plural forms for coins should be used correctly (i.e., "1 dime", not "1 dimes").
-
Java Exercises - Selection
|
Tip: To turn text into a link, highlight the text, then click on a page or file from the list above.
|
|
|
Comments (0)
You don't have permission to comment on this page.