Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java programming. PLEASE WRITE PSEUDOCODE NOT ACTUAL CODE. And fill in chart below. Thank you! Write the pseudocode that determines the change to be dispensed

Java programming. PLEASE WRITE PSEUDOCODE NOT ACTUAL CODE. And fill in chart below. Thank you!

image text in transcribed

image text in transcribed

image text in transcribed

Write the pseudocode that determines the change to be dispensed from a vending machine. An item in the machine can cost between 25 cents and a dollar, in 5-cent increments (25, 30, 35, .. . 90, 95, or 100), and the machine accepts only a single dollar bill to pay for the item. Requirements and example output. (bold items are user input,) . Only coins with a non-zero value should be displayed Item price must be 25 cents to a dollar, in 5-cent increments. Enter item price: 75 You bought an item for 75 cents and gave me a dollar. Your change is: 1 quarter If more than one coin is returned, the word should be plural with an "s" at the end Ifonly one coin is returned, the word should not have an "s" at the end. Item price must be 25 cents to a dollar, in 5-cent increments Enter item price: 35 You bought an item for 35 cents and gave me a dollar. Your change is: 2 quarters 1 dime 1 nickel Display the change only if a valid price is entered (no less than 25 cents, not more than 100 cents, and an integer multiple of 5 cents. Otherwise, display separate error messages for any of the following invalid inputs: a cost under 25 cents, a cost that is not an integer multiple of 5, and a cost that is more than a dollar. Example Item price must be 25 cents to a dollar, in 5-cent increments Enter item price: 5 Cost is invalid it must be at least 25 cents. Example 2 Item price must be 25 cents to a dollar, in 5-cent increments Enter item price: 150 Cost is invalid it must be no more than 100 cents. Example 3 Item price must be 25 cents to a dollar, in 5-cent increments Enter item price: 73 Cost is invalid it must be evenly divisible by 5 Example4 Item price must be 25 cents to a dollar, in S-cent increments Enter item price 153 Cost is invalid it must be no more than 100 cents. Cost is invalid -it must be evenly divisible by 5 Test Case Cost Change Output Valid only quarters in change Valid only quarter(s) & dime(s) Valid quarter(s), dime(s), & nickel(s) Valid 1 quarter change Invalid less than 25 Invalid more than 100 Invalid not multiple of 5 Invalid 100

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

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions