Answered step by step
Verified Expert Solution
Link Copied!

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).

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions

Question

Did the team members feel that their work mattered

Answered: 1 week ago

Question

3. What may be the goal of the team?

Answered: 1 week ago