Java to Read a Double Value Represent a Monetary Amount

Download Solution: Click to Download Solution
Solution File Name:JavaReadDoubleValueRepresentMonetaryAmount.docx
Unzip Password:
import java.util.Scanner;

public class MainProgram {

	 * A Java program that prompts for and reads a double value representing 
         * a monetary amount. 
	 * Then determine the fewest number of each bill and coin needed to represent 
         * that amount, 
	 * starting with the highest (assume that a ten-dollar bill is the 
         * maximum size needed). 
	 * For example, if the value entered is $47.63 (forty-seven dollars 
         * and sixty-three cents), 
	 * then the program should print the equivalent amount as: 
         * 4 ten dollar bills
         * 1 five dollar bills
         * 2 one dollar bills
         * 2 quarters
         * 1 dimes
         * 0 nickels
         * 3 pennies
	public static void main(String[] args) {


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.