c++

I will help you as best as I can but you need to mention what specific help you need.

Do you have trouble with loops?
Do you have trouble with scope?

Is there something that doesn't make sense?
 
Lets take it 1 step at a time.

So the first thing is to create a menu.

You can create a menu in the main function or you can create the menu in a new function.

Have you created your menu?

What are you currently up to?
 
sorry bout delayed reply my school network been down. well first teacher is teaching us about classes and linked lists today then I'm going to start on coding this afternoon. If our networks still up ill post the code for u of what i've got.
 
here is my main .cpp file

#include <iostream.h>



cout&lt;&lt;"*******************************"&lt;&lt;endl;
cout&lt;&lt;"*** 1.New Flight ***"&lt;&lt;endl;
cout&lt;&lt;"*** 2.Delete Flight ***"&lt;&lt;endl;
cout&lt;&lt;"*** 3.Modify Duel ***"&lt;&lt;endl;
cout&lt;&lt;"*** 4.Modify P.I.C. ***"&lt;&lt;endl;
cout&lt;&lt;"*** 5.Print Log ***"&lt;&lt;endl;
cout&lt;&lt;"*** 6.Print Specific Flight ***"&lt;&lt;endl;
cout&lt;&lt;"*** 7.Sort Ascending ***"&lt;&lt;endl;
cout&lt;&lt;"*** 8.Exit Program ***"&lt;&lt;endl;
cout&lt;&lt;"*******************************"&lt;&lt;endl;
cout&lt;&lt;"Please enter the number of your choice: ";
cin>>num_choice;

switch (num_choice)
{
case 1:

then here is my...... well crap i had my header file but left it at the lab :( it had my class declarations on it. ill get it and post it for ya. I'm using visual studio 6.0 for the class. If ya wanna throw anything in there plz be my guest.
 
You have the source file itself with you?
I don't need the header file as I don't want to do the work for you.
I just want to help out if you have any specific problem.

Have you got a plan?

Have you done the stubs first? If not you should make a stub version of your program.

By the looks of it you have the menu set up nicely.

You enter a choice.

I see you have to make the functions inside a class.

I would do the class functions externally as it would be easier IMO.

I would do the exit program function next as it's the easiest.

NewFlight should be done after the exit function then printLog function.

I would finish off the easiest functions first.
 
stubs?

I'm prototyping functions in the other file but i hate myself because i forgot to email the new saved version i had instead i emailed myself the empty version :( I'm doing the menu basically the way he's structured it on the site. So u think that i could switch around and then do the menu another way? How? The functions are going to be in another file and called to appropriately within the switch statement as first i have to create the functions to know what to pass and call :( so i just havent made the call with another #include file at the top. Were having an inclass project day tomorrow so i'll get revised files and hopefully all three of em posted when i get some done. Thx so far. Hey u got a pentium system???
 
sweet dude. well i got a laptop to program on and now i have 2 revisions of the program, one that works and one that doesnt. I'm getting the laptop way i want it ill post the files as soon as i get it all sorted out.
 
alright sorry for delay. I am now on another project however. One that requires me to use stacks. The user inputs filename and if it exists the prog reads the file and output whats in file. I got that but what teacher wants as well is hes going to have a file that has math equation in it. the prog has to give the postfix of the equation. example: Heres what will be in file 34+6/
Here is what the prog must output 3+4/6. I got the input of name the reading of whats in file but i dont know how to do the postfix changing of equation. Any help appreciated. here is what i have so far.

#include &lt;fstream.h>
#include &lt;stdlib.h>
#include <iomanip.h>

int main()
{
const int MAXLENGTH = 21;
const int MAXCHARS = 31;

char filename[MAXLENGTH];
char descrip [MAXCHARS];
int ch;

ifstream infile;

cout&lt;&lt;"Please enter the name of the file you wish to enter: ";
cin>>filename;

infile.open(filename, ios::nocreate);

if (infile.fail())
{
cout&lt;&lt;"\nThe file was not successfully opened"
&lt;&lt;"\n Please check that the file currently exists."
&lt;&lt;endl;
exit(1);
}

cout&lt;&lt;setiosflags(ios::fixed)
&lt;&lt;setiosflags(ios::showpoint)
&lt;&lt;setprecision(2);

cout&lt;&lt;endl;

while ( (ch = infile.peek()) != EOF )
{
infile>>descrip;
cout&lt;&lt;descrip&lt;&lt;' '&lt;&lt;endl;
}

infile.close();
cout&lt;&lt;endl;

return 0;

}
 
The Professor told you the answer.

"One that requires me to use stacks"

You have things being read in from a file in a certain order. You need to read them on to the stack (push), and then pop them off, and rearrange them for the postfix.

Do it manually with 2 stacks and a holder (char) on a piece of paper so you understand it.

Then write the code to do it.

Write some pseudo-code if you have to while doing it manually.

Speng.
 
not sure syntax for doing the push and pop. anywhere where theres a program showing a stack? I already wrote it out and such but not sure where to stick it either. plus when there is a space or other line after the equation it gives back junk. any suggestions??
 
Back
Top