Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 totalStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started