Student Registration System problem, error & question

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

52 Replies - 5756 Views - Last Post: 28 June 2012 - 03:57 PM Rate Topic: -----

#1 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

Student Registration System problem, error & question

Posted 06 June 2012 - 06:35 AM

I am trying to make a student registration with student login. It has the ability to register courses and check grades of previues courses he took semsters ago.

So the student first logins then he has option to either check grades or register courses. After the student selected the semester, he has two options either to register or to check grades. The registration lets the student select the semester for the current year and add multiple courses, also it has the option to drop them.

______________________________________________________________
These are code files to know what I'm planning.

SRS.cpp main project file
Spoiler


SRS.h is the parent class that has the public and private members.
Spoiler


Login.h Is a class that inherits from parent class it has login set& get functions
Spoiler


Courses.h Is a class that inherits from parent class it has courses set& get functions
Spoiler


grades.h Is a class that inherits from parent class it has grades set& get functions
Spoiler


This is DATA.txt it has the arrays but I commented the ifstream because compiler failed I am new to ifstreams
Spoiler


For the current codes there are compiler errors not related to syntax nor highlights its just errors I cannot solve it fails to build
Spoiler


The real problem I'm having is with the logic I do not know how to let the registered student assign a semester with 5 courses max in registration. Also I do not know how to assign a course with a grade.
I mean all of em are array of strings. I do not know how to implement the idea or the logic any suggestions.






_______________________________________________________________

This post has been edited by busta5000: 07 June 2012 - 10:25 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Student Registration System problem, error & question

#2 jimblumberg  Icon User is online

  • member icon


Reputation: 4076
  • View blog
  • Posts: 12,586
  • Joined: 25-December 09

Re: Student Registration System problem, error & question

Posted 06 June 2012 - 06:59 AM

Your errors that you can't figure out:

Quote

1>SRS.obj : error LNK2019: unresolved external symbol "public: void __thiscall SRSY::SRS::setlogin(void)" (?setlogin@SRS@SRSY@@QAEXXZ) referenced in function "void __cdecl SRSY::menu(void)" (?menu@SRSY@@YAXXZ)

Where have you implemented the SRS::setlogin() function?

Quote

1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

Where is your main() function?

You desperately need to find an indentation style you like and use it consistently. As your code is presented, without any logical formatting, it is very hard to read.


Jim
Was This Post Helpful? 1
  • +
  • -

#3 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 02:55 AM

View Postjimblumberg, on 06 June 2012 - 06:59 AM, said:

Your errors that you can't figure out:

Quote

1>SRS.obj : error LNK2019: unresolved external symbol "public: void __thiscall SRSY::SRS::setlogin(void)" (?setlogin@SRS@SRSY@@QAEXXZ) referenced in function "void __cdecl SRSY::menu(void)" (?menu@SRSY@@YAXXZ)

Where have you implemented the SRS::setlogin() function?

Quote

1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

Where is your main() function?

You desperately need to find an indentation style you like and use it consistently. As your code is presented, without any logical formatting, it is very hard to read.


Jim



I put every code in these spoilers my main function is in SRS.cpp there it executes setlogin.
setlogin is in login.h. please read the descriptions to know the location of whatever your looking for.

This post has been edited by busta5000: 07 June 2012 - 02:56 AM

Was This Post Helpful? 0
  • +
  • -

#4 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 03:02 AM

This is the setlogin function
void login::setlogin()//This is a function of ystem class, so mention that.
	{
	//int i; //You have to declare i before using it !!
    cin >> U[i];
	cin >> P[i];
	user = U[i];
	pass = P[i];

   for(i=1;i<20;i++)
   {
      if(U[i].size()==1 || P[i].size()==1)
         //go to admin class
		 break;
   
   else if(i==20)
   {
      cout << "All entries filled" ;
	  }
   }
	
	}



This is main function calling setlogin
#include <iostream>
#include <cstdlib>
#include <string>
#include "SRS.h"
#include "courses.h"
#include "login.h"
using namespace std;

namespace SRSY
{

//-----------------------------------
void main()
{
	SRS S1;
	

	int x;
cout<<"welcome to Student registration system"<<endl;
cout<<"======================================"<<endl;
cout<<"Select one of the choices below"<<endl;
cout<<"1.Register"<<endl;
cout<<"2.login"<<endl;
cin>>x;
if (x==1)
{
S1.setlogin();
}
else if (x==2)
{
S1.getlogin();
}
}

}




The entire code can be found in the spoilers above.
Was This Post Helpful? 0
  • +
  • -

#5 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 03:40 AM

View Postjimblumberg, on 06 June 2012 - 06:59 AM, said:

Your errors that you can't figure out:

Quote

1>SRS.obj : error LNK2019: unresolved external symbol "public: void __thiscall SRSY::SRS::setlogin(void)" (?setlogin@SRS@SRSY@@QAEXXZ) referenced in function "void __cdecl SRSY::menu(void)" (?menu@SRSY@@YAXXZ)

Where have you implemented the SRS::setlogin() function?

Quote

1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

Where is your main() function?

You desperately need to find an indentation style you like and use it consistently. As your code is presented, without any logical formatting, it is very hard to read.


Jim


I am surprised it seems you never read the error properly. I think its got something to do with external non related to the code I already mentioned that the error is related to symbols.
I clicked properties then linker then input these are the .lib included under additional dependencies
kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)



I think there is a missing library that I did not include and I do not know what and how to include it.
Was This Post Helpful? -1
  • +
  • -

#6 jimblumberg  Icon User is online

  • member icon


Reputation: 4076
  • View blog
  • Posts: 12,586
  • Joined: 25-December 09

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 06:00 AM

Quote

I am surprised it seems you never read the error properly. I think its got something to do with external non related to the code I already mentioned that the error is related to symbols.

No, I read the error messages but because of the horrible formatting I didn't look too closely at your code. This is definitely an issue with your code, not some missing lib file.

It seems that you have not properly read your errors properly.

In your original code there was no main(), it was called menu(). Also the function main() should not be within your SRSY namespace, it should be in the global scope.

I also still don't see an SRS::setlogin() function, I see a grades::setlogin(), a login::setlogin(), but no SRS::setlogin().

Also since you are playing with namespaces I recommend you stop using the using namespace std; clause, especially inside your header files. When you use this you are basically defeating the purpose of namespaces. By using this statement in your header file, every file that includes that header now has this using statement.


Jim

This post has been edited by jimblumberg: 07 June 2012 - 06:01 AM

Was This Post Helpful? 0
  • +
  • -

#7 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 06:20 AM

View Postjimblumberg, on 07 June 2012 - 06:00 AM, said:

Quote

I am surprised it seems you never read the error properly. I think its got something to do with external non related to the code I already mentioned that the error is related to symbols.

No, I read the error messages but because of the horrible formatting I didn't look too closely at your code. This is definitely an issue with your code, not some missing lib file.

It seems that you have not properly read your errors properly.

In your original code there was no main(), it was called menu(). Also the function main() should not be within your SRSY namespace, it should be in the global scope.

I also still don't see an SRS::setlogin() function, I see a grades::setlogin(), a login::setlogin(), but no SRS::setlogin().

Also since you are playing with namespaces I recommend you stop using the using namespace std; clause, especially inside your header files. When you use this you are basically defeating the purpose of namespaces. By using this statement in your header file, every file that includes that header now has this using statement.


Jim



I apologies for my mistakes. I edited few of the problems.
* menu changed to main
* removed using namespace std;
* removed SRSY namespace from SRS.cpp
* I did not write SRS::setlogin because its only accessable by login::Setlogin so only login class can setlogin. That is my goal its like read only for SRS.h but read & write in login.h
Was This Post Helpful? 0
  • +
  • -

#8 jimblumberg  Icon User is online

  • member icon


Reputation: 4076
  • View blog
  • Posts: 12,586
  • Joined: 25-December 09

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 06:31 AM

Quote

I did not write SRS::setlogin because its only accessable by login::Setlogin so only login class can setlogin. That is my goal its like read only for SRS.h but read & write in login.h


Then why are you trying to use the SRS class inside main()? You make an instance of SRS called S1 in main then try to call S1.setlogin(). This is calling SRS::setlogin(), which you have not implemented.

Also main should be defined as returning an int, int main() and you should return an int from this function.

Jim

This post has been edited by jimblumberg: 07 June 2012 - 06:31 AM

Was This Post Helpful? 0
  • +
  • -

#9 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 09:30 AM

View Postjimblumberg, on 07 June 2012 - 06:31 AM, said:

Quote

I did not write SRS::setlogin because its only accessable by login::Setlogin so only login class can setlogin. That is my goal its like read only for SRS.h but read & write in login.h


Then why are you trying to use the SRS class inside main()? You make an instance of SRS called S1 in main then try to call S1.setlogin(). This is calling SRS::setlogin(), which you have not implemented.

Also main should be defined as returning an int, int main() and you should return an int from this function.

Jim

I think your right it fixed it but there still is a missing symbol library.
Spoiler

I will edit the codes above if you want to see the changes.
Was This Post Helpful? -1
  • +
  • -

#10 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3579
  • View blog
  • Posts: 11,130
  • Joined: 05-May 12

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 09:53 AM

Please update the code so that we can see what changes you have done. Most of us do not have psychic abilities of mind reading or clairoyance, nor can we astrally project to see what is on your computer. :lol:

Please, please, please, take the 15 minutes to fix your indents.
Was This Post Helpful? 1
  • +
  • -

#11 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 10:03 AM

View PostSkydiver, on 07 June 2012 - 09:53 AM, said:

Please update the code so that we can see what changes you have done. Most of us do not have psychic abilities of mind reading or clairoyance, nor can we astrally project to see what is on your computer. :lol:

Please, please, please, take the 15 minutes to fix your indents.

I have changed the code before you posted this reply. After every suggestion I update my code above by clicking the edit button. Since the code is long and the font is small you might not notice small changes like replacing SRS S1 to login l1 for the recent post that I did minutes ago before you replied.
Was This Post Helpful? -1
  • +
  • -

#12 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3579
  • View blog
  • Posts: 11,130
  • Joined: 05-May 12

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 10:13 AM

I'm assuming you overlooked this:

View Postjimblumberg, on 07 June 2012 - 06:31 AM, said:

Quote

I did not write SRS::setlogin because its only accessable by login::Setlogin so only login class can setlogin. That is my goal its like read only for SRS.h but read & write in login.h


Then why are you trying to use the SRS class inside main()? You make an instance of SRS called S1 in main then try to call S1.setlogin(). This is calling SRS::setlogin(), which you have not implemented.

Also main should be defined as returning an int, int main() and you should return an int from this function.

Jim



Can you also add menu.h to your original post?

This post has been edited by Skydiver: 07 June 2012 - 10:14 AM

Was This Post Helpful? 0
  • +
  • -

#13 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 10:21 AM

View PostSkydiver, on 07 June 2012 - 10:13 AM, said:

I'm assuming you overlooked this:

View Postjimblumberg, on 07 June 2012 - 06:31 AM, said:

Quote

I did not write SRS::setlogin because its only accessable by login::Setlogin so only login class can setlogin. That is my goal its like read only for SRS.h but read & write in login.h


Then why are you trying to use the SRS class inside main()? You make an instance of SRS called S1 in main then try to call S1.setlogin(). This is calling SRS::setlogin(), which you have not implemented.

Also main should be defined as returning an int, int main() and you should return an int from this function.

Jim



Can you also add menu.h to your original post?


* I overlooked the idea menu.h I have deleted it from the code. It was an idea but then I think it was useless.

* For the setlogin SRS I fixed that issue already I have updated that there are problems related to symbols now check the spoiler for errors above.

* I am used to use int main but then the book I have started to use void when using classes. Anyways I have changed to int main the problem still exists and I have updated the code.
Was This Post Helpful? 0
  • +
  • -

#14 jimblumberg  Icon User is online

  • member icon


Reputation: 4076
  • View blog
  • Posts: 12,586
  • Joined: 25-December 09

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 10:38 AM

Do not edit your previous posts, this makes it harder for anyone else to see what has been happening, post your modified code in a new post.

From looking at your current error messages it looks like you are trying to compile a console app as a Win32 app. You need to insure your project is setup to compile a console app not the default Win32 app.

Jim

This post has been edited by jimblumberg: 07 June 2012 - 10:41 AM

Was This Post Helpful? 0
  • +
  • -

#15 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

Re: Student Registration System problem, error & question

Posted 07 June 2012 - 10:46 AM

______________________________________________________________
These are modified codes and as you said its down to see what I've done so far.

SRS.cpp main project file
Spoiler


SRS.h is the parent class that has the public and private members.
Spoiler


Login.h Is a class that inherits from parent class it has login set& get functions
Spoiler


Courses.h Is a class that inherits from parent class it has courses set& get functions
Spoiler


grades.h Is a class that inherits from parent class it has grades set& get functions
Spoiler


This is DATA.txt it has the arrays but I commented the ifstream because compiler failed I am new to ifstreams
Spoiler


For the current codes there are compiler errors not related to syntax nor highlights its just errors I cannot solve it fails to build
Spoiler

This post has been edited by busta5000: 07 June 2012 - 11:03 AM

Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »