CS201 Assignment No 2 Solution Spring 2018 | Virtual Study Solutions

Adsetra Ads

 

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 3 Solution Spring 2019  Download 


CS201 Assignment No 2 Solution and Discussion Spring 2018
CS201 Assignment No 2 Solution and Discussion Spring 2018
Latest Update : CS201 Assignment No 2 Solution Fall 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:
  1. Beginner level
  2. Intermediate level
  3. Advanced level
For this purpose, your program will ask three questions from the user (as given in the screenshots below), record their response in the form of true and false (as T or F) and store it in a character array using for loop.

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:

  1. A Character Array
  2. For Loop
  3. Switch Statement
  4. Function (Call by reference – receive array by using pointers)
  5. If else (only allowed in function)
Otherwise your marks will be deducted accordingly.

Recommended : DevC++ Installation and Usage Complete Guidelines

CS201 Assignment Sample Output:

CS201 Assignment Sample Output Spring 2018
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: 

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";
}

CS201 Assignment Solution Download Link

Download  [ Solution File Upload Status : ✅ ]


Post a Comment

  1. plz correct the questions and it dont have switch statement
    cout << "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];

    ReplyDelete
    Replies
    1. #include
      using 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;
      }
      }

      Delete
  2. any one upload the solution of cs402 assign 2

    ReplyDelete
  3. The Assignment give's an error "source file not compiled"
    There is some mistake in the file Please correct the error in the file.

    ReplyDelete
  4. plz upload correct solution file of cs201

    ReplyDelete

 

Top