subject

Write a program in java that simulates a vending machine: the vending machine sells three types of food: 1) potato chips $1.25; 2) cookies $0.85; 3) candies $0.95. the program will prompt for the buyer to enter the amount in quarters (25 cents), dimes (10 cents), and nickels (5 cents). the program will then present a selection menu for the foods and prompt the buyer to enter the amount of quarters, dimes and nickels. the machine would then proceed to display the total amount inserted then the buyer will makes a selection. if the buyer selects a food that is sold out, the program will display a message and re-display the selection menu. if the buyer the equal amount of money to the food cost, the selected food will be dispensed, with a message " take a your (food)". if the amount is more than the cost, an appropriate amount of change (in quarter, dime or nickel) will be dispensed back to the buyer. every food is initialized with a fixed quantity. the quantity is reduced by one every time the food is dispensed. when the quantity of a food is 0, no more should be sold, with an error stating "sold out. make another choice".note: 1 dollar = 4 quarters = 10 dimes = 20 nickels1 dollar = 100 cents1 quarter = 25 cents1 dime = 10 cents1 nickel = 5 cents

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:00, robert7248
Competent nonverbal communication involves interacting with others in a manner that is appropriate for which of the following? select all that apply. situation task individuals
Answers: 3
image
Computers and Technology, 23.06.2019 05:30, savyblue1724707
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, quintinlarrieu
How would you cite different books by the same author on the works cited page? moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. –––. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. –––. folk songs and ballads. salem: poetry press, 1999. print.
Answers: 2
image
Computers and Technology, 24.06.2019 13:30, lorelaistudent
Does anybody know how to hack into a google account? i had important information on it and it is gone now and i need getting it back.
Answers: 1
You know the right answer?
Write a program in java that simulates a vending machine: the vending machine sells three types of f...

Questions in other subjects:

Konu
World Languages, 16.11.2020 16:30