473,654 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

URGENT

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.

May 11 '07 #1
14 2414
Umesh wrote On 05/11/07 11:56,:
CoffeeVendor is a program, which simulate a coffee machine.
[...]
That's nice. Can I get a simulated buzz from it?

--
Er*********@acm-dot-org.invalid
May 11 '07 #2
>>>>"U" == Umesh <fr************ ****@gmail.comw rites:

UCoffeeVendor is a program, which simulate a coffee machine.

You neglected to indicate how much you were paying and your
instructor's email address.

Charlton

--
Charlton Wilbur
cw*****@chromat ico.net
May 11 '07 #3
Charlton Wilbur skrev:
>>>>>"U" == Umesh <fr************ ****@gmail.comw rites:

UCoffeeVendor is a program, which simulate a coffee machine.

You neglected to indicate how much you were paying
Just by careful or you may get paid in simulation

and your
instructor's email address.

Charlton
May 11 '07 #4
In article <11************ **********@y5g2 000hsa.googlegr oups.com>,
Umesh <fr************ ****@gmail.comw rote:
>CoffeeVendor is a program, which simulate a coffee machine.
You did not ask a question. If the question is "Can this be
written in standard C", the answer is "Yes on hosted systems
that permit files with the given names, provided that the
'character mode interface' required is just plain-text output
without (for example) absolute location positioning to simulate
the machine operation."

>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) Display error message when there is no enough money, over credit
limit, balance below zero, insert invalid cash, or input invalid
command.
Your requirements do not specify what is to happen if the user
puts in more money than the value of their transaction. There
was no requirement specified for making change, no discussion
of what should happen if the correct change could not be made,
and no file specifying the initial distribution of coins in
the machine available for making change. At the same time, the
specifications do not permit an error message for the case
of too *much* money. ("insert invalid cash" is not the same
as "exact change required".)
--
Okay, buzzwords only. Two syllables, tops. -- Laurie Anderson
May 11 '07 #5
Umesh wrote:
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:
You're already too late!

Course Code : MCSL-017
Course Title : C and Assembly Language Programming
Assignment Number : MCA(1)/017/Assign/07
Maximum Marks : 100
Weightage : 25%
Last date of Submission : 30th April, 2007

Or did your instructor borrow the assignment from the internet?
May 11 '07 #6
Umesh <fr************ ****@gmail.comw rites:
CoffeeVendor is a program, which simulate a coffee machine.
[...]
b) Develop using C programming language.
Observation: You need a C program that satisfies the stated
requirements.

Observation: The rest of us do not need such a program.

Question: Logically, then, who should do the work of implementing it?

Hint: The correct answer begins with "U" and ends with "mesh".

Summary: Do your own damned homework. Or fail. It's up to you.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
May 11 '07 #7
"Umesh" writes:

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.

I can believe that the spec is not complete as someone has pointed out, but
the general outline seems reasonable to me. I would guess that your main
problem is fear. You are going to get off to a bad start or something.
Welcome to the club! That's what it's all about, making mistakes. As time
goes by you will be making new mistakes, which may be some small comfort.
Coffee machines are very rigid devices, there are two parts of the
transaction "give me the money" and "what do you want?" in that order.
Perhaps two menus might make sense, because, properly, "do you want cream"
should be grayed out until the money part of the deal is finished. And
graying out is not a readily available feature of a character mode C
interface. (To be strict, C doesn't *have* a character mode interface, it
is a *line* mode, you have to push Enter before anything happens.) Keep
that in mind, as you write your menu. C does not natively produce programs
that are end-user friendly.

Try to find the easiest (least scary) path through the problem. How about
giving a cup of black coffee to a customer with a credit card with enough
money in the account? And grow from there. I would expect your confidence
to grow as you work your way through this exercise. The problems are not,
in my experience in the nitty-gritty of the pieces. It is to get the pieces
to all fit together in a working whole. Plan on compiling at least 50 times.
Don't write a big piece of code and then start compiling, this is not a
course in learning how to type..

Maybe your first step is a menu that produces this display.and waits for a
line to be entered.
---------------
How do you want to pay?

a) Coins
b) Credit card
c) Debit card.

If the user presses anything other than 'b' followed by Enter, you simply
print a message "Function ____ is not implemented yet". Such a thing is
called a "stub".
May 11 '07 #8
"osmium" wrote:
"Umesh" writes:

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
<snipI see that OE is having one of its periodic fits where it doesn't add
corner brackets. This happens to others as well as me. Give the guys at us
a break, it's only major release 6
May 11 '07 #9
osmium wrote:
"osmium" wrote:
"Umesh" writes:

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

<snipI see that OE is having one of its periodic fits where it
doesn't add corner brackets. This happens to others as well as me.
Give the guys at us a break, it's only major release 6
Unless you're constrained for some reason to use OE, I would recommend
switching on one of the many fine newsreaders out there that don't have
the bugs and odd design decisions.


Brian
May 11 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2416
by: Rob | last post by:
I have a form - when you click the submit button, it appends a variable to the URL (e.g. xyz.cgi?inputID=some_dynamic_variable) It also opens a new page. Now, that some_dynamic_variable is actually the name of a form element on the parent window. On the new page, I have this javascript: ---- var var2 = location.search.substring(9); document.write(var2)
9
4300
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target data format is european DD.MM.YYYY (for days) and 01.MM.YYYY (for months). The input format is not recognizable as a DATE input to a DB2 LOAD for
8
5240
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is developing a web-based application, one part of which involves allowing the user the ability to page through transaction "history" information. The _summary_ history table will have the following fields: ServiceName, Date, User-Ref1, User-Ref2,...
28
3027
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
16
2927
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In: http://www.mywebsite.org/WebResource.axd?d=5WvLfhnJp5Lc8WhQSD4gdA2&t=632614619884218750 -------------------------------------------------------------------------------- System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at...
7
7239
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn" id="d_links"> multiple <a href="hello.aspx?q=something">something</a><a href="hello.aspx?q=something1">something1</a><a
33
3403
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
8
2764
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written partially in c and partially in fortran. I guess i need to change host specific files to make it working. I wonder if standard header files are going to change in this case.my current windows compiler doesn't have sys/resource.h but unix compiler...
3
6456
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from the socket is missing the last character (line feed). When the same text is sent without the urgent flag set, all of the characters are read. I'm reading the data using the blocking read call of the network stream class. The .NET...
7
5968
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find it? If not, how do I have to change my deployment strategy? Thanks!
0
8294
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8709
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8596
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.