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, 22.06.2019 10:30
You have a large, late-model pick-up truck with a rear seat. the pick-up truck weighs 6,500 pounds. the florida seat belt law
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Alex’s family members live in different parts of the world. they would like to discuss the wedding plans of one of their distant relatives. however, alex wants all the family members to talk to each other simultaneously so that they can make decisions quickly. which mode of internet communication should they use? a. blog b. email c. wiki d. message board e. instant messaging
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
Which of the following is not an enhancement to the standard wiki to make it more attractive for corporations? encryptionwork spacespermission toolspredictive text
Answers: 2
question
Computers and Technology, 23.06.2019 20:10
Leo is a recruitment executive for a large company. he has identified new labor resource requirements in both the marketing and production departments. what should be his first step in recruiting candidates for the positions? a. conduct background checks of candidates b. make job offers c. arrange interviews d. conduct reference checks e. place job ads on job sites
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, 13.07.2019 21:00
question
Mathematics, 13.07.2019 21:00
Questions on the website: 13722360