Can anyone help me with Java programming?
What kind?
let me post the code i have so far
import java.util.Scanner; //Need Scanner class public class Money { public static void main(String[] args) { double amount; //To hold the monetary amount int newAmount; //To hold the total amount of Dollars double amount_Of_Coins; //To hold the total amount of coins int bill20, bill10, bill5, bill1; //To hold the units of bills of the monetary amount int coin25, coin10, coin5,coin1; //To hold the units of coins of the monetary amount Scanner keyboard = new Scanner(System.in); //Ask the user for the monetary amount System.out.println("Enter a monetary amount between 0 - 999.99: "); amount = keyboard.nextDouble(); newAmount = (int)amount;
i'm asked to show amounts for each smaller amount of the monetary unit. basically show amounts for 20,10,5,1 dollar bills and quarter,dime,nickel,and penny coins. i want to come up with a mathematical operation which will give me the correct monetary units for any money amount i can input
Sorry, I'm not really good at math but you should post your question on the mathematics section of OpenStudy and you might get a better answer.
its ok the math part is the tricky part i just need to get it right because i have been getting wrong values
Please post your question in the Computer Science group. Thank you! Link to the Computer Science group: http://openstudy.com/study#/groups/Computer%20Science
Join our real-time social learning platform and learn together with your friends!