Assignment No 2 Spring 2018
Dear Students, Here you can read or Download CS201 - Introduction to Programming Assignment No 2 Solution and Discussion of Semester Spring 2018. Assignment Due Date is 28 MAY, 2018. Total Marks are 20. We are here to facilitate your learning and we do not appreciate the idea of copying or replicating solutions. CS201 Assignment No 2 Solution File has been added. Previously we shared CS201 Assignment No 1 Solution Spring 2018.CS201 Assignment No 2 Solution and Discussion Spring 2018 |
CS201 Assignment Question No 1:
Write a program in C++ that will ask some programming related questions () from user and rank user according his / her answers in one of following categories:- Beginner level
- Intermediate level
- Advanced level
You have to create a function named computeUserLevel () and pass that array to this function and receive the array as pointer within the function declaration. The function will determine and print the result that whether you are a beginner, intermediate or advance level user. If a user is not able to correctly answer any of the questions then user level will be set as beginner.
Please Note: Only use the following programming constructs in your program:
- A Character Array
- For Loop
- Switch Statement
- Function (Call by reference – receive array by using pointers)
- If else (only allowed in function)
Recommended : DevC++ Installation and Usage Complete Guidelines
Recommended:
CS201 Assignment Sample Output:
CS201 Assignment Sample Output Spring 2018 |
CS201 Assignment No 2 Solution Spring 2018
You can see the Sample Preview of CS201 Assignment No 2 Solution provided by (Virtual Study Solutions) below. Click on Download Button to Download Solution File in Your PC. Please Share it with your friends. You can also like our Facebook Page or Subscribe Us below for Updates.Recommended:
- Write ALLAH Using C++ Program
- CS201 VIVA Preparation Helping Material
- CS201 Most Important Questions for VIVA
- CS201 Solved Short Notes 2017
- CS201 Solved Subjective Midterm Past Paper - 2009
- CS 201 solved midterm Past Papers Download 2015
CS201 Assignment Solution Sample Preview
Solution Idea File Sample Page Preview has been added with Solution File.
#include <iostream> using namespace std; void computeUserLevel (char *) ; int main() { char Y [4]; for (int k=0; k<=0; k++) { cout<<"arrays and pointers are same : "; cin>> Y[0]; cout<<"switch is a loop : "; cin>> Y[1]; cout<<"pointers store memory addresses : "; cin>>Y[2]; } computeUserLevel(Y); return 0; } void computeUserLevel (char *ptr) { if (*ptr == 'f' && *(ptr+1) == 'f' && *(ptr+2) == 't') { cout<<"your level is Advance"; } else if (*ptr == 't' && *(ptr+1) == 'f' && *(ptr+2) == 't') { cout<<"your level is Intermediate"; } else cout<< "your level is Beginner"; }
plz correct the questions and it dont have switch statement
ReplyDeletecout << "Q: Switch is a Loop?\n" << "A: ";
cin >> Y[0];
cout << "Q: Pointer store memory address?\n" << "A: ";
cin >> Y[1];
cout << "Q: Semicolon after for loop is an error?\n" << "A: ";
cin >> Y[2];
#include
Deleteusing namespace std;
void computerUserLevel(char *);
int main()
{
char y[3];
for (int i=0; i<4; i++);
{
cout<<"Switch is a loop?"<>y[0];
cout<<"Pointer store memory address?"<>y[1];
cout<<"Semicolon after for loop is an error?"<>y[2];
}
computerUserLevel(y);
return 0;
}
void computerUserLevel (char *ptr)
{
if (*ptr=='f' && *(ptr+1)=='t' && *(ptr+2)=='f')
{
cout<<"Your level is advanced"<<endl;
}
else if (*ptr=='f' && *(ptr+1)=='t' && *(ptr+2)=='t')
{
cout<<"Your level is intermediate"<<endl;
}
else
{
cout<<"Your level is beginner"<<endl;
}
}
is this solution is true?
Deleteany one upload the solution of cs402 assign 2
ReplyDeleteThe Assignment give's an error "source file not compiled"
ReplyDeleteThere is some mistake in the file Please correct the error in the file.
plz upload correct solution file of cs201
ReplyDelete