U
Umesh
CoffeeVendor is a program, which simulate a coffee machine. The coffee
machine serves coffee with sugar and creamer for Rs.10/- and Rs.6/-
without sugar and creamer (black coffee). The coffee machine accepts
cash in value of Rs.1/-, Rs.2/- and Rs.5/- coins, as well as credit
cards and debit cards. Detailed specification is as follows:
(i) Functional Requirements:
a) Accept cash input in value of 1, 2 or 5 rupee coins.
b) Accept credit card (with credit limit).
c) Accept debit card (with PIN number and balance).
d) Serve coffee with sugar and creamer for Rs.10/-.
e) Serve black coffee without sugar and cream for Rs.6/-.
f) Put correct amount of money on credit card and debit card.
(ii) Output Requirements:
a) Display the total amount of money after inputting the cash.
b) Display error message when there is no enough money, over credit
limit, balance
below zero, insert invalid cash, or input invalid
command.
c) Display receipt after each transaction.
(iii) Constraints:
a) One cup of white coffee contains one unit of coffee powder, sugar
and creamer, while one cup of black coffee only contains one unit of
coffee powder and water. For the coffee machine, there is a limit
capacity of the coffee powder, sugar and creamer. If there isn't
enough coffee powder available, the coffee machine cannot serve the
black coffee. And if there is not enough coffee powder, sugar and
creamer, the coffee machine cannot serve the white coffee. When the
coffee machine cannot fulfill the user request, the money should be
refunded to users.
b) After each transaction, user should re-enter the credit card or
debit card to perform another transaction.
c) The limit capacity, the credit card and the debit card information
will be stored in three different files, and will be read in when the
program is launched. If the initial capacity cannot serve for at least
one cup of coffee, print out an error message, if the format of credit
card and debit card files is not correct, print out error messages.
Related files are:
· ingredient.dat - Coffee, Sugar and creamer limits
· debitCard.dat - Debit card number, PIN and Balance
· creditCard.dat - Credit card number, credit limit
(iv) Environment:
a) Character mode interface.
b) Develop using C programming language.
machine serves coffee with sugar and creamer for Rs.10/- and Rs.6/-
without sugar and creamer (black coffee). The coffee machine accepts
cash in value of Rs.1/-, Rs.2/- and Rs.5/- coins, as well as credit
cards and debit cards. Detailed specification is as follows:
(i) Functional Requirements:
a) Accept cash input in value of 1, 2 or 5 rupee coins.
b) Accept credit card (with credit limit).
c) Accept debit card (with PIN number and balance).
d) Serve coffee with sugar and creamer for Rs.10/-.
e) Serve black coffee without sugar and cream for Rs.6/-.
f) Put correct amount of money on credit card and debit card.
(ii) Output Requirements:
a) Display the total amount of money after inputting the cash.
b) Display error message when there is no enough money, over credit
limit, balance
below zero, insert invalid cash, or input invalid
command.
c) Display receipt after each transaction.
(iii) Constraints:
a) One cup of white coffee contains one unit of coffee powder, sugar
and creamer, while one cup of black coffee only contains one unit of
coffee powder and water. For the coffee machine, there is a limit
capacity of the coffee powder, sugar and creamer. If there isn't
enough coffee powder available, the coffee machine cannot serve the
black coffee. And if there is not enough coffee powder, sugar and
creamer, the coffee machine cannot serve the white coffee. When the
coffee machine cannot fulfill the user request, the money should be
refunded to users.
b) After each transaction, user should re-enter the credit card or
debit card to perform another transaction.
c) The limit capacity, the credit card and the debit card information
will be stored in three different files, and will be read in when the
program is launched. If the initial capacity cannot serve for at least
one cup of coffee, print out an error message, if the format of credit
card and debit card files is not correct, print out error messages.
Related files are:
· ingredient.dat - Coffee, Sugar and creamer limits
· debitCard.dat - Debit card number, PIN and Balance
· creditCard.dat - Credit card number, credit limit
(iv) Environment:
a) Character mode interface.
b) Develop using C programming language.