Question

In: Computer Science

A soft drink vending machine dispenses cans of drinks at the JKUAT cafeteria. The machine waits...

A soft drink vending machine dispenses cans of drinks at the JKUAT cafeteria. The machine waits for students and/or staff to insert coins. All soft drinks cost KShs. 50 and the machine can only accept Ten, Twenty and Forty shilling coins. A customer must insert a total of fifty shillings for the machine to dispense drinks.

(i.)      Give the formal definition of the above machine, as a Finite Automaton.

(ii.)     Is the machine deterministic or non-deterministic? Justify your answer

(iii.)    Draw a state transition diagram for the above machine

(iv.)    Write a C++ program to implement the above machine

Solutions

Expert Solution

1. The vending machine is the type of finite automation. Beacuse it includes number of inputs and number of outputs. It has three inputs ten, twenty, fourty as coins. If customer insert ten or twenty or fourty coins then machine gives perticular soft drink. Also if customer want to take drink of 50 coins then machine just add ten and fourty and give 50 coins drink. So due to this the number of inputs relates to each other and gives a desirable outputs is called fininte automation.

2.The machine is deterministic. Because all outputs given by machine is pre defined. Drink quantity also pre defined and based on coins ten, twenty and fourty.

3. State transition diagram :-

[50 coins] -- [ [S1][S2][S3] ] -- [S1+S3] -- [Drink 50 coin]

- [50 coins] : Input from customer.

- [[S1][S2][S3]] :Variables [[10],[20],[40]]

- [S1+S3] : Adding of Variables 10 and 40

- [ Drink 50 Coins ] : Output is 50 coins drink.


Related Solutions

A vending machine in the student cafeteria dispenses drinks into paper cups. A sample of 15...
A vending machine in the student cafeteria dispenses drinks into paper cups. A sample of 15 cups yields a mean of 15.3 ounces with a variance of 3.5. After adjusting the machine, a sample of 10 cups produces an average of 17.1 ounces with a variance of 3.9. If s2 is assumed to be constant before and after the adjustment, construct a 95 percent confidence interval for the difference in mean fills. Assume the amounts dispensed are normally distributed. The...
A distributor of soft drink vending machines knows fromexperience that the mean number of drinks...
A distributor of soft drink vending machines knows from experience that the mean number of drinks a machine will sell per day varies according to the location of the machine. At a local mall, two machines are placed in what the distributor believes to be two optimal locations (Location A and B). The number of drinks sold per day for each machine is recorded for a random sample of 20 days. For each day, the number of drinks purchased at...
The number of cans of soft drinks sold in a machine each week is recorded below...
The number of cans of soft drinks sold in a machine each week is recorded below WEEKLY PERIOD 1 2 3 4 5 6 7 8 SOFT DRINKS SOLD 122 85 92 98 110 108 115 102 WEEKLY PERIOD 9 10 11 12 13 14 15 16 SOFT DRINKS SOLD 95 98 105 125 85 106 140 84 WEEKLY PERIOD 17 18 19 20 21 22 23 24 SOFT DRINKS SOLD 92 85 78 105 111 152 140 108 A....
The number of cans of soft drinks sold in a machine each week for 12 weeks...
The number of cans of soft drinks sold in a machine each week for 12 weeks is provided. Develop forecasts using a three-period moving average. 338, 219, 278, 265, 314, 323, 299, 259, 287, 302, 320, 335 A)What is the MSE? (show answer to 2 decimal places) What is the forecast for week 13? (show answer to 2 decimal places) B)Use a weight of 1/2 for the most recent period, 3/8 for the next most recent period, and 1/8 for...
PLEASE BE VERY SPECIFIC WITH EACH STEP A soft drink bottler is analyzing the vending machine...
PLEASE BE VERY SPECIFIC WITH EACH STEP A soft drink bottler is analyzing the vending machine service routes in his distribution system. He is interested in predicting the amount of time required by the route driver to service the vending machines in an outlet. The industrial engineer responsible for the study has suggested that the two most important variables affecting the delivery time (Y) are the number of cases of product stocked (X1) and the distance walked by the route...
Question 1 A soft drink bottler is analyzing the vending machine service routes in his distribution...
Question 1 A soft drink bottler is analyzing the vending machine service routes in his distribution system. He is interested in predicting the amount of time required by the route driver to service the vending machines in an outlet. The industrial engineer responsible for the study has suggested that the two most important variables affecting the delivery time (Y) are the number of cases of product stocked (X1) and the distance walked by the route driver (X2). The engineer has...
Diet versus Regular Soft Drinks (take assumptions or random readings) Cans of soft drinks are so...
Diet versus Regular Soft Drinks (take assumptions or random readings) Cans of soft drinks are so common that many people have done much of this exploration without realizing it. You, too, have probably cooled soft drink cans in ice water for a picnic. Here is your opportunity to see if you can make some generalizations about their behavior in water.    Materials •     1 12-fl oz (355 mL) aluminum can of diet soft drink, unopened •     1 12-fl oz (355 mL) aluminum...
A soft drink bottling company just ran a long line of 12-ounce soft drink cans filled...
A soft drink bottling company just ran a long line of 12-ounce soft drink cans filled with cola. A sample of 32 cans is selected by inspectors looking for non-conforming items. Among the things the inspectors look for are paint defects on the can, improper seal, incorrect volume, leaking contents, incorrect mixture of carbonation and syrup in the soft drink, and out-of-spec syrup mixture. The results of this inspection are given here. Construct a c chart from the data. Can...
A soft drink manufacturer wishes to know how many soft drinks teenagers drink each week. They...
A soft drink manufacturer wishes to know how many soft drinks teenagers drink each week. They want to construct a 90% confidence interval with an error of no more than 0.07. A consultant has informed them that a previous study found the mean to be 5.6 soft drinks per week and found the standard deviation to be 1.4. What is the minimum sample size required to create the specified confidence interval? Round your answer up to the next integer.
A soft-drink manufacturer purchases aluminum cans from an outside vendor. A random sample of 70 cans...
A soft-drink manufacturer purchases aluminum cans from an outside vendor. A random sample of 70 cans is selected from a large shipment, and each is tested for strength by applying an increasing load to the side of the can until it punctures. Of the 70 cans, 59 meet the specification for puncture resistance. a) Find a 95% confidence interval for the proportion of cans in the shipment that meet the specification. Round the answers to three decimal places. b) Find...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT