Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started