• 0

Programming help!


Question

Hey guys, posted this in the newbie section, but technically i`m not a newbie!

"Hey guys, i need some BIG help.

Its the last 2 weeks of my computing course at college and i am panicking over my program, the tutor isn't allowed to help me with the program all he can do is say whether its wrong or right and what i need to do next etc.

Anyways, i have the program half done at least, but now i am completely stumped, i was wondering if someone here could add me on msn and help me finish the program, i wouldn't bother asking but i suck at it and its not my strong side not to mention its a required credit to pass HNC computing! "

Link to comment
Share on other sites

Recommended Posts

  • 0

Guy, are you kidding me??? You want us to help you cheat? At least you're honest about it.

Link to comment
Share on other sites

  • 0
Guy, are you kidding me??? You want us to help you cheat? At least you're honest about it.

No not cheat, help me out, ive got like all the parts in the programme, i just cant get it to run, it has loads of errors which i dont know how to resolve!

Link to comment
Share on other sites

  • 0
No not cheat, help me out, ive got like all the parts in the programme, i just cant get it to run, it has loads of errors which i dont know how to resolve!

You're asking people to do your work for you. The point of your class is to learn how to do the work. If you don't understand enough to complete the final project on your own, you do not deserve the credit.

Link to comment
Share on other sites

  • 0

If you have any specific question, please do so. On major programming assignments, I usually spent above 12 hours, including long nights deep in the morning. It's normal to get stuck, but you also have to learn how to find solutions, including where to get help. That doesn't include getting someone to do it for you.

Link to comment
Share on other sites

  • 0

First, stop panicking. What language, and can you describe the problem you're having? I'm sure we can try to guide you...

Link to comment
Share on other sites

  • 0

We won't do it for u... how about u post the errors here.. we might be able to tell you what the errors mean. What programming language are you using?

Link to comment
Share on other sites

  • 0

Well, see thats the thing, i HATE programming, i don't want to learn it, its cluttering my brain, i have no interest in doing it after college but for HNC they insist you do it to pass, even though next year im doing technical support which requires Zero programming.

I basically could do it if i really wanted to, but i don't.

I have done as much as my brain will allow me to, i don't want to get into personal story's, but this program is the last of my worries and i was really hoping someone would be kind enough to iron the problems out, i just sit and stare at it and cant figure out how to get it to compile.

Heres the program in its entirity so far.

/* Program  :submenus.cpp
Synopsis  :A menu template which uses a subMenu also


 Author  :Cameron Hunter
 Date   :17/3/2009

*/

#include <n:\cpp\input.h>
#include <time.h>
struct cust
{
 int custno;
 char name [31], street [26], town [17], houseno [5], postcode [9], phonenumber [12];
 float credit, totalsale, curbal;
 boolean deleted;

};
void customers();
void menu();  
void subMenu();
void pick(cust customers[], int &row);
void add(cust customers[], int &row);
void DisplayAll (cust customers[], int row);
void del();
void search();
void searchByNumber();
void searchByName();
void showCust
void quit();
void presskey();
void errorMsg(char errormsg[]);
int option=0;




void main()
{
 setupio();
 time_t t;
 time(&t);
 gotoxy(50,2);
 cout << ctime(&t);
 cust customers [200];
 int row=0;
 do
 {
  menu();
  pick(customers,row);

 }
 while ( option != 4 );
}

void pick(cust customers[], int &row)
{
 if ( option == 1 )
  add(customers,row);
 else if ( option == 2 )
  DisplayAll (customers,row);
 else if ( option == 3 )
  search();
 else if ( option == 4 )

 else {
  errorMsg("Invalid Option");  
 }
} 



void add(cust customers[], int &row)
{
 clrscr();
 cout << "Add customer\n";

 gotoxy(15,7);
 cout<< "Enter customer number : ";
 Input (customers [row].custno);

 gotoxy(15,9);
 cout<< "Enter customer Name : ";
 Input (customers [row].name,31);


 gotoxy(15,11);
 cout<< "Enter customer House number/name : ";
 Input (customers [row].houseno,5);

 gotoxy(15,13);
 cout<< "Enter customer Street  : ";
 Input (customers [row].street,26);


 gotoxy(15,15);
 cout<< "Enter customer Town : ";
 Input (customers [row].town,17);


 gotoxy(15,17);
 cout<< "Enter customer Postcode : ";
 Input (customers [row].postcode,9);


 gotoxy(15,19);
 cout<< "Enter customer Phone Number including area code : ";
 Input (customers [row].phonenumber,12);


 gotoxy(15,21);
 cout<< "Enter customer Total Sales to Date : ";
 Input (customers [row] .totalsale);


 gotoxy(15,23);
 cout<< "Enter customer Credit : ";
 Input (customers [row].credit);


 gotoxy(15,25);
 cout<< "Enter customer Current Balance : ";
 Input (customers [row].curbal);



 customers[row].deleted = false;

 if ( row == 1 )
  customers[1].deleted = true;

 row++;
 presskey();

}

void DisplayAll (cust customers[], int row)
{

 clrscr();
 int sub=0;

 while (sub < row )
 {
  if (customers[sub].deleted == false)

  {
   cout << customers [sub].custno << " "
    << customers [sub] .name << " "
    << customers[sub].street << " "
    << customers [sub].town << " "
    << customers [sub] .houseno << " "
    << customers[sub].postcode<< " "
    << customers [sub].phonenumber << " "
    << customers [sub] .name << endl;

  }
  sub++;

 }
 presskey();

}

void search ()
{

 clrscr();
 cout<<"search\n";
 presskey();

}

void quit ()

{
 clrscr();
 cout << "quit\n";

}




void menu()
{
 clrscr();
 cout << " Menu\n\n\n";
 cout << "1 Enter Customer Details\n";
 cout << "2 View all Customer details\n";
 cout << "3 Search by Town\n";
 cout << "4 View individual Customer details\n";
 cout << "5 Management report\n";
 cout << "6 View Average Sales\n"; 
 cout << "7 Quit\n";
 cout << "\n\n\n Option : ";


 Input(option);
}


void searchByNumber()
{
 clrscr();
 cout << "search by number\n";
 presskey();
}

void searchByName()
{
 clrscr();
 cout << "search by name\n";
 presskey();
}

void subPick()
{
 if ( option == 1 )
  searchByNumber();
 else if ( option == 2 )
  searchByName();
 else if ( option == 3 );
 else {
  errorMsg("Invalid Option");  
 }
} 

void subMenu()
{
 clrscr();
 cout << "Menu\n";
 cout << " 1 Search By Number\n";
 cout << " 2 Search By Name\n"; 
 cout << " 3 Quit\n";
 cout << "Option : ";
 Input(option);
}
void presskey()
{
 gotoxy(1,24);
 cout << "Press Return to Continue : ";
 getchar();
}

void errorMsg(char errormsg[])
{
 gotoxy(1,23);
 cout << errormsg;
 presskey();
}

void fillArray(cust customers[], int &rows);
char name[21];


/*do
{
 cout << "Enter name to find : " ;
 Input(name,21);

 boolean found = false;
 for ( int i=0;i<rows;i++ )
 {

  if ( strnicmp(customers[i].name, name, strlen(name) ) == 0 )
  {
   found = true;
   showCust(customers[i]);
  }
 }
 if ( found == false )
  cout << "Not found\n";
}
while ( 1 == 1 );
}


void showCust(cust onerecord);
{
 cout << onerecord.custno << " "
  << onerecord.name << " "
  << onerecord.credit << endl;
}
*/

void fillArray(cust customers[], int &rows)
{
 customers[rows].custno = 1001;
 strcpy(customers[rows].name, "Jim Smith");
 customers[rows].credit = 2000.75;
 rows++;

 customers[rows].custno = 1002;
 strcpy(customers[rows].name, "Jane Wilson");
 customers[rows].credit = 1000.50;
 rows++;

 customers[rows].custno = 1007;
 strcpy(customers[rows].name, "Sam Brown");
 customers[rows].credit = 1077.27;
 rows++;

 customers[rows].custno = 1009;
 strcpy(customers[rows].name, "Derek Garvie");
 customers[rows].credit = 2134.50;
 rows++;
}

Link to comment
Share on other sites

  • 0

As already stated specify which language you're programming in, and list some of the errors you don't understand. Better yet post some of your code and I'm sure people here will be happy to help out. If you show some sort of effort people are more inclined to help you help yourself.

edit: Please post it in code tags rather than spoiler...

Link to comment
Share on other sites

  • 0

Looks like C++ to me. I'm guessing he is using the borland c++ compiler as he's using gotoxy() which I believe comes from a library that the borland c++ compiler includes.

Link to comment
Share on other sites

  • 0
I`m using C++, we use visual basic 6 at the college.

VB6 for C++? I know they have Visual C++ 6 for C++ but never heard of using the VB6 IDE for C++ coding...

Link to comment
Share on other sites

  • 0
I basically could do it if i really wanted to, but i don't.

Doesn't really make me want to help you with an attitude like that. Anyway, I looked at your code and it didn't seem that bad. Most of the warnings I got were for unused variables you've declared and not used, few semi-colons missings etc. Assuming you actually wrote this code, you're nearly there. Plenty of time to fix those errors, just take them one at a time.

Link to comment
Share on other sites

  • 0
VB6 for C++? I know they have Visual C++ 6 for C++ but never heard of using the VB6 IDE for C++ coding...

Hmm, well we use visual basic 6..... im 99% sure its C++ lol

Doesn't really make me want to help you with an attitude like that. Anyway, I looked at your code and it didn't seem that bad. Most of the warnings I got were for unused variables you've declared and not used, few semi-colons missings etc. Assuming you actually wrote this code, you're nearly there. Plenty of time to fix those errors, just take them one at a time.

Well, im just really annoyed with it, its stressing me out so much right now and ive basically forced myself to learn it, glad it seems ok to you!

I im sure i have to add a few more things, i just wanted to iron out any initial problems before adding it in.

Thanks for the encouragement though :-)

Link to comment
Share on other sites

  • 0
.... Most of the warnings I got were for unused variables you've declared and not used, few semi-colons missings etc. Assuming you actually wrote this code, you're nearly there. Plenty of time to fix those errors, just take them one at a time.

+1

I take it you're using a compiler that will show you warnings and errors, if not get one (I would recommend the borland c++ compiler mentioned above) and just fix them one at a time as ViZioN said.

Good Luck!

Link to comment
Share on other sites

  • 0
Hmm, well we use visual basic 6..... im 99% sure its C++ lol

i think maybe you mean visual studio 6. last time i checked Visual Basic 6 was for VB6 coding (which is an entirely different language from C++). Visual Studio 6 (software suite) includes Visual Basic 6 and Visual C++ 6 along with other tools...

Link to comment
Share on other sites

  • 0

Firstly, make sure you are using the correct compiler and development environment for your language. Know what the commands you are trying to use do, where they come from and how they work. Anything non standard may not work. Trying to get C++ compiled in a VB6 compiler will only cause pain!

Read the error messages and tackle them one by one in a logical fashion. Fixing one issue can often get rid of several messages (e.g. a spelling mistake).

Any decent compiler will give you an indication as to where it came from, such as a line number. Go to the line and re check what you wrote, compare it to other code, examples off the web that are trying to do the same thing. This can occasionally be deceptive, so check lines above and below. Compile time issues tend to be things like missing a bracket or semi colon, unused variables, spelling errors as the compiler checks everything is present and correct before it produces the executable.

When it compiles but doesn't do what it's meant to, you need to use debugging tools. The most basic thing is to print out what it's doing by printing important variables at various points.

Lastly, if you want to get into tech support, programming skills can still really help. It gives you practice at problem solving and thinking logically, and a greater understanding of how computers work.. so at least look at it as helping you :)

Link to comment
Share on other sites

  • 0
Guy, are you kidding me??? You want us to help you cheat? At least you're honest about it.

Something I'd just like to point out as a programming student myself -

How do you think people learn? By asking people to help them understand something. You can't just expect people to know how to program anything in any language - they have to be taught. Sometimes, teachers are useless and you have to find out how to do some things from other sources. With this forum being in the following location - "Help & Discussion Center ? Programming (C#, C++, JAVA, VB, .NET etc.)" - >I'd assume threads asking for help on certain programming issues are meant to be posted in here?

There's a big difference between asking for help on something and asking somebody to do the work for you. If you're a programmer yourself, then I'm sure you'd know how challenging it can be when you're still learning a lot of the things. I'm sure you've asked or searched for help on things before?

That's just my 2 cents. The author of this thread only asked for help in his first post, he didn't ask for somebody to do it for him. Not to mention that his tutor can't help him, that doesn't mean that others and the Internet can't.

Link to comment
Share on other sites

  • 0
Something I'd just like to point out as a programming student myself -

How do you think people learn? By asking people to help them understand something. You can't just expect people to know how to program anything in any language - they have to be taught. Sometimes, teachers are useless and you have to find out how to do some things from other sources. With this forum being in the following location - "Help & Discussion Center ? Programming (C#, C++, JAVA, VB, .NET etc.)" - >I'd assume threads asking for help on certain programming issues are meant to be posted in here?

There's a big difference between asking for help on something and asking somebody to do the work for you. If you're a programmer yourself, then I'm sure you'd know how challenging it can be when you're still learning a lot of the things. I'm sure you've asked or searched for help on things before?

That's just my 2 cents. The author of this thread only asked for help in his first post, he didn't ask for somebody to do it for him. Not to mention that his tutor can't help him, that doesn't mean that others and the Internet can't.

Yes, thank you.

I have done pretty much all of the program myself and i have got as far as i can with my own knowledge, i just needed help ironing out the few problems with the program for it to work.

Link to comment
Share on other sites

  • 0
Something I'd just like to point out as a programming student myself -

How do you think people learn? By asking people to help them understand something. You can't just expect people to know how to program anything in any language - they have to be taught. Sometimes, teachers are useless and you have to find out how to do some things from other sources. With this forum being in the following location - "Help & Discussion Center ? Programming (C#, C++, JAVA, VB, .NET etc.)" - >I'd assume threads asking for help on certain programming issues are meant to be posted in here?

There's a big difference between asking for help on something and asking somebody to do the work for you. If you're a programmer yourself, then I'm sure you'd know how challenging it can be when you're still learning a lot of the things. I'm sure you've asked or searched for help on things before?

That's just my 2 cents. The author of this thread only asked for help in his first post, he didn't ask for somebody to do it for him. Not to mention that his tutor can't help him, that doesn't mean that others and the Internet can't.

Exactly. Because he's in school, he wants people to help him cheat. If he was working as a dev, and asked the forum and/or a fellow developer, that's just helping someone out.

Link to comment
Share on other sites

  • 0
Exactly. Because he's in school, he wants people to help him cheat. If he was working as a dev, and asked the forum and/or a fellow developer, that's just helping someone out.

If there is nothing in his school or college guidelines which state he can't use the Internet for help, then what is wrong with asking for help here or elsewhere? Our university encourages us to use the Internet as a resource to aid us.

Link to comment
Share on other sites

  • 0
If there is nothing in his school or college guidelines which state he can't use the Internet for help, then what is wrong with asking for help here or elsewhere? Our university encourages us to use the Internet as a resource to aid us.

I agree. Use the Internet as a resource. Life as a dev is always open book.

Link to comment
Share on other sites

  • 0

Yeah thats true, our college points us to the internet for everything really, i have to write an 1800 word essay on telecommunications, they linked us to wikipedia and basically said to use all the information applicable from there.

Its the same with the programming, the lecturer cant do my work for me, but he doesn't object to others helping each other out in class, you just cant directly copy someone elses work.

He even told us that most work he has done he always keeps and just copy's and pastes whenever necessary.

Link to comment
Share on other sites

  • 0
If there is nothing in his school or college guidelines which state he can't use the Internet for help, then what is wrong with asking for help here or elsewhere? Our university encourages us to use the Internet as a resource to aid us.

Asking for help would be giving the errors he is seeing, I have yet to see them in this thread. Pasting the code doesn't tell anyone about the problems and gives the impression of 'here is my code, please fix it' even if it isn't worded like that.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.