I am unable to solve the errors found in this program. Can someone be kind to help me solve it? Thanking in advance. :)

#include "stdafx.h"   
#include <iostream>   
using namespace::std;
class detail
{
protected:
char address[50];
int age;
char name[25];

public:
int a;
int b;
int c;
void getdetail(void)
{
cout<<"Enter NAME :-";
cin>>name;
cout<<"Enter AGE :-";
cin>>age;
cout<<"Enter ADDRESS :-";
cin>>address;
}
void displaydetail(void)
{
cout<<"\n NAME :-"<<name;
cout<<"\n AGE :-"<<age;
cout<<"\n ADDRESS :-"<<address;
}
void getcalc(void)
{
cout<<"Enter Java Programming marks";
cin>>a;
if (mark 0<a<50);
{
Cout<<”C”<<endl;
}
Else if (51<a<70)
{
Cout<<”B”<<endl;
}
Else(71<a<100)
{
Cout<<”A”<<endl;
}
cout<<"Enter Programming Concept marks";
cin>>b;
if (mark 0<a<50);
{
Cout<<”C”<<endl;
}
Else if (51<a<70)
{
Cout<<”B”<<endl;
}
Else(71<a<100)
{
Cout<<”A”<<endl;
}
cout<<"Enter Programming Concept marks";
cin>>b;
cout<<"Enter End User marks";
cin>>c;
}
cout<<"Enter End User marks";
cin>>c;
if (mark 0<a<50);
{
Cout<<”C”<<endl;
}
Else if (51<a<70)
{
Cout<<”B”<<endl;
}
Else(71<a<100)
{
Cout<<”A”<<endl;
}
cout<<"Enter Programming Concept marks";
cin>>b;
cout<<"Enter End User marks";
cin>>c;
}
}
void discalc(void)
{
cout<<"\n Java Programming :-"<<a;
cout<<"\n Programming Concepts :-"<<b;
cout<<"\n End User :-"<<c;
}
};
class teacher : public detail
{
double icno;
char subject[15];
char education[35];
char experience[40];

public:
void create(void)
{
getdetail();
cout<<"Enter SUBJECT :-";
cin>>subject;
cout<<"Enter ICNO :-";
cin>>icno;
cout<<"Enter EDUCATION :-";
cin>>education;
cout<<"Enter EXPERIENCE :-";
cin>>experience;
}
void display(void)
{
displaydetail();
cout<<"\n ICNO :-"<<icno;
cout<<"\n EDUCATION :-"<<education;
cout<<"\n EXPERIENCE :-"<<experience;
cout<<"\n SUBJECT :-"<<subject;
}
};
class student : public detail
{
int rollno;
char grade;
char father[30];
char mother[30];
char bookid[35];
public:
void create(void)
{
getdetail();
getcalc();
cout<<"Enter FATHER'S NAME :-";
cin>>father;
cout<<"Enter MOTHER'S NAME :-";
cin>>mother;
cout<<"Enter ROLL NUMBER :-";
cin>>rollno;
cout<<"Enter GRADE :-";
cin>>grade;
cout<<"Enter BORROWED BOOK NAME :-";
cin>>bookid;
}
void display(void)
{
displaydetail();
discalc();
cout<<"\n FATHER'S NAME :-"<<father;
cout<<"\n MOTHER'S NAME :-"<<mother;
cout<<"\n ROLL NUMBER :-"<<rollno;
cout<<"\n GRADE :-"<<grade;
cout<<"\n BORROWED BOOK NAME :-"<<bookid;
}
};

void main()
{

teacher o1t[10];
student o1o[10];
int choice,i;
char test;
int count;
start:
 
	cout<<"\n=====SOFTWARE ENGINEERING SCHOOL=====\n\n\n";
	cout<<"Choose Category of Information\n";
	cout<<"1)   Teachers\n";
	cout<<"2)   Student\n";
	cout<<"3)   Exit\n";
	cout<<"Enter your choice:-";
	cin>>choice;
	switch(choice)
	{
		case 1 :  while(1)
		  {
		  
		  cout<<"\n=====TEACHERS INFORMATION=====\n\n";
		  cout<<"\nChoose your choice\n";
		  cout<<"1) Create\n";
		  cout<<"2) Display\n";
		  cout<<"3) Jump to Main Menu\n";
		  cout<<"Enter your choice:-";
		  cin>>choice;
		  switch(choice)
		  {
			case 1 :  for(count=0,i=0;i<10;i++)
					{
					  cout<<endl;
					  o1t[i].create();
					  count++;
					  cout<<endl;
                 cout<<"\n\nAre you Interested in entering data\n";
                 cout<<"Enter y or n:-";
                 cin>>test;
                 if(test=='y' || test=='Y')
                continue;
					  else
					  goto out1;
					  }
                 out1:
                 break;
         case 2 : for(i=0;i<count;i++)
               {
                cout<<endl;
                 o1t[i].display();
                 cout<<endl;
					}
              
               break;
         case 3 : goto start;
         default: cout<<"\nEnter choice is invalid\ntry again\n\n";
         }
         }
      case 2 :   while(1)
			{
         
		  cout<<"\n=====STUDENT INFORMATION=====\n\n";
        cout<<"\nChoose your choice\n";
        cout<<"1) Create\n";
        cout<<"2) Display\n";
		  cout<<"3) Jump to Main Menu\n";
        cout<<"Enter your choice:-";
		  cin>>choice;
		  switch(choice)
		  {
			case 1 : for(count=0,i=0;i<10;i++)
					{
					 cout<<endl;
					 o1o[i].create();
					  count++;
					  cout<<endl;
					  cout<<"\n\nAre you Interested in entering data\n";
					  cout<<"Enter y or n:-";
					  cin>>test;
					  if(test=='y' || test=='Y')
					 continue;
					  else
					  goto out2;
					  }
					  out2:
					  break;
			case 2 : for(i=0;i<count;i++)
					{
					 cout<<endl;
					  o1o[i].display();
					  cout<<endl;
					}
					
					break;
					case 3 : goto start;
			default: cout<<"\nInvalid choice\ntry again\n\n";
			}
			}
         case 4 : goto end;
					 
	 }
end:;
}

Recommended Answers

All 2 Replies

In your getCalc function, make cout and else and if statements lowercase

34. if (mark 0<a<50);

'mark' is nt supposed to be there, or were u trying to write 'mark<0<a<50'?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.