dev-cpp-users Mailing List for Dev-C++ (Page 621)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Ioannis V. <no...@ya...> - 2002-02-16 03:46:50
|
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Marton
Rusk
Sent: Saturday, February 16, 2002 12:24 AM
To: dev...@li...
Subject: [Dev-C++] student needs a little help
Hello Everyone,
I'm currently a CS Student and need a little help. I have been given the
enclosed programming assignment but I'm not sure how to do it. It seems
like a simple problem to solve but I don't know how to do list let and
from the looks of the problem it will need one. I guess the teacher
things we are supposed to know how to do list already.
Anyhow, I'd like a few pointers on how to do this problem if possible.
Maybe how to do the part of the code where it would require a list and
search.
Any help is appreciated, thanks.
Except of the fact that you can use the ready C++ list in <list> header
file, you can use an array too. In fact i do not see why you shoud use
any container at all.
Marton
Program #2: Grocery Store Checkout (60 points)
Your assignment is to write, run, and test a C++ program, pg2, to
simulate the operation of a
grocery store checkout system. Your program should first build a data
structure to contain
information on all the products available in the store. Then the program
should print the cash
register receipt for each customer.
A data structure example:
class product
{
unsigned product_number;
std::string description;
unsigned price;
unsigned tax;
public:
product(const unsigned &pn, const std::string &desc, const unsigned &pr,
const unsigned &tx): product_number(pn), description(desc), price(pr),
tax(tx) {}
const unsigned &get_product_number() const { return product_number; }
const std::string &get_desc() const { return description; }
const unsigned &get_price() const { return price; }
const unsigned &get_tax() const { return tax; }
void set_product_number(const unsigned &pr) { product_number=pr; }
void set_desc() { description=desc; }
// ...
};
INPUT
The input for pg2 has two sources: the inventory information is input
from a text file,
and the customer transactions are input from the keyboard.
1. The information about each product carried by the store is listed on
a single line in the
inventory file "invent.dat", in the following format:
<product number> <description> <price> <tax>
where <product number> is a five-digit positive (nonzero) integer,
<description> is a string of
at most 12 characters with no embedded blanks, <price> is a real
number, and <tax> is a
character ('T' if the product is taxable; 'N' if it is not taxable).
The data in the inventory file is
ordered from smallest to largest product number.
For every element you will do checking to see if the arguments comply
with these rules and then you will throw an exception for everyone it
doesn't. You will create an exception inheritance like this:
class general_exception
{
unsigned exc_id;
public:
general_exception(const unsigned int &id): exc_id(id) {}
virtual operator unsigned() { return exc_id; }
virtual ~general_exception {}
virtual const std::string & message() const=0;
};
class desc_exception: public general_exception
{
std::string msg;
// ...
};
Or something that fits you better.
2. The customer transactions are input from the keyboard, in the
following format:
<product number> <times>
where <product number> is as described above, and <times> is an
integer in the range 1 to 100,
indicating the quantity of this product desired. A zero input for
<product number> indicates the
end of the customer's order. (The store will soon be using a scanner
to input the product number,
but for now it is typed in by the cashier.)
You will throw exceptions in case of errors.
OUTPUT
The program outputs should be written to a text file called
"receipts.out", which can be printed
out for purposes of determining your grade.
1. The inventory information of invent.dat is echo printed to the output
file.
2. The cash register receipt for each customer is written to the output
file. The receipts should be
nicely formatted, with the product description (not the product
number), number of items, item
price, and total price for each product printed on a single line. At
the end of each customer's
order, the subtotal for all items, amount of tax on taxable items,
and total bill should be printed,
clearly labeled. (The tax rate is 7.5% for taxable items.)
PROCESSING
pg2 first reads in all of the inventory information from file
invent.dat, echo printing the
information to the output file receipts.out. The program then prompts
the cashier to begin inputting
the order for the first customer. This customer's order is processed,
and the receipt is printed to the
output file.
After each customer's order is processed, the program should ask the
cashier if another customer is
to be processed. If the answer is 'Y', the program sets up to process
the next customer; if the answer
is 'N', the program terminates with a friendly message.
ERROR CHECKING
The following input errors are possible and should be handled by pg2
1. Duplicate <product number> in inventory file. Write an error message
to the output file and skip
the second entry.
2. <Product number> not in inventory file. Write an error message on the
receipt, ignore that product
number, and continue with the next item.
3. <Times> not in the specified range. Write an error message to the
output file, ignore that line, and
continue with the next item.
EXAMPLE
. From File "Invent.in":
11012 gallon-milk 1.99 N
11014 butter 2.59 N
11110 pie-shells 0.99 N
20115 laundry-soap 3.60 T
30005 homestyle-br 0.99 N
. From keyboard (one customer):
11110 2
40012 3
20115 1
0
. To "Receipts.out" file:
---------------------------------------------------------
SEP 10, 1998 6:00 pm (* date and time optional *)
Customer 1
pie-shells 2 @ 0.99 1.98
*** item 40012 not in inventory ***
laundry-soap 1 @ 3.60 3.60 TX
Subtotal 5.58
Tax 0.27
Total 5.85
DATA STRUCTURE
The inventory information can be stored in a list of product records.
Assume that the maximum
number of products is 50, for purposes of writing this program. As the
data in the inventory file
is ordered from smallest to largest product number, it is very simple to
insert the product records
into this data structure in order. You can use either a sequential or
binary search to locate a product
number in the inventory.
You should specify this data structure as an ADT, as described in the
chapter; define and implement
a set of operations to encapsulate it.
TEST PLAN
Be sure to include test cases to test your error conditions in your test
plan.
DELIVERABLES
1. A disk of the source code of the program pg2 and all included files.
2. Hard copy of a listing of your implemented test plan.
3. Hard copy of the output file, "receipts.out", produced by running
your program using the input
specified in your test plan.
For sorting and deleted the elements you will place another field in the
class like bool erased; which you will mark as true when you delete a
record, and then you will copy the contents of the file in a temporary
file, sort them there and then copy them back without the logically
deleted records.
Ioannis
* Ioannis Vranos
* Programming pages: <http://www.noicys.d2g.com/>
http://www.noicys.d2g.com
* Alternative URL: <http://run.to/noicys> http://run.to/noicys
|
|
From: Ioannis V. <no...@ya...> - 2002-02-16 03:18:04
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Devin Carless > Sent: Friday, February 15, 2002 10:24 PM > To: dev...@li... > Subject: [Dev-C++] 'New Source File' bug > > > > I came across a bug in Dev-C++ 4 some time ago, and now > it's gotten so annoying that I'm mentioning it in case no one > else knows about it. When I create a new souce file in a > large (15+ files) project, and use Save As to rename it, > often Dev-C++ refuses to change the name in the project > window (the one on the left.) So I don't know what it's > saving, exactly. Furthermore, I often get phantom unnamed > windows. Clicking on the 'Unnamed1' in the project window > seemed to create new ones. Last time, I tried to chase them > all these spurious windows down and X them out of existence. > Then I saved and quit...causing a whole slew of red-X windows > errors and 'runtime error' complaints. > I've had other problems with Dev-C++'s file handling. Once > it didn't save something it should have. (Fortunately it was > only a short header file, which I could easily recreate from > the .cpp.) The reason I used 'Save As' in the first place is > that some time ago I had similar problems with selecting an > unnamed file in the project window and trying to change its > name. (I can't recall the exact details.) Be patient, Dev-C++ 5 is coming. > I'm having enough > trouble with C++'s noodleheaded view of aggregate data > objects; this really isn't helping. What trouble. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys |
|
From: Mike S. <fre...@ho...> - 2002-02-16 01:16:05
|
Sorry for the shameless website promotion, but... Submit you programs the tArchive! Go to mike9010.psxfanatics.com. All programming languages are welcome! Please, submit to me your = programs and help make the tArchive work! |
|
From: Yeoh H. <ye...@ya...> - 2002-02-16 01:04:34
|
Hi Stein, I've used Dev-C++ and that is the way it currently works. To get around this, you'll need to write a makefile. There is a Generate Makefile menu option. However, the makefile generated compiles all files. You can modify this generated makefile. Another way is to refer to makefile from the MingW package. Regards, Yeoh ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ Author of "How to Create an eBook Using Visual C++" Free Downloads at http://www.yeohhs.com ICT eBooks by Yeoh HS ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ ----- Original Message ----- From: Stein Nyg=E5rd <ste...@ge...> To: DevCpp <dev...@li...> Sent: Saturday, February 16, 2002 5:16 AM Subject: [Dev-C++] Multiple files in a project? > Hey guys! > > I'm working on a project, with I have 11 .cpp files so far. That sums u= p to > a lot of code, so the compililation takes a lot of time to complete. Is > there anything I can do to make the compilation go faster. Since most o= f the > files stay the way they are, it seems wierd to compile the same lines o= f > code each time *G*. Thanks! > > -stein > |
|
From: Jason H. <jas...@bt...> - 2002-02-15 23:17:12
|
Hi,
List structures are usualy taught early on in a programming course you =
may need to tell your teacher that you haven't yet been taught lists =
though? You may want to clarify whether you have to make your own list =
data type or if you can use a standardly available one. C++ defines a =
standard set of container objects that should be readily available in =
any up to date C++ distro, called the Standard Template Library (STL), =
and list is one of them. I would actualy use a map (also available in =
the STL) to implement the grocery list though. A map is a series =
<key><value> combinations, where you can look up a <value> using the =
<key> part. The STL also defines a range of access and search methods =
for you. However you may not be allowed to rely on ready made parts, =
although in the real world you would.
My best advise for you would be to arrange to talk to the teacher and =
ask about these things, because it would take a lot of effort to teach =
you about lists in a single e-mail. Books usualy have a whole chapter on =
them and how to use them. Try researching Algorithms and Abstract Data =
Types. There are probably some web-sites around that cover the subject =
too, anyone know any?
Jason.
----- Original Message -----=20
From: Marton Rusk=20
To: dev...@li...=20
Sent: Friday, February 15, 2002 10:23 PM
Subject: [Dev-C++] student needs a little help
Hello Everyone,
I'm currently a CS Student and need a little help. I have been given =
the enclosed programming assignment but I'm not sure how to do it. It =
seems like a simple problem to solve but I don't know how to do list let =
and from the looks of the problem it will need one. I guess the teacher =
things we are supposed to know how to do list already.
Anyhow, I'd like a few pointers on how to do this problem if possible. =
Maybe how to do the part of the code where it would require a list and =
search.
Any help is appreciated, thanks.
Marton
Program #2: Grocery Store Checkout (60 points)
=20
Your assignment is to write, run, and test a C++ program, pg2, to =
simulate the operation of a
grocery store checkout system. Your program should first build a data =
structure to contain
information on all the products available in the store. Then the =
program should print the cash=20
register receipt for each customer.=20
=20
INPUT
The input for pg2 has two sources: the inventory information is input =
from a text file,=20
and the customer transactions are input from the keyboard.
=20
1. The information about each product carried by the store is listed =
on a single line in the
inventory file "invent.dat", in the following format:
<product number> <description> <price> <tax>
where <product number> is a five-digit positive (nonzero) integer, =
<description> is a string of=20
at most 12 characters with no embedded blanks, <price> is a real =
number, and <tax> is a=20
character ('T' if the product is taxable; 'N' if it is not =
taxable). The data in the inventory file is=20
ordered from smallest to largest product number.
=20
2. The customer transactions are input from the keyboard, in the =
following format:
<product number> <times>
where <product number> is as described above, and <times> is an =
integer in the range 1 to 100,=20
indicating the quantity of this product desired. A zero input for =
<product number> indicates the=20
end of the customer's order. (The store will soon be using a =
scanner to input the product number,=20
but for now it is typed in by the cashier.)=20
=20
OUTPUT
=20
The program outputs should be written to a text file called =
"receipts.out", which can be printed
out for purposes of determining your grade.=20
=20
1. The inventory information of invent.dat is echo printed to the =
output file.=20
=20
2. The cash register receipt for each customer is written to the =
output file. The receipts should be=20
nicely formatted, with the product description (not the product =
number), number of items, item=20
price, and total price for each product printed on a single line. =
At the end of each customer's=20
order, the subtotal for all items, amount of tax on taxable items, =
and total bill should be printed,=20
clearly labeled. (The tax rate is 7.5% for taxable items.)=20
=20
PROCESSING
=20
pg2 first reads in all of the inventory information from file =
invent.dat, echo printing the=20
information to the output file receipts.out. The program then prompts =
the cashier to begin inputting=20
the order for the first customer. This customer's order is processed, =
and the receipt is printed to the=20
output file.
After each customer's order is processed, the program should ask the =
cashier if another customer is=20
to be processed. If the answer is 'Y', the program sets up to process =
the next customer; if the answer=20
is 'N', the program terminates with a friendly message.=20
=20
ERROR CHECKING
=20
The following input errors are possible and should be handled by pg2
=20
1. Duplicate <product number> in inventory file. Write an error =
message to the output file and skip=20
the second entry.=20
2. <Product number> not in inventory file. Write an error message on =
the receipt, ignore that product=20
number, and continue with the next item.=20
3. <Times> not in the specified range. Write an error message to the =
output file, ignore that line, and=20
continue with the next item.=20
=20
EXAMPLE
. From File "Invent.in":
11012 gallon-milk 1.99 N
11014 butter 2.59 N
11110 pie-shells 0.99 N
20115 laundry-soap 3.60 T
30005 homestyle-br 0.99 N
. From keyboard (one customer):
11110 2
40012 3
20115 1
0
=20
. To "Receipts.out" file:
---------------------------------------------------------
SEP 10, 1998 6:00 pm (* date and time optional *)
Customer 1
pie-shells 2 @ 0.99 1.98
*** item 40012 not in inventory ***
laundry-soap 1 @ 3.60 3.60 TX
Subtotal 5.58
Tax 0.27
=20
Total 5.85=20
=20
=20
DATA STRUCTURE
=20
The inventory information can be stored in a list of product records. =
Assume that the maximum=20
number of products is 50, for purposes of writing this program. As the =
data in the inventory file=20
is ordered from smallest to largest product number, it is very simple =
to insert the product records=20
into this data structure in order. You can use either a sequential or =
binary search to locate a product=20
number in the inventory.
You should specify this data structure as an ADT, as described in the =
chapter; define and implement=20
a set of operations to encapsulate it.=20
=20
=20
TEST PLAN
=20
Be sure to include test cases to test your error conditions in your =
test plan.=20
=20
DELIVERABLES
=20
1. A disk of the source code of the program pg2 and all included =
files.=20
2. Hard copy of a listing of your implemented test plan.
3. Hard copy of the output file, "receipts.out", produced by running =
your program using the input=20
specified in your test plan.
-------------------------------------------------------------------------=
-----
Send and receive Hotmail on your mobile device: Click Here
_______________________________________________ Dev-cpp-users mailing =
list Dev...@li... =
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: jansb000 <jan...@wx...> - 2002-02-15 22:28:46
|
Go to the news-group comp.graphics.algorithms and ask your questions there. It may be off-topic but they surely can help you. You may also look in newsgroup comp.answers and search for a list of math libraries. ----- Original Message ----- From: "Mark Smith" <mar...@li...> To: "Dev-C++-Users (E-mail)" <dev...@li...> Sent: Wednesday, February 13, 2002 4:46 PM Subject: [Dev-C++] matrix inversion > Does anyone know of any public domain iterative matrix inversion C code for > large dense non-symmetric matrices? (not too much to ask surely) > I have been using the numerical recipes in C routine for Gauss-Jordan > elimination on matrices bigger than 5000x5000 and you might be pleased to > know that the C/C++ Mingw compiler produces the fastest code out of a head > to head with the Borland bcc5.5 command line compiler or the excellent LCC > win 32 compiler all with maximum speed optimisation turned on. > > Regards Mark > > > > -------------------------------------------------------------------------- > This e-mail may contain privileged/confidential information and may be > read, copied and used only by the intended recipient. If you have received > it in error, please contact the sender by return e-mail or by > telephoning +44 (0)1480 302100. > Please then delete the e-mail and do not disclose its contents to any > person. > > Any information in this message that does not relate to the official > business of Linx shall be understood as neither given nor endorsed by Linx. > We reserve the right to monitor all e-mail communications through our > internal and external networks. > -------------------------------------------------------------------------- > > > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Marton R. <mar...@ho...> - 2002-02-15 22:24:17
|
<html><div style='background-color:'><DIV>
<P>Hello Everyone,</P>
<P>I'm currently a CS Student and need a little help. I have been given the enclosed programming assignment but I'm not sure how to do it. It seems like a simple problem to solve but I don't know how to do list let and from the looks of the problem it will need one. I guess the teacher things we are supposed to know how to do list already.</P>
<P>Anyhow, I'd like a few pointers on how to do this problem if possible. Maybe how to do the part of the code where it would require a list and search.</P>
<P>Any help is appreciated, thanks.</P>
<P>Marton<BR></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B>Program #2:<SPAN style="mso-spacerun: yes"> </SPAN><I>Grocery Store Checkout<SPAN style="mso-spacerun: yes"> </SPAN></I>(60 points)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Your assignment is to write, run, and test a C++ program, <B>pg2</B>, to simulate the operation of a<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">grocery store checkout system. Your program should first build a data structure to contain<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">information on all the products available in the store. Then the program should print the cash <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">register receipt for each customer. </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B>INPUT<o:p></o:p></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">The input for <B>pg2</B> has two sources: the inventory information is input from a text file, <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">and the customer transactions are input from the keyboard.<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">1. The information about each product carried by the store is listed on a single line in the<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>inventory file <B>invent.dat</B>", in the following format:<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-tab-count: 2"> </SPAN><<I>product number</I>> <d<I>escription</I>> <<I>price</I>> <<I>tax</I>><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>where <product number> is a five-digit positive (nonzero) integer, <description> is a string of <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>at most 12 characters with no embedded blanks, <price> is a real number, and <tax> is a <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>character ('T' if the product is taxable; 'N' if it is not taxable). The data in the inventory file is <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN><U>ordered</U> from smallest to largest product number.<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">2. The customer transactions are input from the keyboard, in the following format:<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-tab-count: 2"> </SPAN><<I>product number</I>> <<I>times</I>><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>where <product number> is as described above, and <times> is an integer in the range 1 to 100, <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>indicating the quantity of this product desired. A zero input for <product number> indicates the <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>end of the customer's order. (The store will soon be using a scanner to input the product number, <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>but for now it is typed in by the cashier.) <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B>OUTPUT</B><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">The program outputs should be written to a text file called <B>receipts.out</B>", which can be printed<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">out for purposes of determining your grade. <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">1. The inventory information of <B>invent.dat</B> is echo printed to the output file. <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">2. The cash register receipt for each customer is written to the output file. The receipts should be <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>nicely formatted, with the product description (not the product number), number of items, item <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>price, and total price for each product printed on a single line. At the end of each customer's <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>order, the subtotal for all items, amount of tax on taxable items, and total bill should be printed, <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>clearly labeled. (The tax rate is 7.5% for taxable items.) <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B>PROCESSING<o:p></o:p></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B>pg2</B> first reads in all of the inventory information from file <B>invent.dat</B>, echo printing the <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">information to the output file <B>receipts.out</B>. The program then prompts the cashier to begin inputting <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">the order for the first customer. This customer's order is processed, and the receipt is printed to the <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">output file.<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">After each customer's order is processed, the program should ask the cashier if another customer is <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">to be processed. If the answer is 'Y', the program sets up to process the next customer; if the answer <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">is 'N', the program terminates with a friendly message. </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B>ERROR CHECKING<o:p></o:p></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">The following input errors are possible and should be handled by <B>pg2</B><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">1. Duplicate <product number> in inventory file. Write an error message <U>to the output file</U> and <U>skip</U> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>the second entry. <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">2. <Product number> not in inventory file. Write an error message <U>on the receipt</U>, ignore that product <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>number, and <U>continue</U> with the next item. <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">3. <Times> not in the specified range. Write an error message <U>to the output file</U>, ignore that line, and <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN><U>continue</U> with the next item. <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B>EXAMPLE<o:p></o:p></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> <?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:stroke joinstyle="miter"></v:stroke><v:path o:connecttype="rect" gradientshapeok="t"></v:path><v:shape id=_x0000_s1028 style="MARGIN-TOP: 0.05pt; Z-INDEX: 1; MARGIN-LEFT: 0px; WIDTH: 477.9pt; POSITION: absolute; HEIGHT: 321.45pt; mso-wrap-style: none; v-text-anchor: top-baseline" type="#_x0000_t202" stroked="f" filled="f" fillcolor="#0c9"><v:textbox style="mso-fit-shape-to-text: t"></v:textbox></v:shape><SPAN style="Z-INDEX: 1; POSITION: absolute; mso-ignore: vglayout">
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent">
<DIV class=shape style="PADDING-RIGHT: 7.2pt; PADDING-LEFT: 7.2pt; PADDING-BOTTOM: 3.6pt; PADDING-TOP: 3.6pt" v:shape="_x0000_s1028">
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 2in; TEXT-INDENT: 0in; mso-list: l0 level1 lfo1; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-fareast-font-family: Courier; mso-bidi-font-family: Courier"><SPAN style="mso-list: Ignore"></SPAN></SPAN><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><I>From File</I> "Invent.in":</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>11012 <SPAN style="mso-tab-count: 1"> </SPAN>gallon-milk<SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>1.99 <SPAN style="mso-tab-count: 1"> </SPAN>N</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>11014<SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>butter<SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>2.59<SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>N</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>11110<SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>pie-shells<SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>0.99 <SPAN style="mso-tab-count: 1"> </SPAN>N</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>20115<SPAN style="mso-tab-count: 1"> </SPAN>laundry-soap<SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>3.60 <SPAN style="mso-tab-count: 1"> </SPAN>T</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>30005<SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>homestyle-br<SPAN style="mso-spacerun: yes"> </SPAN>0.99 <SPAN style="mso-tab-count: 1"> </SPAN>N</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0in; mso-list: l0 level1 lfo1; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-fareast-font-family: Courier; mso-bidi-font-family: Courier"><SPAN style="mso-list: Ignore"></SPAN></SPAN><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><I>From keyboard</I> (one customer):</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>11110<SPAN style="mso-spacerun: yes"> </SPAN>2</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>40012<SPAN style="mso-spacerun: yes"> </SPAN>3</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>20115<SPAN style="mso-spacerun: yes"> </SPAN>1</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>0</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="COLOR: black; mso-ascii-font-family: Courier"> </SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0in; mso-list: l0 level1 lfo1; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-fareast-font-family: Courier; mso-bidi-font-family: Courier"><SPAN style="mso-list: Ignore"></SPAN></SPAN><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><I>To "Receipts.out" file</I>:</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'">---------------------------------------------------------</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"><?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:date Month="9" Day="10" Year="1998"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'">SEP 10, 1998</SPAN></st1:date><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"> </SPAN><st1:time Hour="18" Minute="0"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'">6:00 pm</SPAN></st1:time><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"> (* date and time optional *)</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'">Customer 1</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'">pie-shells<SPAN style="mso-spacerun: yes"> </SPAN>2<SPAN style="mso-spacerun: yes"> </SPAN>@<SPAN style="mso-spacerun: yes"> </SPAN>0.99<SPAN style="mso-spacerun: yes"> </SPAN>1.98</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'">*** item 40012 not in inventory ***</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'">laundry-soap<SPAN style="mso-spacerun: yes"> </SPAN>1<SPAN style="mso-spacerun: yes"> </SPAN>@<SPAN style="mso-spacerun: yes"> </SPAN>3.60<SPAN style="mso-spacerun: yes"> </SPAN>3.60 TX</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-tab-count: 1"> </SPAN>Subtotal<SPAN style="mso-spacerun: yes"> </SPAN>5.58</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-tab-count: 1"> </SPAN>Tax<SPAN style="mso-spacerun: yes"> </SPAN>0.27</SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"><SPAN style="COLOR: black; mso-ascii-font-family: Courier"> </SPAN><SPAN style="COLOR: black; FONT-FAMILY: Times; mso-hansi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"><SPAN style="COLOR: black; FONT-FAMILY: Courier; mso-bidi-font-family: Courier; mso-hansi-font-family: 'Times New Roman'"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>Total<SPAN style="mso-spacerun: yes"> </SPAN>5.85</SPAN><SPAN style="COLOR: black"> <o:p></o:p></SPAN></P></DIV></TD></TR></TBODY></TABLE></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B></B> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B>DATA STRUCTURE</B><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">The inventory information can be stored in a list of product records. Assume that the maximum <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">number of products is 50, for purposes of writing this program. As the data in the inventory file <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">is ordered from smallest to largest product number, it is very simple to insert the product records <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">into this data structure in order. You can use either a sequential or binary search to locate a product <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">number in the inventory.<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">You should specify this data structure as an ADT, as described in the chapter; define and implement <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">a set of operations to encapsulate it. <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B><o:p> </o:p></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B>TEST PLAN</B><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Be sure to include test cases to test your error conditions in your test plan. <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B>DELIVERABLES</B><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">1. A disk of the source code of the program <B>pg2</B> and all included files. <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">2. Hard copy of a listing of your implemented test plan.<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">3. Hard copy of the output file, receipts.out", produced by running your program using the input <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-spacerun: yes"> </SPAN>specified in your test plan.<o:p></o:p></P>
<P> </P></DIV></div><br clear=all><hr>Send and receive Hotmail on your mobile device: <a href='http://go.msn.com/bql/hmtag2_etl_EN.asp'>Click Here</a><br></html>
|
|
From: <ste...@ge...> - 2002-02-15 21:16:50
|
Hey guys! I'm working on a project, with I have 11 .cpp files so far. That sums up to a lot of code, so the compililation takes a lot of time to complete. Is there anything I can do to make the compilation go faster. Since most of the files stay the way they are, it seems wierd to compile the same lines of code each time *G*. Thanks! -stein |
|
From: Devin C. <dcc...@ya...> - 2002-02-15 20:20:30
|
I came across a bug in Dev-C++ 4 some time ago, and now it's gotten so annoying that I'm mentioning it in case no one else knows about it. When I create a new souce file in a large (15+ files) project, and use Save As to rename it, often Dev-C++ refuses to change the name in the project window (the one on the left.) So I don't know what it's saving, exactly. Furthermore, I often get phantom unnamed windows. Clicking on the 'Unnamed1' in the project window seemed to create new ones. Last time, I tried to chase them all these spurious windows down and X them out of existence. Then I saved and quit...causing a whole slew of red-X windows errors and 'runtime error' complaints. I've had other problems with Dev-C++'s file handling. Once it didn't save something it should have. (Fortunately it was only a short header file, which I could easily recreate from the .cpp.) The reason I used 'Save As' in the first place is that some time ago I had similar problems with selecting an unnamed file in the project window and trying to change its name. (I can't recall the exact details.) I'm having enough trouble with C++'s noodleheaded view of aggregate data objects; this really isn't helping. Any workarounds? Has the problem been tracked down? --Devin Carless _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
|
From: Devin C. <dcc...@ya...> - 2002-02-14 22:02:09
|
> please do not send such emails to the email list. Nobody is interested whether > you received this email or not. I think that the generalization is more than justifiable, and the requestlikewise. However, it doesn't seem likely that we'll manage to get through to this person Way back when, in the Dark Ages of the Net (c. 1993) Usenet was not the barren wasteland it is today. Before the destructive Flame Wars, one could shield oneself from repeated harassment by means of a 'kill file.' Such a thing can be simulated today with most mail readers, even Microsoft products. I've set up my message rules in Outlook Express to direct such annoying drivel to my 'deleted' folder, and mark it as read. If it's really bothering you, make a message rule to delete messages with 'Auto Respond' in the subject line from Mr. Horzum: it's not as good as getting him to stop, but it keeps the spam down to manageable levels. --Devin Carless P.S. Mr. Horzum: *plonk*. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
|
From: <cp...@ip...> - 2002-02-14 21:19:00
|
Hello Erdogan, please do not send such emails to the email list. Nobody is interested whether you received this email or not. Regards, Christoph. Quoting "A. Erdogan Horzum" <ze...@ze...>: > Your mail received. > > Thank You, > > A. Erdogan Horzum > www.zetamuhendislik.com > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: A. E. H. <ze...@ze...> - 2002-02-14 20:30:55
|
Your mail received. Thank You, A. Erdogan Horzum www.zetamuhendislik.com |
|
From: Ioannis V. <no...@ya...> - 2002-02-14 02:41:27
|
Except of what Jason said, try to make the recursive functions
non-recursive using loops. Recursion has both large time and space cost
with the last placing limits at the capacity of your tree since
dos/console only allows 64 kb of storage in the stack. Always (try to)
make the recursive functions non-recursive by using loop (e.g. for) and
placing the condition of the recursion ending as the condition of the
loop ending.
e.g.
int addall(int n)
{
if(n<0)
return 0;
int count=0;
count+=n;
if(--n)
count+=addall(n);
return count;
}
becones the time/space efficient:
int addall(int n)
{
int count=0;
for(int i=1; i<=n; i++)
count+=i;
return count;
}
Doing this you will not be able to think again in recursive mode (which
is a good thing!) contrary to what smart-ass-but-know-nothing think. :)
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of chromatonus 712
> Sent: Wednesday, February 13, 2002 11:29 PM
> To: dev...@li...
> Subject: [Dev-C++] Binary Tree display
>
>
> Hi, I don't know why my screen is not displaying anything
> after i supposedly
> input a tree and executed the display commands. Would you
> please examine my
> program and see where it's wrong? Thank you!
>
>
> #include <iostream.h>
> #include <stdlib.h>
> #include <conio.h>
>
>
> struct node
> {
> int data;
> node *left, *right;
> };
>
>
> //PROTOTYPES
>
> int menu();
> //postcondition: creates and displays a menu, returning
> the value of
> choice
>
> void insert_node(node *&, node *);
>
> void pre( node* );
>
> void in( node* );
>
> void post( node* );
>
> int menu()
> {
> int choice;
> cout<< "TREE EDITOR MENU OPTIONS" << "\n";
> cout<< "1. Insert elements in Tree" << "\n";
> cout<< "2. Display Tree in Prefix" << "\n";
> cout<< "3. Display Tree in Infix" << "\n";
> cout<< "4. Display Tree in Postfix" << "\n";
> cout<< "5. Exit";
> gotoxy(1,8);
> cout<< "choice? ";
> cin>> choice;
> return(choice);
> }
>
> // Main Program
> int main()
> {
> node *root = NULL;
> node *stem = new node;
> int choice, info;
> choice = menu();
> while( choice != 5 )
> {
> switch( choice )
> {
> case 1: gotoxy(1,10);
> cout<< "input? ";
> cin>> info;
> stem->data = info;
> insert_node(root, stem);
> break;
> case 2: gotoxy(1,10);
> pre( root );
> break;
> case 3: gotoxy(1,10);
> in( root );
> break;
> case 4: gotoxy(1,10);
> post( root );
> break;
> }
> gotoxy(1,8);
> cout<< "choice? ";
> cin>> choice;
> }
> }
>
> void insert_node(node *&root, node *stem)
> {
> if(root == NULL)
> {
> stem = root;
> }
> else
> {
> if(stem->data < root->data)
> insert_node(root->left, stem);
> else
> insert_node(root->right, stem);
> }
> }
>
> void pre(node *root)
> {
> if( root != NULL )
> {
> cout<< root->data <<" ";
> pre( root->left );
> pre( root->right );
> }
> }
>
> void in(node *root)
> {
> if( root != NULL )
> {
> in(root->left);
> cout<< root->data <<" ";
> in(root->right);
> }
> }
>
> void post(node *root)
> {
> if(root != NULL)
> {
> post(root->left);
> post(root->right);
> cout<< root->data <<" ";
> }
> }
>
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Jason H. <jas...@bt...> - 2002-02-13 23:58:42
|
Hi,
In main you only create one 'new' node for stem, and then you constantly
reuse it, and therefore write over it, every time you insert a node. You
need to create a new node for each new set of data and insert that.
Also in insert_node() you test for root being NULL, which it is to start
with, and then you do:
stem = root;
So the local stem becomes NULL and root doesn't change. I think you meant:
root = stem;
At the moment you aren't actualy inserting anything into the tree, root is
always NULL.
There may be other errors, but are the ones I found after skimming through
it quickly.
Jason.
----- Original Message -----
From: "chromatonus 712" <chr...@ho...>
To: <dev...@li...>
Sent: Wednesday, February 13, 2002 9:28 PM
Subject: [Dev-C++] Binary Tree display
> Hi, I don't know why my screen is not displaying anything after i
supposedly
> input a tree and executed the display commands. Would you please examine
my
> program and see where it's wrong? Thank you!
>
>
> #include <iostream.h>
> #include <stdlib.h>
> #include <conio.h>
>
>
> struct node
> {
> int data;
> node *left, *right;
> };
>
>
> //PROTOTYPES
>
> int menu();
> //postcondition: creates and displays a menu, returning the value of
> choice
>
> void insert_node(node *&, node *);
>
> void pre( node* );
>
> void in( node* );
>
> void post( node* );
>
> int menu()
> {
> int choice;
> cout<< "TREE EDITOR MENU OPTIONS" << "\n";
> cout<< "1. Insert elements in Tree" << "\n";
> cout<< "2. Display Tree in Prefix" << "\n";
> cout<< "3. Display Tree in Infix" << "\n";
> cout<< "4. Display Tree in Postfix" << "\n";
> cout<< "5. Exit";
> gotoxy(1,8);
> cout<< "choice? ";
> cin>> choice;
> return(choice);
> }
>
> // Main Program
> int main()
> {
> node *root = NULL;
> node *stem = new node;
> int choice, info;
> choice = menu();
> while( choice != 5 )
> {
> switch( choice )
> {
> case 1: gotoxy(1,10);
> cout<< "input? ";
> cin>> info;
> stem->data = info;
> insert_node(root, stem);
> break;
> case 2: gotoxy(1,10);
> pre( root );
> break;
> case 3: gotoxy(1,10);
> in( root );
> break;
> case 4: gotoxy(1,10);
> post( root );
> break;
> }
> gotoxy(1,8);
> cout<< "choice? ";
> cin>> choice;
> }
> }
>
> void insert_node(node *&root, node *stem)
> {
> if(root == NULL)
> {
> stem = root;
> }
> else
> {
> if(stem->data < root->data)
> insert_node(root->left, stem);
> else
> insert_node(root->right, stem);
> }
> }
>
> void pre(node *root)
> {
> if( root != NULL )
> {
> cout<< root->data <<" ";
> pre( root->left );
> pre( root->right );
> }
> }
>
> void in(node *root)
> {
> if( root != NULL )
> {
> in(root->left);
> cout<< root->data <<" ";
> in(root->right);
> }
> }
>
> void post(node *root)
> {
> if(root != NULL)
> {
> post(root->left);
> post(root->right);
> cout<< root->data <<" ";
> }
> }
>
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: <mr...@c2...> - 2002-02-13 21:44:57
|
Hi, I haven't found a way to do block indents in the Dev-C++ IDE... It is extremely annoying to have to manually indent (with tab) all the lines of a block that needs indenting. Is there any way of doing block indent? -=D8yvind ____________________________________________ =D8yvind Kaurstad, Granittveien 51, 4340 Bryne Tlf: 51 48 87 17, Mob: 990 86 990 Email: mr...@c2... ICQ#28366979 |
|
From: chromatonus 7. <chr...@ho...> - 2002-02-13 21:29:13
|
Hi, I don't know why my screen is not displaying anything after i supposedly
input a tree and executed the display commands. Would you please examine my
program and see where it's wrong? Thank you!
#include <iostream.h>
#include <stdlib.h>
#include <conio.h>
struct node
{
int data;
node *left, *right;
};
//PROTOTYPES
int menu();
//postcondition: creates and displays a menu, returning the value of
choice
void insert_node(node *&, node *);
void pre( node* );
void in( node* );
void post( node* );
int menu()
{
int choice;
cout<< "TREE EDITOR MENU OPTIONS" << "\n";
cout<< "1. Insert elements in Tree" << "\n";
cout<< "2. Display Tree in Prefix" << "\n";
cout<< "3. Display Tree in Infix" << "\n";
cout<< "4. Display Tree in Postfix" << "\n";
cout<< "5. Exit";
gotoxy(1,8);
cout<< "choice? ";
cin>> choice;
return(choice);
}
// Main Program
int main()
{
node *root = NULL;
node *stem = new node;
int choice, info;
choice = menu();
while( choice != 5 )
{
switch( choice )
{
case 1: gotoxy(1,10);
cout<< "input? ";
cin>> info;
stem->data = info;
insert_node(root, stem);
break;
case 2: gotoxy(1,10);
pre( root );
break;
case 3: gotoxy(1,10);
in( root );
break;
case 4: gotoxy(1,10);
post( root );
break;
}
gotoxy(1,8);
cout<< "choice? ";
cin>> choice;
}
}
void insert_node(node *&root, node *stem)
{
if(root == NULL)
{
stem = root;
}
else
{
if(stem->data < root->data)
insert_node(root->left, stem);
else
insert_node(root->right, stem);
}
}
void pre(node *root)
{
if( root != NULL )
{
cout<< root->data <<" ";
pre( root->left );
pre( root->right );
}
}
void in(node *root)
{
if( root != NULL )
{
in(root->left);
cout<< root->data <<" ";
in(root->right);
}
}
void post(node *root)
{
if(root != NULL)
{
post(root->left);
post(root->right);
cout<< root->data <<" ";
}
}
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
|
|
From: Ioannis V. <no...@ya...> - 2002-02-13 19:31:02
|
One can make a mess to the email server of this friend using that feature only, but i will not go on further, it just started to bother me a lot. Ioannis * Ioannis Vranos * Programming pages: <http://www.noicys.d2g.com/> http://www.noicys.d2g.com * Alternative URL: <http://run.to/noicys> http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Daniel Glenfield Sent: Wednesday, February 13, 2002 7:21 PM To: ben...@ho...; jsc...@gm...; dev...@li... Subject: Re: [Dev-C++] unsub hazzle Could well be. Do you think that chap whose email server sends a response actually bothers to read these? I don't use DEV anymore but I stay on the list as I get to learn a lot from other users. >From: "Benjamin Wheeless" >To: jsc...@gm..., dev...@li... >Subject: Re: [Dev-C++] unsub hazzle >Date: Wed, 13 Feb 2002 11:45:45 -0500 > _____ Get your FREE download of MSN Explorer at http://explorer.msn.com <http://go.msn.com/bql/hmtag_etl_EN.asp> . |
|
From: Benjamin W. <ben...@ho...> - 2002-02-13 17:46:54
|
<html><div style='background-color:'><DIV>
<P>Ahhh... good 'ole' DOS. :)</P></DIV>
<DIV></DIV>
<DIV><FONT face="Geneva, Arial, Sans-serif" size=2>Benjamin Wheeless</FONT></DIV>
<DIV></DIV>
<DIV><FONT face="Geneva, Arial, Sans-serif" size=2><STRONG>Network Systems - Delta Airlines, Inc.</STRONG></FONT></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><STRONG>Atlanta, GA - USA 30320</STRONG></FONT></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><STRONG>==============================</STRONG></FONT></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>----Original Message Follows----
<DIV></DIV>From: gi...@li...
<DIV></DIV>To: dev...@so...
<DIV></DIV>Subject: Re: [Dev-C++] Re: cin.get()
<DIV></DIV>Date: Wed, 13 Feb 2002 15:12:43 +0100
<DIV></DIV>
<DIV></DIV>Hello Aaron,
<DIV></DIV>
<DIV></DIV>since you are developing console applications, my suggestion is: run them
<DIV></DIV>from the console. In fact, when you use the console, there is no need to
<DIV></DIV>add "cin.get" or "system("PAUSE")" or any other special instruction
<DIV></DIV>preventing Windows from closing the window :-)
<DIV></DIV>
<DIV></DIV>For instance, the following code would work as expected:
<DIV></DIV>
<DIV></DIV>#include <IOSTREAM>
<DIV></DIV>int
<DIV></DIV>main()
<DIV></DIV>{
<DIV></DIV>std::cout << "Please enter a number:";
<DIV></DIV>
<DIV></DIV>int n;
<DIV></DIV>std::cin >> n;
<DIV></DIV>
<DIV></DIV>std::cout << "You entered: "<< n << '\n';
<DIV></DIV>}
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>At 13:43 12/02/02 -0500, Aaron wrote:
<DIV></DIV>>Hello...
<DIV></DIV>>
<DIV></DIV>>I have a question about closing a terminal window during a C++
<DIV></DIV>>program
<DIV></DIV>>execution. I am using Dev C++ 4.01 as my compiler. At
<DIV></DIV>>http://www.cprogramming.com/close.html, it says that inserting the
<DIV></DIV>>line
<DIV></DIV>>cin.get() before the return 0 line will keep the terminal window
<DIV></DIV>>open
<DIV></DIV>>until I press enter. This I find is true for the following program:
<DIV></DIV>>
<DIV></DIV>>#include <IOSTREAM.H>
<DIV></DIV>>int main()
<DIV></DIV>>{
<DIV></DIV>> cout<<"The Compiler Works";
<DIV></DIV>> cin.get()
<DIV></DIV>> return 0;
<DIV></DIV>>}
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>However for the following code, I type my number, press enter, and
<DIV></DIV>>the window
<DIV></DIV>>closes immediately. Why doesn't the compiler display "You entered:
<DIV></DIV>>", then my
<DIV></DIV>>number, and then close the terminal window once I push enter (which
<DIV></DIV>>would be
<DIV></DIV>>the second time)?? Am I putting the cin.get() statement in the
<DIV></DIV>>wrong spot??
<DIV></DIV>>Check out the code I'm using.
<DIV></DIV>>
<DIV></DIV>>#include <IOSTREAM.H>
<DIV></DIV>>int main()
<DIV></DIV>>{
<DIV></DIV>> int thisisanumber;
<DIV></DIV>> cout<<"Please enter a number:";
<DIV></DIV>> cin>>thisisanumber;
<DIV></DIV>> cout<<"You entered: "<<THISISANUMBER; DIV <>> cin.get()
<DIV></DIV>> return 0;
<DIV></DIV>>}
<DIV></DIV>>
<DIV></DIV>>I'm stuck, and I'm trying to teach myself C++. Your help is greatly
<DIV></DIV>>appreciated.
<DIV></DIV>>
<DIV></DIV>>Sincerly,
<DIV></DIV>>Aaron
<DIV></DIV>
<DIV></DIV>--
<DIV></DIV>gisan
<DIV></DIV>gi...@li...
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>_______________________________________________
<DIV></DIV>Dev-cpp-users mailing list
<DIV></DIV>Dev...@li...
<DIV></DIV>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
<DIV></DIV></div><br clear=all><hr>Chat with friends online, try MSN Messenger: <a href='http://go.msn.com/bql/hmtag1_etl_EN.asp'>Click Here</a><br></html>
|
|
From: Benjamin W. <ben...@ho...> - 2002-02-13 17:44:56
|
<html><div style='background-color:'><DIV>
<P>Ahhh... good 'ole' DOS. :)</P></DIV>
<DIV></DIV>
<DIV><FONT face="Geneva, Arial, Sans-serif" size=2>Benjamin Wheeless</FONT></DIV>
<DIV></DIV>
<DIV><FONT face="Geneva, Arial, Sans-serif" size=2><STRONG>Network Systems - Delta Airlines, Inc.</STRONG></FONT></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><STRONG>Atlanta, GA - USA 30320</STRONG></FONT></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><STRONG>==============================</STRONG></FONT></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>----Original Message Follows----
<DIV></DIV>From: gi...@li...
<DIV></DIV>To: dev...@so...
<DIV></DIV>Subject: Re: [Dev-C++] Re: cin.get()
<DIV></DIV>Date: Wed, 13 Feb 2002 15:12:43 +0100
<DIV></DIV>
<DIV></DIV>Hello Aaron,
<DIV></DIV>
<DIV></DIV>since you are developing console applications, my suggestion is: run them
<DIV></DIV>from the console. In fact, when you use the console, there is no need to
<DIV></DIV>add "cin.get" or "system("PAUSE")" or any other special instruction
<DIV></DIV>preventing Windows from closing the window :-)
<DIV></DIV>
<DIV></DIV>For instance, the following code would work as expected:
<DIV></DIV>
<DIV></DIV>#include <IOSTREAM>
<DIV></DIV>int
<DIV></DIV>main()
<DIV></DIV>{
<DIV></DIV>std::cout << "Please enter a number:";
<DIV></DIV>
<DIV></DIV>int n;
<DIV></DIV>std::cin >> n;
<DIV></DIV>
<DIV></DIV>std::cout << "You entered: "<< n << '\n';
<DIV></DIV>}
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>At 13:43 12/02/02 -0500, Aaron wrote:
<DIV></DIV>>Hello...
<DIV></DIV>>
<DIV></DIV>>I have a question about closing a terminal window during a C++
<DIV></DIV>>program
<DIV></DIV>>execution. I am using Dev C++ 4.01 as my compiler. At
<DIV></DIV>>http://www.cprogramming.com/close.html, it says that inserting the
<DIV></DIV>>line
<DIV></DIV>>cin.get() before the return 0 line will keep the terminal window
<DIV></DIV>>open
<DIV></DIV>>until I press enter. This I find is true for the following program:
<DIV></DIV>>
<DIV></DIV>>#include <IOSTREAM.H>
<DIV></DIV>>int main()
<DIV></DIV>>{
<DIV></DIV>> cout<<"The Compiler Works";
<DIV></DIV>> cin.get()
<DIV></DIV>> return 0;
<DIV></DIV>>}
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>However for the following code, I type my number, press enter, and
<DIV></DIV>>the window
<DIV></DIV>>closes immediately. Why doesn't the compiler display "You entered:
<DIV></DIV>>", then my
<DIV></DIV>>number, and then close the terminal window once I push enter (which
<DIV></DIV>>would be
<DIV></DIV>>the second time)?? Am I putting the cin.get() statement in the
<DIV></DIV>>wrong spot??
<DIV></DIV>>Check out the code I'm using.
<DIV></DIV>>
<DIV></DIV>>#include <IOSTREAM.H>
<DIV></DIV>>int main()
<DIV></DIV>>{
<DIV></DIV>> int thisisanumber;
<DIV></DIV>> cout<<"Please enter a number:";
<DIV></DIV>> cin>>thisisanumber;
<DIV></DIV>> cout<<"You entered: "<<THISISANUMBER; DIV <>> cin.get()
<DIV></DIV>> return 0;
<DIV></DIV>>}
<DIV></DIV>>
<DIV></DIV>>I'm stuck, and I'm trying to teach myself C++. Your help is greatly
<DIV></DIV>>appreciated.
<DIV></DIV>>
<DIV></DIV>>Sincerly,
<DIV></DIV>>Aaron
<DIV></DIV>
<DIV></DIV>--
<DIV></DIV>gisan
<DIV></DIV>gi...@li...
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>_______________________________________________
<DIV></DIV>Dev-cpp-users mailing list
<DIV></DIV>Dev...@li...
<DIV></DIV>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
<DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_etl_EN.asp'>http://explorer.msn.com</a>.<br></html>
|
|
From: Benjamin W. <ben...@ho...> - 2002-02-13 17:42:52
|
<html><div style='background-color:'><P>If we are having to tolerate his auto response, then I hope that he is at least still using the list. </P> <P>I'm like you though...I swap back and forth between Visual C++, Borland C++ Builder, Borland C++ 5.5 command line compiler and DevC++...so I just "lurk" on the list and listen to the banter back and forth.</P> <P>There are often many educational, informational, and occasionally amusing topics being discussed. Bottom line -- I enjoy the company of others around the world whose interests are similar to mine (at least in this venue).</P> <DIV></DIV> <DIV><FONT face="Geneva, Arial, Sans-serif" size=2>Benjamin Wheeless</FONT></DIV> <DIV></DIV> <DIV><FONT face="Geneva, Arial, Sans-serif" size=2><STRONG>Network Systems - Delta Airlines, Inc.</STRONG></FONT></DIV> <DIV></DIV> <DIV><FONT face=Arial size=2><STRONG>Atlanta, GA - USA 30320</STRONG></FONT></DIV> <DIV></DIV> <DIV><FONT face=Arial size=2><STRONG>==============================</STRONG></FONT></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>----Original Message Follows---- <DIV></DIV>From: "Daniel Glenfield" <SP...@HO...> <DIV></DIV>To: ben...@ho..., jsc...@gm..., dev...@li... <DIV></DIV>Subject: Re: [Dev-C++] unsub hazzle <DIV></DIV>Date: Wed, 13 Feb 2002 17:20:52 +0000 <DIV></DIV> <DIV></DIV><< message3.txt >> <DIV></DIV></div><br clear=all><hr>Send and receive Hotmail on your mobile device: <a href='http://go.msn.com/bql/hmtag2_etl_EN.asp'>Click Here</a><br></html> |
|
From: <gi...@li...> - 2002-02-13 17:37:27
|
Hello Aaron,
since you are developing console applications, my suggestion is: run them
from the console. In fact, when you use the console, there is no need to
add "cin.get" or "system("PAUSE")" or any other special instruction
preventing Windows from closing the window :-)
For instance, the following code would work as expected:
#include <iostream>
int
main()
{
std::cout << "Please enter a number:";
int n;
std::cin >> n;
std::cout << "You entered: "<< n << '\n';
}
At 13:43 12/02/02 -0500, Aaron wrote:
>Hello...
>
>I have a question about closing a terminal window during a C++ program
>execution. I am using Dev C++ 4.01 as my compiler. At
>http://www.cprogramming.com/close.html, it says that inserting the line
>cin.get() before the return 0 line will keep the terminal window open
>until I press enter. This I find is true for the following program:
>
>#include <iostream.h>
>int main()
>{
> cout<<"The Compiler Works";
> cin.get()
> return 0;
>}
>
>
>However for the following code, I type my number, press enter, and the window
>closes immediately. Why doesn't the compiler display "You entered: ", then my
>number, and then close the terminal window once I push enter (which would be
>the second time)?? Am I putting the cin.get() statement in the wrong spot??
>Check out the code I'm using.
>
>#include <iostream.h>
>int main()
>{
> int thisisanumber;
> cout<<"Please enter a number:";
> cin>>thisisanumber;
> cout<<"You entered: "<<thisisanumber;
> cin.get()
> return 0;
>}
>
>I'm stuck, and I'm trying to teach myself C++. Your help is greatly
>appreciated.
>
>Sincerly,
>Aaron
--
gisan
gi...@li...
|
|
From: Daniel G. <sp...@ho...> - 2002-02-13 17:21:11
|
<html><div style='background-color:'><DIV> <P>Could well be. Do you think that chap whose email server sends a response actually bothers to read these?</P> <P>I don't use DEV anymore but I stay on the list as I get to learn a lot from other users.<BR><BR></P></DIV> <DIV></DIV> <DIV></DIV>>From: "Benjamin Wheeless" <BEN...@HO...> <DIV></DIV>>To: jsc...@gm..., dev...@li... <DIV></DIV>>Subject: Re: [Dev-C++] unsub hazzle <DIV></DIV>>Date: Wed, 13 Feb 2002 11:45:45 -0500 <DIV></DIV>> <DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_etl_EN.asp'>http://explorer.msn.com</a>.<br></html> |
|
From: Benjamin W. <ben...@ho...> - 2002-02-13 16:46:01
|
<html><div style='background-color:'><DIV> <P>Beats me...does it have to do with this Auto Response that I keep getting from someone each time an email is sent to the distribution list?</P></DIV> <DIV></DIV> <DIV><FONT face="Geneva, Arial, Sans-serif" size=2>Benjamin Wheeless</FONT></DIV> <DIV></DIV> <DIV><FONT face="Geneva, Arial, Sans-serif" size=2><STRONG>Network Systems - Delta Airlines, Inc.</STRONG></FONT></DIV> <DIV></DIV> <DIV><FONT face=Arial size=2><STRONG>Atlanta, GA - USA 30320</STRONG></FONT></DIV> <DIV></DIV> <DIV><FONT face=Arial size=2><STRONG>==============================</STRONG></FONT></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>----Original Message Follows---- <DIV></DIV>From: "Jürgen Schuhmacher" <JSC...@GM...> <DIV></DIV>Reply-To: jsc...@gm... <DIV></DIV>To: dev...@li... <DIV></DIV>Subject: [Dev-C++] unsub hazzle <DIV></DIV>Date: Wed, 13 Feb 2002 17:39:14 +0100 <DIV></DIV> <DIV></DIV>Anybody knows, why there is such a "unsub horror" today ? <DIV></DIV> <DIV></DIV>jürgen <DIV></DIV> <DIV></DIV> <DIV></DIV>_______________________________________________ <DIV></DIV>Dev-cpp-users mailing list <DIV></DIV>Dev...@li... <DIV></DIV>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_etl_EN.asp'>http://explorer.msn.com</a>.<br></html> |
|
From: <jsc...@gm...> - 2002-02-13 16:39:14
|
Anybody knows, why there is such a "unsub horror" today ? j=FCrgen |
|
From: A. E. H. <ze...@ze...> - 2002-02-13 16:13:09
|
Your mail received. Thank You, A. Erdogan Horzum www.zetamuhendislik.com |