SlideShare a Scribd company logo
Both Learning Activities will be posted this week
Learning Activity #1-to be posted
Please read the following fact patterns and address all four of
the questions. Only discuss relevant issues! I am not as
interested in your outcome (who will end up winning) as I am in
how you use the law to support your points. Base your answer
only on facts given. If additional information is needed, tell me
that. Your answers should be about 200 words, in APA format
Peter, while trying to sell his house to Jasper, was asked if he
had ever seen or suspected termites in the house. Peter replied
that he had not, and that the house was sound. Several months
after Jasper had purchased the house, she learned from
neighbors that Peter had paid for soil treatment to eliminate
termites.
a. Can the contract for sale be canceled because of
fraud?
b. Was there a misstatement of a material fact?
c. Did Jasper suffer a loss as a result of Peter’s actions?
d. Can Jasper sue for damages?
Learning Activity #2 (select ONE of the following fact patterns)
Please read the following fact patterns and select ONE of the
four to answer. Only discuss relevant issues! I am not as
interested in your outcome (who will end up winning) as I am in
how you use the law to support your points. Base your answer
only on facts given. If additional information is needed, tell me
that. Your answers should be about 200 words, in APA format
1 On April 15, Don Construction contracted to build a house for
Jessup. The contract price was $55,000. The agreement
contained a provision stating that the builder would deduct
$1000 a day from the contract price for each day the house was
not completed after August 15. It was not completed until
September 15th. Don Construction refused to deduct $30,000
from the contract price. Jessup refused to sue. Don Construction
sued, claiming the $1000 a day was a penalty clause, not a
liquidated damages clause. Result? Discuss.
2 Able signs a contract to buy Baker’s house for $100,000 “if I
am able to obtain mortgage loan for $75,000, at 7% interest,
payable over twenty years.” Assume that Abel tries but is
unable to obtain the loan, and therefore refuses to proceed with
the purchase. Is Abel in breach of contract?
3 Jacks contracted to buy Helena’s Island. The contract required
the closing to be on May 16 at 10:00 AM at Community Title’s
office. It stated time was of the essence. Jacks was not there at
10:00 AM; at 10:20 AM Helena declared the contract breached
and since Helena planned to use the money from Jacks to close
on another property, she had to arrange alternative financing. At
10:30 AM Jacks appeared without the money. He did not tender
payment until 1:30 PM, and Helena refused to accept it. Jacks
sued for special performance, arguing closing sometime on the
16th would be adequate. Result?
4 Claire paid Nurse Midwifery Associates $750 for prenatal and
postnatal care, and to attend the birth of her son. Although
Claire received services on at least a dozen occasions, the
midwife was not present at the birth because of the birth came
too soon after the labor started. Claire sues for return of the
money paid. Did Midwifery substantially perform the contract?
CS1337.502,504 F16 Program #3 Page 1 of 14
Program #3
Due: Tuesday Oct 11th, 2015 at 11:30PM
Instructor Dr. Stephen Perkins
Office Location ECSS 4.702
Office Phone (972) 883-3891
Email Address [email protected]
Office Hours Tuesday and Thursday 10:30am – 11:30am
Tuesday and Thursday 1:00pm – 2:15pm
and by appointment
Grader Section 502: Sai Vamsi Muvva
[email protected]
Open Lab 2.103B1
Section 504: Gopichand Vanka
[email protected]
Open Lab 2.104A1
Tuesday/Thursday 3:00pm – 5:00pm
Purpose
Demonstrate the ability to implement and use structured data
types utilizing the facilities of the C
programming language.
Assignment
Write a program that simulates a soft drink machine. Your
program will consist of two sections.
One section will be the functions that make up the drink
machine. The second section will be the
functions that provide the user interface for the drink machine
and allow the user to purchase
drinks.
Section 1: The Drink Machine
This describes the operation of the first section of your
program. This is the processing that is
needed to simulate the Drink Machine.
There will be 1 or more drink types in the machine. Your
program will read the number of drink
types and the drink information from a file. You must then
dynamically create an array of
structures that will hold the drink information. You may
assume that there are no errors within
the input file.
CS1337.502,504 F16 Program #3 Page 2 of 14
The Drink Machine Input File Format
Here is a sample file that contains the information for one such
Drink Machine:
8
Cola 1.25 25
Root-beer 1.25 20
Lemon-lime 1.25 25
Water 1.00 40
Orange 1.25 5
Iced-tea 1.25 35
Grape 1.30 15
Iced-Coffee 2.00 35
The first item is an integer that describes how many drinks are
described in the input file.
Following that are the drink descriptions. The drink name is
first, the cost of the drink is second
and the number of drinks in the machine at start up is third.
Note that the drink names do not
include any spaces in the text.
You can use the C stream function fscanf() to read in the values
from the file.
Code
You will be creating your Drink Machine code as a C style
program. Your source will be in a file
called drinkmachine.c. The structure definitions and function
prototypes will be put into a
file called drinkmachine.h.
The program will need a couple of structures.
DrinkItem structure
One structure is for a DrinkItem and contains the following
information:
id The drink id (assigned by the program) of type int
name Drink name (type of drink – read in from a file)
price
Drink cost (the retail cost of one drink). This is the price
the customer will pay for one drink of this type. This is
also read in from a file. Type is double.
number of drinks
Number of drinks of this type in the machine. Initial
value is read in from a file. This is also updated by the
program as people purchase drinks. Type int. Give this a
good name.
Drinks purchased
Initially 0. Updated whenever a drink is purchased. Type
is int. Give this a good name.
CS1337.502,504 F16 Program #3 Page 3 of 14
DrinkMachine structure
The other structure, for the DrinkMachine, will contain the
following information:
An int that contains a version number. For this
assignment this will have a value of 1.
An int that contains the number of DrinkItem structures.
An array of Drink Items. Each element of the array will
be a DrinkItem structure. You will dynamically create
this array based on the contents of an input file you will
read in.
An int that contains the current location in the array of
DrinkItem structures. This is used internally by the drink
machine part of your code.
You will choose the names for the structure items.
Functions
Your code will need to implement the following functions:
Function: create()
The first function you need to write for your Drink Machine is
the create function.
This function takes no input parameters and returns back a
pointer to your
DrinkMachine structure.
First you need to dynamically create a DrinkMachine structure.
You will
return the address of this structure when you return from this
create function.
You need to set the version number in the DrinkMachine
structure to 1.
You also should create a global const int in your drinkmachine.c
file.
The name should be INVALID_INDEX and it should be given a
value of -1.
Initialize the current location value of the DrinkMachine
structure to
INVALID_INDEX.
Next you need to open up your input file. The input file is
"drink_machine.txt". If the file does not exist you need to
delete the
DrinkMachine structure and return a null pointer back to the
caller.
You need to read in the first number (8 in the example above)
and create your
DrinkMachine structure. You need to set the number of Drink
Items to the
number you just read in from the file (8 in the above example).
NOTE: Your
program must be able to handle any number of drinks. You
cannot assume 8.
You cannot assume any fixed number.
Next you need to create an array of DrinkItem structures. This
array must be
dynamically allocated using the number of Drink Items you read
in above (8 in
CS1337.502,504 F16 Program #3 Page 4 of 14
our example). Again, you must be able to support any number of
Drink Items.
You must use dynamic memory allocation. Do not rely on C99
style variable
length arrays.
You will need a loop that will execute once for every Drink
Item. Inside the loop
you will read in the information for a Drink Item, and put that
information into
your DrinkItem structure. You also need to set the drink id in
the
DrinkItem structure. It should have a value of 1 for the first
drink, a value of 2
for the 2nd drink, etc.
Make sure your create function closes the input file once it has
finished reading in the
Drink Item information.
You function returns the address of the DrinkMachine structure
to the calling
function.
Function: destroy()
The destroy function has one input parameter, a pointer to a
DrinkMachine
structure.
Your destroy function should delete the array of DrinkItem
structures you created.
Finally, it should delete the DrinkMachine structure.
You must ensure that you are freeing up all memory you
allocated in the create
function.
Stop and Test:
Note: After you have written the create and destroy functions
you could create a test
program to call create and then call destroy. Your test code
should be put into a file called
driver.c. You can use the debugger to see that the structures and
array of DrinkItem
structures is being created properly. You can also use the
debugger to make sure the destroy
function is deleting the array of DrinkItem structures, and
deleting the DrinkMachine
structure. By doing this you can make sure the Drink Machine
is being created and destroyed
properly before you start writing addition functions.
Make sure you test the case where create returns a null pointer.
The firstDrink and nextDrink functions:
You will be creating two functions, firstDrink and nextDrink.
They will be used to iterate
through all of the drinks in the DrinkMachine.
You could just get access to the array and directly access the
array elements from your driver
program (the second part of your code). But what would happen
if we decide to change how the
DrinkItem structures are stored? We could change the program
to use a vector. There are
other ways of storing the DrinkItem structures that would not
allow access via subscripts. We
may want to use these in future versions of the DrinkMachine.
To support these possible changes
CS1337.502,504 F16 Program #3 Page 5 of 14
in the future we are going to provide an interface in the Drink
Machine that will work even if we
change the way the DrinkItem structures are stored in some
future version of the program.
The firstDrink and nextDrink functions will provide this
interface.
Function: firstDrink()
The address of the DrinkMachine structure is passed to
firstDrink. The
firstDrink function returns back the address of a DrinkItem
structure (or null
pointer).
The firstDrink function needs to return back the address of the
first of the
DrinkItem structures in the array. If there are no array entries
firstDrink should
set the current location in the DrinkMachine structure to
INVALID_INDEX and return
back null pointer.
The current location in the DrinkMachine structure should be
set to 0, the index of the
first DrinkItem structure in the array. The current location is
updated by the
nextDrink function and is needed for it to work properly.
Function: nextDrink()
The address of the DrinkMachine structure is passed to
nextDrink. The
nextDrink function returns back the address of a DrinkItem
structure (or null
pointer).
The nextDrink function should get the next DrinkItem structure
in the array, if there
are any. The logic for nextDrink is as follows:
structure is
INVALID_INDEX the
function should return a nullptr to indicate that there are no
more valid entries in
the array. Note, this condition should only happen if nextDrink
is called after all
of the items in the array have been processed or if nextDrink is
called and no
firstDrink call has been made. This is a logic error in the
programming using the
firstDrink and nextDrink functions.
should be
incremented by 1. If it is less than the DrinkMachine structure’s
size value you
still have a valid entry left and your program should return back
the address of the
DrinkItem structure at the new current location.
vious
step, the current location
is now greater than or equal to the size in the DrinkMachine
structure then you
have a condition where there is no next DrinkItem structure in
the array. You
should set the current location in the DrinkMachine structure to
CS1337.502,504 F16 Program #3 Page 6 of 14
INVALID_INDEX and return a null pointer to indicate that
there are no more
valid entries in the array.
Stop and Test firstDrink() and nextDrink():
Update your main function you used for earlier testing and test
the new firstDrink and
nextDrink functions. You can use the following logic (pseudo
code):
Create DrinkItem structure pointer pDrink
For (pDrink = firstDrink(DrinkMachine structure); pDrink !=
nullptr; pDrink =
nextDrink(DrinkMachine structure)
// Your processing goes here
End For
Make sure in your tests that all of the entries are being
displayed properly. Also, try calling
nextDrink without calling firstDrink and try calling nextDrink
after the last entry has
been retrieved and make sure your error handling works.
The remaining Drink Machine functions:
The remaining functions you need are for the following:
unique drink items. This will be the
size of the array of DrinkItem structures in the DrinkMachine
structure.
machine.
Function: items()
The items function has one parameter, the pointer to the
DrinkMachine structure. It will
return an int, the number of DrinkItem structures in the Drink
Machine. For the current
implementation this is the size of the array.
For the next 3 functions you need the drink id which is part of
the DrinkItem structure.
Function: available()
The available function takes two input parameters. The first
parameter is a pointer to the
DrinkMachine structure. The second parameter is the drink id of
a DrinkItem structure.
The function checks to see if there if that drink is available (the
quantity is 1 or more). The
function returns back a bool. The value will be true if the drink
is available and false if it is
not available. The function will also return a false if the drink
id is invalid.
CS1337.502,504 F16 Program #3 Page 7 of 14
Function: cost()
The cost function takes two input parameters. The first
parameter is a pointer to the
DrinkMachine structure. The second parameter is the drink id of
a DrinkItem structure.
The function will return back a value of type double. This will
be the cost of that Drink Item.
The return value will be negative if the drink id is invalid.
Function: purchase()
The purchase function takes four parameters and returns an
enum class. The first
parameter is a pointer to the DrinkMachine structure. The
second parameter is the drink id of a
DrinkItem structure. The third parameter is the amount of
money the customer is using to
purchase the drink. This is of type double. The fourth parameter
needs to be passed by reference.
This will be the amount of change, if any, to be returned to the
customer. The fourth parameter is
of type double.
The return value is an enum class. The name of the enum class
should be Purchase with
the values PURCHASED, INVALID, NOT_AVAILABLE, and
INSUFFICIENT_FUNDS.
If the drink can be purchased the fourth parameter will contain
the amount of change (0.0 if there
isn’t any change) and the function will return back
Purchase::PURCHASED. The function
also needs to decrement the quantity of the DrinkItem structure
in the array. The function also
needs to increment the purchased count for this item.
If the drink ID is not valid the function will return
Purchase::INVALID.
If the drink id if valid but there aren’t any drinks of that type
left the function will return back
Purchase::NOT_AVAILABLE.
Finally, if the drink id is valid and there are drinks of that type
available, but the amount is
insufficient to purchase the drink the function will return back a
value of
Purchase::INSUFFICIENT_FUNDS. The value of the fourth
parameter will contain the cost
of the drink (the same value returned from the cost function).
Function: dumpDrinkMachine()
The dumpDrinkMachine function takes a pointer to a
DrinkMachine structure as the only
parameter and does not return a value.
The function displays the contents of the drinks in the drink
machine. The output should be
similar to the following:
Id Name Price Qty Sold
1 Cola 1.25 25 0
2 Root-beer 1.25 20 0
3 Lemon-lime 1.25 25 0
4 Water 1.00 40 0
5 Orange 1.25 5 0
CS1337.502,504 F16 Program #3 Page 8 of 14
6 Iced-tea 1.25 35 0
7 Grape 1.30 15 0
8 Iced-Coffee 2.00 35 0
Stop and Test the remaining functions:
Now that all of the functions needed for the Drink Machine
have been written you need to test
them. What should you test? You need to test the normal
conditions and you need to test any
error conditions.
Section 2: The Application
The second section of the code makes use of the drink machine
functions you have already
written. It should be created in a file named
drinkMachineDriver.c.
You must infer its operation by looking at the output below.
Here is sample output several runs
of the final application. Your program should create the same
output for the same input values.
Your interface will look just like the samples runs shown here
with the exception of the output
from the dumpDrinkMachine function.
User input is in bold.
For the first run the user enters quit right away and no
processing is performed.
Id Name Price Qty Sold
1 Cola 1.25 25 0
2 Root-beer 1.25 20 0
3 Lemon-lime 1.25 25 0
4 Water 1.00 40 0
5 Orange 1.25 5 0
6 Iced-tea 1.25 35 0
7 Grape 1.30 15 0
8 Iced-Coffee 2.00 35 0
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
0[Enter]
Id Name Price Qty Sold
1 Cola 1.25 25 0
2 Root-beer 1.25 20 0
3 Lemon-lime 1.25 25 0
CS1337.502,504 F16 Program #3 Page 9 of 14
4 Water 1.00 40 0
5 Orange 1.25 5 0
6 Iced-tea 1.25 35 0
7 Grape 1.30 15 0
8 Iced-Coffee 2.00 35 0
Thank you for using the drink machine.
Here is another run with invalid amounts entered by the
program’s user. We also see change from
one purchase and no change from another purchase:
Id Name Price Qty Sold
1 Cola 1.25 25 0
2 Root-beer 1.25 20 0
3 Lemon-lime 1.25 25 0
4 Water 1.00 40 0
5 Orange 1.25 5 0
6 Iced-tea 1.25 35 0
7 Grape 1.30 15 0
8 Iced-Coffee 2.00 35 0
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
1[Enter]
Enter the amount for the purchase (up to $2.00): 1[Enter]
The amount you entered is insufficient to purchase the drink.
The
price is 1.25
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
1[Enter]
Enter the amount for the purchase (up to $2.00): 2.01[Enter]
The amount entered is not valid.
Enter the amount for the purchase (up to $2.00): 1.3[Enter]
Your drink has been purchased. Your change is $ 0.05
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
CS1337.502,504 F16 Program #3 Page 10 of 14
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
5[Enter]
Enter the amount for the purchase (up to $2.00): 1.25[Enter]
Your drink has been purchased.
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
0[Enter]
Id Name Price Qty Sold
1 Cola 1.25 24 1
2 Root-beer 1.25 20 0
3 Lemon-lime 1.25 25 0
4 Water 1.00 40 0
5 Orange 1.25 4 1
6 Iced-tea 1.25 35 0
7 Grape 1.30 15 0
8 Iced-Coffee 2.00 35 0
Thank you for using the drink machine.
And still another run. Here we show invalid values entered for
the menu:
Id Name Price Qty Sold
1 Cola 1.25 25 0
2 Root-beer 1.25 20 0
3 Lemon-lime 1.25 25 0
4 Water 1.00 40 0
5 Orange 1.25 5 0
6 Iced-tea 1.25 35 0
7 Grape 1.30 15 0
8 Iced-Coffee 2.00 35 0
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
CS1337.502,504 F16 Program #3 Page 11 of 14
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
9[Enter]
The drink id is not valid.
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
-1[Enter]
The drink id is not valid.
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
5[Enter]
Enter the amount for the purchase (up to $2.00): 1.3[Enter]
Your drink has been purchased. Your change is $ 0.05
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
0[Enter]
Id Name Price Qty Sold
1 Cola 1.25 25 0
2 Root-beer 1.25 20 0
3 Lemon-lime 1.25 25 0
4 Water 1.00 40 0
5 Orange 1.25 4 1
6 Iced-tea 1.25 35 0
7 Grape 1.30 15 0
8 Iced-Coffee 2.00 35 0
Thank you for using the drink machine.
CS1337.502,504 F16 Program #3 Page 12 of 14
One final (long) run. In this one we run out of Orange. The
quantity for the Orange drink is 5. We
successfully purchase 5 drinks, but we cannot purchase a sixth
one:
Id Name Price Qty Sold
1 Cola 1.25 25 0
2 Root-beer 1.25 20 0
3 Lemon-lime 1.25 25 0
4 Water 1.00 40 0
5 Orange 1.25 5 0
6 Iced-tea 1.25 35 0
7 Grape 1.30 15 0
8 Iced-Coffee 2.00 35 0
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
5[Enter]
Enter the amount for the purchase (up to $2.00): 1.25[Enter]
Your drink has been purchased.
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
5[Enter]
Enter the amount for the purchase (up to $2.00): 1.25[Enter]
Your drink has been purchased.
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
5[Enter]
Enter the amount for the purchase (up to $2.00): 1.25[Enter]
Your drink has been purchased.
Enter a drink id for the drink you want to purchase or 0 to quit.
CS1337.502,504 F16 Program #3 Page 13 of 14
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
5[Enter]
Enter the amount for the purchase (up to $2.00): 2[Enter]
Your drink has been purchased. Your change is $ 0.75
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
5[Enter]
Enter the amount for the purchase (up to $2.00): 1.3[Enter]
Your drink has been purchased. Your change is $ 0.05
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
5[Enter]
Enter the amount for the purchase (up to $2.00): 2[Enter]
Sorry, we are out of your drink. Please select another drink
Enter a drink id for the drink you want to purchase or 0 to quit.
Drink id Drink Price
1 Cola $ 1.25
2 Root-beer $ 1.25
3 Lemon-lime $ 1.25
4 Water $ 1.00
5 Orange $ 1.25
6 Iced-tea $ 1.25
7 Grape $ 1.30
8 Iced-Coffee $ 2.00
0[Enter]
Id Name Price Qty Sold
1 Cola 1.25 25 0
2 Root-beer 1.25 20 0
CS1337.502,504 F16 Program #3 Page 14 of 14
3 Lemon-lime 1.25 25 0
4 Water 1.00 40 0
5 Orange 1.25 0 5
6 Iced-tea 1.25 35 0
7 Grape 1.30 15 0
8 Iced-Coffee 2.00 35 0
Thank you for using the drink machine.
Deliverables
gh ELearning.
and your input file all zipped up
into a single .zip file.
Notes
process as you would for a new C++
project. Just make sure you select a new C Project. It will
create a working HelloWorld for
you.

More Related Content

Similar to Both Learning Activities will be posted this weekLearning Activi.docx

Microsoft Microsoft Certifications 70-491 it examen dumps
Microsoft Microsoft Certifications 70-491 it examen dumpsMicrosoft Microsoft Certifications 70-491 it examen dumps
Microsoft Microsoft Certifications 70-491 it examen dumps
lilylucy
 
Girl Scouts Website Designer Badge Seminar - Workbook
Girl Scouts Website Designer Badge Seminar - WorkbookGirl Scouts Website Designer Badge Seminar - Workbook
Girl Scouts Website Designer Badge Seminar - Workbook
Lauren Hayward Schaefer
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
marwaeng
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source code
pradesigali1
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
Maxim Salnikov
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.ppt
LalRatan
 
ITECH2000 Mobile Development FundamentalsAssignment 1 App.docx
ITECH2000 Mobile Development FundamentalsAssignment 1 App.docxITECH2000 Mobile Development FundamentalsAssignment 1 App.docx
ITECH2000 Mobile Development FundamentalsAssignment 1 App.docx
donnajames55
 
All You Need To Know About LETTER WRITING
All You Need To Know About LETTER WRITINGAll You Need To Know About LETTER WRITING
All You Need To Know About LETTER WRITING
Heather Lee
 
Introduction
IntroductionIntroduction
Steps in building windows application
Steps in building windows applicationSteps in building windows application
Steps in building windows application
Glenda Finley
 
A c program of Phonebook application
A c program of Phonebook applicationA c program of Phonebook application
A c program of Phonebook application
svrohith 9
 
Week 2
Week 2Week 2
Week 2
EasyStudy3
 
Widget Self Assessment
Widget Self AssessmentWidget Self Assessment
Widget Self Assessment
Elizabeth Anderson
 
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docxBTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
AASTHA76
 
Project.pdf
Project.pdfProject.pdf
Project.pdf
ssuserbad56d
 
Williams College Essay Guide 2020-2021 College
Williams College Essay Guide 2020-2021  CollegeWilliams College Essay Guide 2020-2021  College
Williams College Essay Guide 2020-2021 College
Tracy Clark
 
Full screen Web Browser support RS-232 / TCPIP peripheral (plugin)
Full screen Web Browser support RS-232 / TCPIP peripheral (plugin)Full screen Web Browser support RS-232 / TCPIP peripheral (plugin)
Full screen Web Browser support RS-232 / TCPIP peripheral (plugin)
topomax
 
Patton Building Better Products Using.pdf
Patton Building Better Products Using.pdfPatton Building Better Products Using.pdf
Patton Building Better Products Using.pdf
Aung Ko Ko Thet
 
In java Owners and Computers Create a java program that wi.pdf
In java  Owners and Computers Create a java program that wi.pdfIn java  Owners and Computers Create a java program that wi.pdf
In java Owners and Computers Create a java program that wi.pdf
absgroup9793
 
Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7
helpido9
 

Similar to Both Learning Activities will be posted this weekLearning Activi.docx (20)

Microsoft Microsoft Certifications 70-491 it examen dumps
Microsoft Microsoft Certifications 70-491 it examen dumpsMicrosoft Microsoft Certifications 70-491 it examen dumps
Microsoft Microsoft Certifications 70-491 it examen dumps
 
Girl Scouts Website Designer Badge Seminar - Workbook
Girl Scouts Website Designer Badge Seminar - WorkbookGirl Scouts Website Designer Badge Seminar - Workbook
Girl Scouts Website Designer Badge Seminar - Workbook
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source code
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.ppt
 
ITECH2000 Mobile Development FundamentalsAssignment 1 App.docx
ITECH2000 Mobile Development FundamentalsAssignment 1 App.docxITECH2000 Mobile Development FundamentalsAssignment 1 App.docx
ITECH2000 Mobile Development FundamentalsAssignment 1 App.docx
 
All You Need To Know About LETTER WRITING
All You Need To Know About LETTER WRITINGAll You Need To Know About LETTER WRITING
All You Need To Know About LETTER WRITING
 
Introduction
IntroductionIntroduction
Introduction
 
Steps in building windows application
Steps in building windows applicationSteps in building windows application
Steps in building windows application
 
A c program of Phonebook application
A c program of Phonebook applicationA c program of Phonebook application
A c program of Phonebook application
 
Week 2
Week 2Week 2
Week 2
 
Widget Self Assessment
Widget Self AssessmentWidget Self Assessment
Widget Self Assessment
 
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docxBTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
 
Project.pdf
Project.pdfProject.pdf
Project.pdf
 
Williams College Essay Guide 2020-2021 College
Williams College Essay Guide 2020-2021  CollegeWilliams College Essay Guide 2020-2021  College
Williams College Essay Guide 2020-2021 College
 
Full screen Web Browser support RS-232 / TCPIP peripheral (plugin)
Full screen Web Browser support RS-232 / TCPIP peripheral (plugin)Full screen Web Browser support RS-232 / TCPIP peripheral (plugin)
Full screen Web Browser support RS-232 / TCPIP peripheral (plugin)
 
Patton Building Better Products Using.pdf
Patton Building Better Products Using.pdfPatton Building Better Products Using.pdf
Patton Building Better Products Using.pdf
 
In java Owners and Computers Create a java program that wi.pdf
In java  Owners and Computers Create a java program that wi.pdfIn java  Owners and Computers Create a java program that wi.pdf
In java Owners and Computers Create a java program that wi.pdf
 
Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7
 

More from AASTHA76

(APA 6th Edition Formatting and St.docx
(APA 6th Edition Formatting and St.docx(APA 6th Edition Formatting and St.docx
(APA 6th Edition Formatting and St.docx
AASTHA76
 
(a) Thrasymachus’ (the sophist’s) definition of Justice or Right o.docx
(a) Thrasymachus’ (the sophist’s) definition of Justice or Right o.docx(a) Thrasymachus’ (the sophist’s) definition of Justice or Right o.docx
(a) Thrasymachus’ (the sophist’s) definition of Justice or Right o.docx
AASTHA76
 
(Glossary of Telemedicine and eHealth)· Teleconsultation Cons.docx
(Glossary of Telemedicine and eHealth)· Teleconsultation Cons.docx(Glossary of Telemedicine and eHealth)· Teleconsultation Cons.docx
(Glossary of Telemedicine and eHealth)· Teleconsultation Cons.docx
AASTHA76
 
(Assmt 1; Week 3 paper) Using ecree Doing the paper and s.docx
(Assmt 1; Week 3 paper)  Using ecree        Doing the paper and s.docx(Assmt 1; Week 3 paper)  Using ecree        Doing the paper and s.docx
(Assmt 1; Week 3 paper) Using ecree Doing the paper and s.docx
AASTHA76
 
(Image retrieved at httpswww.google.comsearchhl=en&biw=122.docx
(Image retrieved at  httpswww.google.comsearchhl=en&biw=122.docx(Image retrieved at  httpswww.google.comsearchhl=en&biw=122.docx
(Image retrieved at httpswww.google.comsearchhl=en&biw=122.docx
AASTHA76
 
(Dis) Placing Culture and Cultural Space Chapter 4.docx
(Dis) Placing Culture and Cultural Space Chapter 4.docx(Dis) Placing Culture and Cultural Space Chapter 4.docx
(Dis) Placing Culture and Cultural Space Chapter 4.docx
AASTHA76
 
(1) Define the time value of money.  Do you believe that the ave.docx
(1) Define the time value of money.  Do you believe that the ave.docx(1) Define the time value of money.  Do you believe that the ave.docx
(1) Define the time value of money.  Do you believe that the ave.docx
AASTHA76
 
(chapter taken from Learning Power)From Social Class and t.docx
(chapter taken from Learning Power)From Social Class and t.docx(chapter taken from Learning Power)From Social Class and t.docx
(chapter taken from Learning Power)From Social Class and t.docx
AASTHA76
 
(Accessible at httpswww.hatchforgood.orgexplore102nonpro.docx
(Accessible at httpswww.hatchforgood.orgexplore102nonpro.docx(Accessible at httpswww.hatchforgood.orgexplore102nonpro.docx
(Accessible at httpswww.hatchforgood.orgexplore102nonpro.docx
AASTHA76
 
(a) The current ratio of a company is 61 and its acid-test ratio .docx
(a) The current ratio of a company is 61 and its acid-test ratio .docx(a) The current ratio of a company is 61 and its acid-test ratio .docx
(a) The current ratio of a company is 61 and its acid-test ratio .docx
AASTHA76
 
(1) How does quantum cryptography eliminate the problem of eaves.docx
(1) How does quantum cryptography eliminate the problem of eaves.docx(1) How does quantum cryptography eliminate the problem of eaves.docx
(1) How does quantum cryptography eliminate the problem of eaves.docx
AASTHA76
 
#transformation10EventTrendsfor 201910 Event.docx
#transformation10EventTrendsfor 201910 Event.docx#transformation10EventTrendsfor 201910 Event.docx
#transformation10EventTrendsfor 201910 Event.docx
AASTHA76
 
$10 now and $10 when complete Use resources from the required .docx
$10 now and $10 when complete Use resources from the required .docx$10 now and $10 when complete Use resources from the required .docx
$10 now and $10 when complete Use resources from the required .docx
AASTHA76
 
#MicroXplorer Configuration settings - do not modifyFile.Versio.docx
#MicroXplorer Configuration settings - do not modifyFile.Versio.docx#MicroXplorer Configuration settings - do not modifyFile.Versio.docx
#MicroXplorer Configuration settings - do not modifyFile.Versio.docx
AASTHA76
 
#include string.h#include stdlib.h#include systypes.h.docx
#include string.h#include stdlib.h#include systypes.h.docx#include string.h#include stdlib.h#include systypes.h.docx
#include string.h#include stdlib.h#include systypes.h.docx
AASTHA76
 
$ stated in thousands)Net Assets, Controlling Interest.docx
$ stated in thousands)Net Assets, Controlling Interest.docx$ stated in thousands)Net Assets, Controlling Interest.docx
$ stated in thousands)Net Assets, Controlling Interest.docx
AASTHA76
 
#include stdio.h#include stdlib.h#include pthread.h#in.docx
#include stdio.h#include stdlib.h#include pthread.h#in.docx#include stdio.h#include stdlib.h#include pthread.h#in.docx
#include stdio.h#include stdlib.h#include pthread.h#in.docx
AASTHA76
 
#include customer.h#include heap.h#include iostream.docx
#include customer.h#include heap.h#include iostream.docx#include customer.h#include heap.h#include iostream.docx
#include customer.h#include heap.h#include iostream.docx
AASTHA76
 
#Assessment BriefDiploma of Business Eco.docx
#Assessment BriefDiploma of Business Eco.docx#Assessment BriefDiploma of Business Eco.docx
#Assessment BriefDiploma of Business Eco.docx
AASTHA76
 
#include stdio.h#include stdint.h#include stdbool.h.docx
#include stdio.h#include stdint.h#include stdbool.h.docx#include stdio.h#include stdint.h#include stdbool.h.docx
#include stdio.h#include stdint.h#include stdbool.h.docx
AASTHA76
 

More from AASTHA76 (20)

(APA 6th Edition Formatting and St.docx
(APA 6th Edition Formatting and St.docx(APA 6th Edition Formatting and St.docx
(APA 6th Edition Formatting and St.docx
 
(a) Thrasymachus’ (the sophist’s) definition of Justice or Right o.docx
(a) Thrasymachus’ (the sophist’s) definition of Justice or Right o.docx(a) Thrasymachus’ (the sophist’s) definition of Justice or Right o.docx
(a) Thrasymachus’ (the sophist’s) definition of Justice or Right o.docx
 
(Glossary of Telemedicine and eHealth)· Teleconsultation Cons.docx
(Glossary of Telemedicine and eHealth)· Teleconsultation Cons.docx(Glossary of Telemedicine and eHealth)· Teleconsultation Cons.docx
(Glossary of Telemedicine and eHealth)· Teleconsultation Cons.docx
 
(Assmt 1; Week 3 paper) Using ecree Doing the paper and s.docx
(Assmt 1; Week 3 paper)  Using ecree        Doing the paper and s.docx(Assmt 1; Week 3 paper)  Using ecree        Doing the paper and s.docx
(Assmt 1; Week 3 paper) Using ecree Doing the paper and s.docx
 
(Image retrieved at httpswww.google.comsearchhl=en&biw=122.docx
(Image retrieved at  httpswww.google.comsearchhl=en&biw=122.docx(Image retrieved at  httpswww.google.comsearchhl=en&biw=122.docx
(Image retrieved at httpswww.google.comsearchhl=en&biw=122.docx
 
(Dis) Placing Culture and Cultural Space Chapter 4.docx
(Dis) Placing Culture and Cultural Space Chapter 4.docx(Dis) Placing Culture and Cultural Space Chapter 4.docx
(Dis) Placing Culture and Cultural Space Chapter 4.docx
 
(1) Define the time value of money.  Do you believe that the ave.docx
(1) Define the time value of money.  Do you believe that the ave.docx(1) Define the time value of money.  Do you believe that the ave.docx
(1) Define the time value of money.  Do you believe that the ave.docx
 
(chapter taken from Learning Power)From Social Class and t.docx
(chapter taken from Learning Power)From Social Class and t.docx(chapter taken from Learning Power)From Social Class and t.docx
(chapter taken from Learning Power)From Social Class and t.docx
 
(Accessible at httpswww.hatchforgood.orgexplore102nonpro.docx
(Accessible at httpswww.hatchforgood.orgexplore102nonpro.docx(Accessible at httpswww.hatchforgood.orgexplore102nonpro.docx
(Accessible at httpswww.hatchforgood.orgexplore102nonpro.docx
 
(a) The current ratio of a company is 61 and its acid-test ratio .docx
(a) The current ratio of a company is 61 and its acid-test ratio .docx(a) The current ratio of a company is 61 and its acid-test ratio .docx
(a) The current ratio of a company is 61 and its acid-test ratio .docx
 
(1) How does quantum cryptography eliminate the problem of eaves.docx
(1) How does quantum cryptography eliminate the problem of eaves.docx(1) How does quantum cryptography eliminate the problem of eaves.docx
(1) How does quantum cryptography eliminate the problem of eaves.docx
 
#transformation10EventTrendsfor 201910 Event.docx
#transformation10EventTrendsfor 201910 Event.docx#transformation10EventTrendsfor 201910 Event.docx
#transformation10EventTrendsfor 201910 Event.docx
 
$10 now and $10 when complete Use resources from the required .docx
$10 now and $10 when complete Use resources from the required .docx$10 now and $10 when complete Use resources from the required .docx
$10 now and $10 when complete Use resources from the required .docx
 
#MicroXplorer Configuration settings - do not modifyFile.Versio.docx
#MicroXplorer Configuration settings - do not modifyFile.Versio.docx#MicroXplorer Configuration settings - do not modifyFile.Versio.docx
#MicroXplorer Configuration settings - do not modifyFile.Versio.docx
 
#include string.h#include stdlib.h#include systypes.h.docx
#include string.h#include stdlib.h#include systypes.h.docx#include string.h#include stdlib.h#include systypes.h.docx
#include string.h#include stdlib.h#include systypes.h.docx
 
$ stated in thousands)Net Assets, Controlling Interest.docx
$ stated in thousands)Net Assets, Controlling Interest.docx$ stated in thousands)Net Assets, Controlling Interest.docx
$ stated in thousands)Net Assets, Controlling Interest.docx
 
#include stdio.h#include stdlib.h#include pthread.h#in.docx
#include stdio.h#include stdlib.h#include pthread.h#in.docx#include stdio.h#include stdlib.h#include pthread.h#in.docx
#include stdio.h#include stdlib.h#include pthread.h#in.docx
 
#include customer.h#include heap.h#include iostream.docx
#include customer.h#include heap.h#include iostream.docx#include customer.h#include heap.h#include iostream.docx
#include customer.h#include heap.h#include iostream.docx
 
#Assessment BriefDiploma of Business Eco.docx
#Assessment BriefDiploma of Business Eco.docx#Assessment BriefDiploma of Business Eco.docx
#Assessment BriefDiploma of Business Eco.docx
 
#include stdio.h#include stdint.h#include stdbool.h.docx
#include stdio.h#include stdint.h#include stdbool.h.docx#include stdio.h#include stdint.h#include stdbool.h.docx
#include stdio.h#include stdint.h#include stdbool.h.docx
 

Recently uploaded

Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 

Both Learning Activities will be posted this weekLearning Activi.docx

  • 1. Both Learning Activities will be posted this week Learning Activity #1-to be posted Please read the following fact patterns and address all four of the questions. Only discuss relevant issues! I am not as interested in your outcome (who will end up winning) as I am in how you use the law to support your points. Base your answer only on facts given. If additional information is needed, tell me that. Your answers should be about 200 words, in APA format Peter, while trying to sell his house to Jasper, was asked if he had ever seen or suspected termites in the house. Peter replied that he had not, and that the house was sound. Several months after Jasper had purchased the house, she learned from neighbors that Peter had paid for soil treatment to eliminate termites. a. Can the contract for sale be canceled because of fraud? b. Was there a misstatement of a material fact? c. Did Jasper suffer a loss as a result of Peter’s actions? d. Can Jasper sue for damages? Learning Activity #2 (select ONE of the following fact patterns) Please read the following fact patterns and select ONE of the four to answer. Only discuss relevant issues! I am not as interested in your outcome (who will end up winning) as I am in how you use the law to support your points. Base your answer only on facts given. If additional information is needed, tell me that. Your answers should be about 200 words, in APA format 1 On April 15, Don Construction contracted to build a house for Jessup. The contract price was $55,000. The agreement contained a provision stating that the builder would deduct $1000 a day from the contract price for each day the house was
  • 2. not completed after August 15. It was not completed until September 15th. Don Construction refused to deduct $30,000 from the contract price. Jessup refused to sue. Don Construction sued, claiming the $1000 a day was a penalty clause, not a liquidated damages clause. Result? Discuss. 2 Able signs a contract to buy Baker’s house for $100,000 “if I am able to obtain mortgage loan for $75,000, at 7% interest, payable over twenty years.” Assume that Abel tries but is unable to obtain the loan, and therefore refuses to proceed with the purchase. Is Abel in breach of contract? 3 Jacks contracted to buy Helena’s Island. The contract required the closing to be on May 16 at 10:00 AM at Community Title’s office. It stated time was of the essence. Jacks was not there at 10:00 AM; at 10:20 AM Helena declared the contract breached and since Helena planned to use the money from Jacks to close on another property, she had to arrange alternative financing. At 10:30 AM Jacks appeared without the money. He did not tender payment until 1:30 PM, and Helena refused to accept it. Jacks sued for special performance, arguing closing sometime on the 16th would be adequate. Result? 4 Claire paid Nurse Midwifery Associates $750 for prenatal and postnatal care, and to attend the birth of her son. Although Claire received services on at least a dozen occasions, the midwife was not present at the birth because of the birth came too soon after the labor started. Claire sues for return of the money paid. Did Midwifery substantially perform the contract?
  • 3. CS1337.502,504 F16 Program #3 Page 1 of 14 Program #3 Due: Tuesday Oct 11th, 2015 at 11:30PM Instructor Dr. Stephen Perkins Office Location ECSS 4.702 Office Phone (972) 883-3891 Email Address [email protected] Office Hours Tuesday and Thursday 10:30am – 11:30am Tuesday and Thursday 1:00pm – 2:15pm and by appointment Grader Section 502: Sai Vamsi Muvva [email protected] Open Lab 2.103B1 Section 504: Gopichand Vanka [email protected] Open Lab 2.104A1 Tuesday/Thursday 3:00pm – 5:00pm Purpose Demonstrate the ability to implement and use structured data
  • 4. types utilizing the facilities of the C programming language. Assignment Write a program that simulates a soft drink machine. Your program will consist of two sections. One section will be the functions that make up the drink machine. The second section will be the functions that provide the user interface for the drink machine and allow the user to purchase drinks. Section 1: The Drink Machine This describes the operation of the first section of your program. This is the processing that is needed to simulate the Drink Machine. There will be 1 or more drink types in the machine. Your program will read the number of drink types and the drink information from a file. You must then dynamically create an array of structures that will hold the drink information. You may assume that there are no errors within the input file.
  • 5. CS1337.502,504 F16 Program #3 Page 2 of 14 The Drink Machine Input File Format Here is a sample file that contains the information for one such Drink Machine: 8 Cola 1.25 25 Root-beer 1.25 20 Lemon-lime 1.25 25 Water 1.00 40 Orange 1.25 5 Iced-tea 1.25 35 Grape 1.30 15 Iced-Coffee 2.00 35 The first item is an integer that describes how many drinks are described in the input file. Following that are the drink descriptions. The drink name is first, the cost of the drink is second and the number of drinks in the machine at start up is third. Note that the drink names do not include any spaces in the text. You can use the C stream function fscanf() to read in the values from the file.
  • 6. Code You will be creating your Drink Machine code as a C style program. Your source will be in a file called drinkmachine.c. The structure definitions and function prototypes will be put into a file called drinkmachine.h. The program will need a couple of structures. DrinkItem structure One structure is for a DrinkItem and contains the following information: id The drink id (assigned by the program) of type int name Drink name (type of drink – read in from a file) price Drink cost (the retail cost of one drink). This is the price the customer will pay for one drink of this type. This is also read in from a file. Type is double. number of drinks Number of drinks of this type in the machine. Initial value is read in from a file. This is also updated by the program as people purchase drinks. Type int. Give this a good name. Drinks purchased Initially 0. Updated whenever a drink is purchased. Type is int. Give this a good name.
  • 7. CS1337.502,504 F16 Program #3 Page 3 of 14 DrinkMachine structure The other structure, for the DrinkMachine, will contain the following information: An int that contains a version number. For this assignment this will have a value of 1. An int that contains the number of DrinkItem structures. An array of Drink Items. Each element of the array will be a DrinkItem structure. You will dynamically create this array based on the contents of an input file you will read in. An int that contains the current location in the array of DrinkItem structures. This is used internally by the drink machine part of your code.
  • 8. You will choose the names for the structure items. Functions Your code will need to implement the following functions: Function: create() The first function you need to write for your Drink Machine is the create function. This function takes no input parameters and returns back a pointer to your DrinkMachine structure. First you need to dynamically create a DrinkMachine structure. You will return the address of this structure when you return from this create function. You need to set the version number in the DrinkMachine structure to 1. You also should create a global const int in your drinkmachine.c file. The name should be INVALID_INDEX and it should be given a value of -1. Initialize the current location value of the DrinkMachine structure to INVALID_INDEX. Next you need to open up your input file. The input file is
  • 9. "drink_machine.txt". If the file does not exist you need to delete the DrinkMachine structure and return a null pointer back to the caller. You need to read in the first number (8 in the example above) and create your DrinkMachine structure. You need to set the number of Drink Items to the number you just read in from the file (8 in the above example). NOTE: Your program must be able to handle any number of drinks. You cannot assume 8. You cannot assume any fixed number. Next you need to create an array of DrinkItem structures. This array must be dynamically allocated using the number of Drink Items you read in above (8 in CS1337.502,504 F16 Program #3 Page 4 of 14 our example). Again, you must be able to support any number of Drink Items. You must use dynamic memory allocation. Do not rely on C99 style variable length arrays. You will need a loop that will execute once for every Drink Item. Inside the loop you will read in the information for a Drink Item, and put that
  • 10. information into your DrinkItem structure. You also need to set the drink id in the DrinkItem structure. It should have a value of 1 for the first drink, a value of 2 for the 2nd drink, etc. Make sure your create function closes the input file once it has finished reading in the Drink Item information. You function returns the address of the DrinkMachine structure to the calling function. Function: destroy() The destroy function has one input parameter, a pointer to a DrinkMachine structure. Your destroy function should delete the array of DrinkItem structures you created. Finally, it should delete the DrinkMachine structure. You must ensure that you are freeing up all memory you allocated in the create function. Stop and Test:
  • 11. Note: After you have written the create and destroy functions you could create a test program to call create and then call destroy. Your test code should be put into a file called driver.c. You can use the debugger to see that the structures and array of DrinkItem structures is being created properly. You can also use the debugger to make sure the destroy function is deleting the array of DrinkItem structures, and deleting the DrinkMachine structure. By doing this you can make sure the Drink Machine is being created and destroyed properly before you start writing addition functions. Make sure you test the case where create returns a null pointer. The firstDrink and nextDrink functions: You will be creating two functions, firstDrink and nextDrink. They will be used to iterate through all of the drinks in the DrinkMachine. You could just get access to the array and directly access the array elements from your driver program (the second part of your code). But what would happen if we decide to change how the DrinkItem structures are stored? We could change the program to use a vector. There are other ways of storing the DrinkItem structures that would not allow access via subscripts. We may want to use these in future versions of the DrinkMachine. To support these possible changes
  • 12. CS1337.502,504 F16 Program #3 Page 5 of 14 in the future we are going to provide an interface in the Drink Machine that will work even if we change the way the DrinkItem structures are stored in some future version of the program. The firstDrink and nextDrink functions will provide this interface. Function: firstDrink() The address of the DrinkMachine structure is passed to firstDrink. The firstDrink function returns back the address of a DrinkItem structure (or null pointer). The firstDrink function needs to return back the address of the first of the DrinkItem structures in the array. If there are no array entries firstDrink should set the current location in the DrinkMachine structure to INVALID_INDEX and return back null pointer. The current location in the DrinkMachine structure should be set to 0, the index of the
  • 13. first DrinkItem structure in the array. The current location is updated by the nextDrink function and is needed for it to work properly. Function: nextDrink() The address of the DrinkMachine structure is passed to nextDrink. The nextDrink function returns back the address of a DrinkItem structure (or null pointer). The nextDrink function should get the next DrinkItem structure in the array, if there are any. The logic for nextDrink is as follows: structure is INVALID_INDEX the function should return a nullptr to indicate that there are no more valid entries in the array. Note, this condition should only happen if nextDrink is called after all of the items in the array have been processed or if nextDrink is called and no firstDrink call has been made. This is a logic error in the programming using the firstDrink and nextDrink functions.
  • 14. should be incremented by 1. If it is less than the DrinkMachine structure’s size value you still have a valid entry left and your program should return back the address of the DrinkItem structure at the new current location. vious step, the current location is now greater than or equal to the size in the DrinkMachine structure then you have a condition where there is no next DrinkItem structure in the array. You should set the current location in the DrinkMachine structure to CS1337.502,504 F16 Program #3 Page 6 of 14 INVALID_INDEX and return a null pointer to indicate that there are no more valid entries in the array. Stop and Test firstDrink() and nextDrink(): Update your main function you used for earlier testing and test the new firstDrink and
  • 15. nextDrink functions. You can use the following logic (pseudo code): Create DrinkItem structure pointer pDrink For (pDrink = firstDrink(DrinkMachine structure); pDrink != nullptr; pDrink = nextDrink(DrinkMachine structure) // Your processing goes here End For Make sure in your tests that all of the entries are being displayed properly. Also, try calling nextDrink without calling firstDrink and try calling nextDrink after the last entry has been retrieved and make sure your error handling works. The remaining Drink Machine functions: The remaining functions you need are for the following: unique drink items. This will be the size of the array of DrinkItem structures in the DrinkMachine structure.
  • 16. machine. Function: items() The items function has one parameter, the pointer to the DrinkMachine structure. It will return an int, the number of DrinkItem structures in the Drink Machine. For the current implementation this is the size of the array. For the next 3 functions you need the drink id which is part of the DrinkItem structure. Function: available() The available function takes two input parameters. The first parameter is a pointer to the DrinkMachine structure. The second parameter is the drink id of a DrinkItem structure. The function checks to see if there if that drink is available (the quantity is 1 or more). The function returns back a bool. The value will be true if the drink is available and false if it is not available. The function will also return a false if the drink id is invalid. CS1337.502,504 F16 Program #3 Page 7 of 14
  • 17. Function: cost() The cost function takes two input parameters. The first parameter is a pointer to the DrinkMachine structure. The second parameter is the drink id of a DrinkItem structure. The function will return back a value of type double. This will be the cost of that Drink Item. The return value will be negative if the drink id is invalid. Function: purchase() The purchase function takes four parameters and returns an enum class. The first parameter is a pointer to the DrinkMachine structure. The second parameter is the drink id of a DrinkItem structure. The third parameter is the amount of money the customer is using to purchase the drink. This is of type double. The fourth parameter needs to be passed by reference. This will be the amount of change, if any, to be returned to the customer. The fourth parameter is of type double. The return value is an enum class. The name of the enum class should be Purchase with the values PURCHASED, INVALID, NOT_AVAILABLE, and INSUFFICIENT_FUNDS. If the drink can be purchased the fourth parameter will contain the amount of change (0.0 if there isn’t any change) and the function will return back
  • 18. Purchase::PURCHASED. The function also needs to decrement the quantity of the DrinkItem structure in the array. The function also needs to increment the purchased count for this item. If the drink ID is not valid the function will return Purchase::INVALID. If the drink id if valid but there aren’t any drinks of that type left the function will return back Purchase::NOT_AVAILABLE. Finally, if the drink id is valid and there are drinks of that type available, but the amount is insufficient to purchase the drink the function will return back a value of Purchase::INSUFFICIENT_FUNDS. The value of the fourth parameter will contain the cost of the drink (the same value returned from the cost function). Function: dumpDrinkMachine() The dumpDrinkMachine function takes a pointer to a DrinkMachine structure as the only parameter and does not return a value. The function displays the contents of the drinks in the drink machine. The output should be similar to the following: Id Name Price Qty Sold 1 Cola 1.25 25 0 2 Root-beer 1.25 20 0 3 Lemon-lime 1.25 25 0
  • 19. 4 Water 1.00 40 0 5 Orange 1.25 5 0 CS1337.502,504 F16 Program #3 Page 8 of 14 6 Iced-tea 1.25 35 0 7 Grape 1.30 15 0 8 Iced-Coffee 2.00 35 0 Stop and Test the remaining functions: Now that all of the functions needed for the Drink Machine have been written you need to test them. What should you test? You need to test the normal conditions and you need to test any error conditions. Section 2: The Application The second section of the code makes use of the drink machine functions you have already written. It should be created in a file named drinkMachineDriver.c. You must infer its operation by looking at the output below. Here is sample output several runs of the final application. Your program should create the same output for the same input values. Your interface will look just like the samples runs shown here
  • 20. with the exception of the output from the dumpDrinkMachine function. User input is in bold. For the first run the user enters quit right away and no processing is performed. Id Name Price Qty Sold 1 Cola 1.25 25 0 2 Root-beer 1.25 20 0 3 Lemon-lime 1.25 25 0 4 Water 1.00 40 0 5 Orange 1.25 5 0 6 Iced-tea 1.25 35 0 7 Grape 1.30 15 0 8 Iced-Coffee 2.00 35 0 Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 0[Enter] Id Name Price Qty Sold 1 Cola 1.25 25 0 2 Root-beer 1.25 20 0 3 Lemon-lime 1.25 25 0
  • 21. CS1337.502,504 F16 Program #3 Page 9 of 14 4 Water 1.00 40 0 5 Orange 1.25 5 0 6 Iced-tea 1.25 35 0 7 Grape 1.30 15 0 8 Iced-Coffee 2.00 35 0 Thank you for using the drink machine. Here is another run with invalid amounts entered by the program’s user. We also see change from one purchase and no change from another purchase: Id Name Price Qty Sold 1 Cola 1.25 25 0 2 Root-beer 1.25 20 0 3 Lemon-lime 1.25 25 0 4 Water 1.00 40 0 5 Orange 1.25 5 0 6 Iced-tea 1.25 35 0 7 Grape 1.30 15 0 8 Iced-Coffee 2.00 35 0 Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00
  • 22. 1[Enter] Enter the amount for the purchase (up to $2.00): 1[Enter] The amount you entered is insufficient to purchase the drink. The price is 1.25 Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 1[Enter] Enter the amount for the purchase (up to $2.00): 2.01[Enter] The amount entered is not valid. Enter the amount for the purchase (up to $2.00): 1.3[Enter] Your drink has been purchased. Your change is $ 0.05 Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 CS1337.502,504 F16 Program #3 Page 10 of 14 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25
  • 23. 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 5[Enter] Enter the amount for the purchase (up to $2.00): 1.25[Enter] Your drink has been purchased. Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 0[Enter] Id Name Price Qty Sold 1 Cola 1.25 24 1 2 Root-beer 1.25 20 0 3 Lemon-lime 1.25 25 0 4 Water 1.00 40 0 5 Orange 1.25 4 1 6 Iced-tea 1.25 35 0 7 Grape 1.30 15 0 8 Iced-Coffee 2.00 35 0 Thank you for using the drink machine. And still another run. Here we show invalid values entered for the menu: Id Name Price Qty Sold 1 Cola 1.25 25 0 2 Root-beer 1.25 20 0 3 Lemon-lime 1.25 25 0 4 Water 1.00 40 0
  • 24. 5 Orange 1.25 5 0 6 Iced-tea 1.25 35 0 7 Grape 1.30 15 0 8 Iced-Coffee 2.00 35 0 Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 CS1337.502,504 F16 Program #3 Page 11 of 14 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 9[Enter] The drink id is not valid. Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 -1[Enter] The drink id is not valid.
  • 25. Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 5[Enter] Enter the amount for the purchase (up to $2.00): 1.3[Enter] Your drink has been purchased. Your change is $ 0.05 Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 0[Enter] Id Name Price Qty Sold 1 Cola 1.25 25 0 2 Root-beer 1.25 20 0 3 Lemon-lime 1.25 25 0 4 Water 1.00 40 0 5 Orange 1.25 4 1 6 Iced-tea 1.25 35 0 7 Grape 1.30 15 0 8 Iced-Coffee 2.00 35 0 Thank you for using the drink machine.
  • 26. CS1337.502,504 F16 Program #3 Page 12 of 14 One final (long) run. In this one we run out of Orange. The quantity for the Orange drink is 5. We successfully purchase 5 drinks, but we cannot purchase a sixth one: Id Name Price Qty Sold 1 Cola 1.25 25 0 2 Root-beer 1.25 20 0 3 Lemon-lime 1.25 25 0 4 Water 1.00 40 0 5 Orange 1.25 5 0 6 Iced-tea 1.25 35 0 7 Grape 1.30 15 0 8 Iced-Coffee 2.00 35 0 Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 5[Enter] Enter the amount for the purchase (up to $2.00): 1.25[Enter] Your drink has been purchased. Enter a drink id for the drink you want to purchase or 0 to quit.
  • 27. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 5[Enter] Enter the amount for the purchase (up to $2.00): 1.25[Enter] Your drink has been purchased. Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 5[Enter] Enter the amount for the purchase (up to $2.00): 1.25[Enter] Your drink has been purchased. Enter a drink id for the drink you want to purchase or 0 to quit. CS1337.502,504 F16 Program #3 Page 13 of 14 Drink id Drink Price 1 Cola $ 1.25
  • 28. 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 5[Enter] Enter the amount for the purchase (up to $2.00): 2[Enter] Your drink has been purchased. Your change is $ 0.75 Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 5[Enter] Enter the amount for the purchase (up to $2.00): 1.3[Enter] Your drink has been purchased. Your change is $ 0.05 Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 5[Enter] Enter the amount for the purchase (up to $2.00): 2[Enter] Sorry, we are out of your drink. Please select another drink
  • 29. Enter a drink id for the drink you want to purchase or 0 to quit. Drink id Drink Price 1 Cola $ 1.25 2 Root-beer $ 1.25 3 Lemon-lime $ 1.25 4 Water $ 1.00 5 Orange $ 1.25 6 Iced-tea $ 1.25 7 Grape $ 1.30 8 Iced-Coffee $ 2.00 0[Enter] Id Name Price Qty Sold 1 Cola 1.25 25 0 2 Root-beer 1.25 20 0 CS1337.502,504 F16 Program #3 Page 14 of 14 3 Lemon-lime 1.25 25 0 4 Water 1.00 40 0 5 Orange 1.25 0 5 6 Iced-tea 1.25 35 0 7 Grape 1.30 15 0 8 Iced-Coffee 2.00 35 0 Thank you for using the drink machine. Deliverables
  • 30. gh ELearning. and your input file all zipped up into a single .zip file. Notes process as you would for a new C++ project. Just make sure you select a new C Project. It will create a working HelloWorld for you.