Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your task in Programming Assignment 5 is to pseudocode the selection and dispensing of a Diet Coke. Check out the video demonstration on D2L of

Your task in Programming Assignment 5 is to pseudocode the selection and dispensing of a Diet Coke. Check out the video demonstration on D2L of me purchasing Diet Cokes and pondering the embedded logic in the machines. My favorite Coke machine in Allgood Hall has Diet Cokes in selection slots B1 through B5 and each slot (column) holds 10 bottles. When I purchase a Diet Coke, I always select B1. I don't always get a Diet Coke from B1. Why? As discussed in the demo video, there's an algorithm coded into this machine that will dispense a Diet Coke and maintain the B1 - B5 slot inventory as even as possible or at least the front row for as long as possible. In other words, the embedded logic will not necessarily dispense a Diet Coke from slot B1 when I select B1. Develop an algorithm and write the pseudocode that accomplishes the goal of maintaining that attractive front row as long as possible. The overall goal is to keep the B1 - B5 front row full and not allow an empty slot for as long as possible. Limit your pseudocode to Diet Cokes (slots B1 - B5) and assume you start with a full machine of 50 Diet Cokes (10 rows and 5 columns). You are to pseudocode the selection and dispensing portion of the transaction. Don't worry about entering money, making change, etc Your pseudocode should be of sufficient detail to describe a complete Diet Coke selection and dispensing algorithm.

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 2 Lnai 6322

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215882X, 978-3642158827

More Books

Students also viewed these Databases questions

Question

Discuss the evidence for environmental influences on intelligence.

Answered: 1 week ago

Question

Is it clear what happens if an employee violates the policy?

Answered: 1 week ago