Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, Please help write program that calculates coins in Java Program should do the following: 1) Prompts the user to enter a positive integer. 2)

Hello,

Please help write program that calculates coins in Java

Program should do the following:

1) Prompts the user to enter a positive integer.

2) The program should calculate the least possible number of coins and display the result.

3) The program MUST display the results using proper grammar (singular or plural).

4) The program MUST validate the user input and NOT allow ANYTHING that is not an integer greater than or equal to zero.

The programs display must adhere to the following rules:

One coin per line.

Proper use of the singular or plural nouns; example 1 dime or 2 dimes.

Only display coins that are actually used in the result.

ACCEPTABLE display examples include:

2 quarters

1 dime

1 penny

2 dimes

1 nickel

4 pennies

1 quarter

3 pennies

UNACCEPTABLE examples include:

2 quarter(s)

1 dime(s)

1 nickel

1 penny

1 quarter

0 dimes

0 nickels

3 pennies

GENERAL RESTRICTIONS

No break statements to exit loops

Thank you

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

Step: 3

blur-text-image

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

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions