/*
Regrads,
Muhammad Hamza Baig
Biggnerstart.blogspot.com
*/
#include <iostream>
using namespace std;
void computeUserLevel (char *) ;
int main()
{
cout<<"\t\tProgram To Predict User Programming Level"<<endl;
char Y [4];
for (int k=0; k<=0; k++)
{
cout<<"Q: Switch is a loop?\nA: ";
cin>> Y[0];
cout<<"Q: Pointers store memory addresses?\nA: ";
cin>> Y[1];
cout<<"Q: Semicolon after for loop is an error?\nA: ";
cin>>Y[2];
}
computeUserLevel(Y);
return 0;
}
void computeUserLevel (char *ptr)
{
if (*ptr == 'f' && *(ptr+1) == 't' && *(ptr+2) == 'f')
{
cout<<"Your level is advanced";
}
else if (*ptr == 'f' && *(ptr+1) == 't' && *(ptr+2) == 't')
{
cout<<"Your level is Intermediate";
}
else
cout<< "Your level is Beginner"<<endl;
system ("PAUSE");
}
Regrads,
Muhammad Hamza Baig
Biggnerstart.blogspot.com
*/
#include <iostream>
using namespace std;
void computeUserLevel (char *) ;
int main()
{
cout<<"\t\tProgram To Predict User Programming Level"<<endl;
char Y [4];
for (int k=0; k<=0; k++)
{
cout<<"Q: Switch is a loop?\nA: ";
cin>> Y[0];
cout<<"Q: Pointers store memory addresses?\nA: ";
cin>> Y[1];
cout<<"Q: Semicolon after for loop is an error?\nA: ";
cin>>Y[2];
}
computeUserLevel(Y);
return 0;
}
void computeUserLevel (char *ptr)
{
if (*ptr == 'f' && *(ptr+1) == 't' && *(ptr+2) == 'f')
{
cout<<"Your level is advanced";
}
else if (*ptr == 'f' && *(ptr+1) == 't' && *(ptr+2) == 't')
{
cout<<"Your level is Intermediate";
}
else
cout<< "Your level is Beginner"<<endl;
system ("PAUSE");
}