473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Stacks Queues Reverse Reverse Polish

I need help with an understanding and completing a project in C++ which
involves takingm a string of characters Example /*-A+BCDE as an input and
outputting a postfix expression ABC+-D*E/. I have to use a Stack and a Queue.

I have been given the following main function which I can not change.

#include"a:utility.h"
#incude"a:Stack.h"
#include"a:Queue.h"

// prototypes for input , pretopost, output and is operator go here

main()
{ Queue prefixQ, postfixQ;
char answer;
do
{input (prefixQ);
pretopost (prefixQ, postfixQ);
output(postfiQ);
cout<<endl<<"Continue? N for NO:";
cin<<answer;
} while (!(answer=='n' || answer'N'));
}

and what the heck are .h files am i supposed to write or copy some other
functions on the same target directory ?

Also Please be gentle with me i have limited c++ experience.

Confused biginner??? Thanks
Jul 19 '05 #1
4 4701

"dogbite" <aa******@yahoo.com> wrote in message news:4f**************************@posting.google.c om...
I have been given the following main function which I can not change.
If you can not change it, you are doomed. The code below isn't valid
C++.

#include"a:utility.h"
#incude"a:Stack.h"
#include"a:Queue.h" None of these include files are standard.

// prototypes for input , pretopost, output and is operator go here

main()
ERROR. All functions must have a declared return type. Main must have
a return type of int.
and what the heck are .h files am i supposed to write or copy some other
functions on the same target directory ?


I don't know what the heck they are, go gripe at your teacher for a valid file.
Jul 19 '05 #2
Ron Natalie wrote:
"dogbite" <aa******@yahoo.com> wrote in message news:4f**************************@posting.google.c om...

I have been given the following main function which I can not change.

If you can not change it, you are doomed. The code below isn't valid
C++.

#include"a:utility.h"
#incude"a:Stack.h"
#include"a:Queue.h"


None of these include files are standard.

// prototypes for input , pretopost, output and is operator go here

main()

ERROR. All functions must have a declared return type. Main must have
a return type of int.
and what the heck are .h files am i supposed to write or copy some other
functions on the same target directory ?

I don't know what the heck they are, go gripe at your teacher for a valid file.


not to mention that he has "cin << answer" instead of "cin >> answer"

Jul 19 '05 #3
"Ron Natalie" <ro*@sensor.com> wrote in message news:<3f*********************@news.newshosting.com >...
"dogbite" <aa******@yahoo.com> wrote in message news:4f**************************@posting.google.c om...
I have been given the following main function which I can not change.


If you can not change it, you are doomed. The code below isn't valid
C++.

#include"a:utility.h"
#incude"a:Stack.h"
#include"a:Queue.h"

None of these include files are standard.

I will change these files to standard files. and i have change the
cin>>answer typeo. Now the question is what should an algorithm for
this problem look like. I am stil having issue understanding queue and
stack operations

// prototypes for input , pretopost, output and is operator go here

main()


ERROR. All functions must have a declared return type. Main must have
a return type of int.

and what the heck are .h files am i supposed to write or copy some other
functions on the same target directory ?


I don't know what the heck they are, go gripe at your teacher for a valid file.


OK i just found out that .h files are copied from a section in the
book and are not included in the .ccp file but in the same directory.
It got this.
Jul 19 '05 #4
dogbite writes:
I am stil having issue understanding queue and
stack operations


A queue models the action you see in an orderly line waiting for the
services of a single bank teller, sometimes called first in first out or
FIFO. The British meaning of queue if that helps.

A stack models the action you see in the plate dispenser of a cafeteria,
sometimes called last in first out or LIFO.

It may help to write the infix (parenthesized) version of your test equation
and see how the other two versions were arrived at from that. Then, at
least, you would know the right answer if you got it.
Jul 19 '05 #5

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

Similar topics

1
by: ron | last post by:
have been stuck on this for several days now. I am trying to create a reverse polish calculator and I'm stuck at an intermediate stage. This is what I know I have to do (just not sure how to do it...
7
by: Anand Pillai | last post by:
The standard Python Queue module, allows to generate queues that have no size limit, by passing the size argument as <= 0. q = Queue(0) In a multithreaded application, these queues could be...
7
by: Philip Kofoed | last post by:
Greetings, I have a SQL server 2000 running on an english win2000 workstation. In a database I have a table where one varchar column is set to polish collation. Regional settings for the system...
4
by: Ice | last post by:
Hi there, I'm not sure if this is the right group for this- If it isn't, could anyone point me in the right direction? For our data structures exam, we are usually asked to implement the...
11
by: Steve Lambert | last post by:
Hi Anyone know how to convert a bracketed boolean expression into reverse polish? Cheers
2
by: Marcin Floryan | last post by:
Hello! How can I create an Installer entirely in Polish language using Deployment Project in VB.NET (I have already translated the available texts into Polish). I have .NET 2003 EN and I read I...
0
by: Larry Neylon | last post by:
Hi there, I'm currently trying to implement a website that will store and retrieve Polish, so I need to be able to handle Polish characters using classic ASP with MySql5. Does anybody have an...
1
by: romel | last post by:
Hi to all evryone? Anyone can help me regarding the program that i have?...i got problems about our topic that all about the QUEUE & STACKS.... I am begging you all that send...
4
by: robert.szczepanski | last post by:
Hi everybody; I can't change polish sign to small letter. This is my php script: <?php setlocale(LC_ALL, "pl_PL.UTF-8") ; //this function return "pl_PL.UTF-8"
11
mia023
by: mia023 | last post by:
Hello everyone. Assume that we have previously defined the following class StockPurchase that has the following as instance variables a) The name of the stock (a string) b) The number of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.