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

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
An attribute on a webpage allows you to set borders and change background colors. true or false
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
Where would you click to edit the chart data?
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runnersโ€™ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
question
Computers and Technology, 23.06.2019 13:30
Drag the tiles to the correct boxes to complete the pairs. match the errors with their definitions. #name #value #ref when a formula produces output that is too lengthy to fit in the spreadsheet cell arrowright when you enter an invalid cell reference in a formula arrowright when you type text in cells that accept numeric data arrowright when you type in a cell reference that doesnโ€™t exist arrowright reset next
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
question
English, 12.04.2021 02:30
question
English, 12.04.2021 02:30
question
English, 12.04.2021 02:40
question
Mathematics, 12.04.2021 02:40
Questions on the website: 13722367