Thursday, 24 May 2018

CS201 Assignment no 2 Solution 2018

/*
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");
}

Featured Post

All Answers of Quiz regarding to this course on Fiverr "Online Freelancing Essentials: Be A Successful Fiverr Seller"

To Clear All quiz of mentioned Course you can have a look on or check questions answers as well. Course name:  Online Freelancing Essentials...

Popular Posts