i need to make a java code that
makes an ammount and puts them in dollars and coins
$14.96
14 dollars(no 20 or 50 dollar bills just ones)
3 quarters
2 dimes
1 nickle
1 pennie
i stopped its unfinished cause my teacher says its wrong but my speudocode is wright cant find it so i count type it here lol
i need help with this and im using
jgrasp
with jdk6 update
makes an ammount and puts them in dollars and coins
$14.96
14 dollars(no 20 or 50 dollar bills just ones)
3 quarters
2 dimes
1 nickle
1 pennie
Code:
import javax.swing.*;
public class Lab5
{
public static void main(String[] args)
{
double dollar_value(1.00);
double quarter_value(0.25);
double dime_value(0.10);
double nickel_value(0.05);
double pennies_value(0.01);
int num_dollars;
int num_quarters;
int num_dimes;
int num_nickels;
int num_pennies;
int total_num_coins;
int total_val_money = dollar_value + quarter_value + dime_value + nickel_value + pennies_value;
int total_dollar_val = dollar_value * num_dollars;
int total_quarter_val = quarter_value * num_quarters;
int total_dime_val = dime_value * num_dimes;
int total_nickel_val = nickel_value * num_nickels;
int total_pennies_val = pennies_value * num_pennies;
system.out.println ammount("14.96");
if(00.)
i need help with this and im using
jgrasp
with jdk6 update
Comment