Question: write a simple program (main method) that determines the total cash value held in a piggy bank jar full of small Canadian coins. The jar
write a simple program (main method) that determines the total cash value held in a piggy bank jar full of small Canadian coins. The jar may contain only three types of coin within: nickels (worth 5 cents), dimes (worth 10 cents), and quarters (worth 25 cents).

public class Question1 {
public static void main(String[] args) {
// answer Question1 here
}
}
In Question01.java, write a simple program (main method) that determines the total cash value held in a piggy bank jar full of small Canadian coins. The jar may contain only three types of coin within: nickels (worth 5 cents), dimes (worth 10 cents), and quarters (worth 25 cents). Setup your own variables, assign them values and ensure that your code so follows all appropriate STYLE conventions discussed in lectures (i.e. so that it is readable, has no magic numbers, compiles). YOU DO NOT NEED TO GET INPUT FROM THE USER!! Format your output so that it displays the result in the following way Example 1: nickels 10, dimes 4, quarters 62 would give the following output nickels dines quarters total 10 62 $16.40 Example 2: nickels 150, dimes 456, quarters-380 would give the following output: nickels dines 150 56380148. 10 Example 3: nickels 150, dimes 456, quarters 380 would give the following output: nickels dines 3055 5809 6670 2401. 15 quarterstotal quarters total
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
