Showing posts with label Download Cs201 assignment solution. Show all posts
Showing posts with label Download Cs201 assignment solution. Show all posts

CS201 Assignment no 3 Fall 2016

By: // No comments:

CS201 Assignment no 3 Fall 2016

Here we have CS201 - Introduction to Programming Assignment No. 3 Solution and Discussion Fall 2016 Due Date Jan 16, 2017. You Can Also Download Solved Final Term Papers, Short Notes, Assignment Solutions, Lecture Wise Questions Answers Files, Solved MCQs, Solved Quiz , Solved Final Term Subjective Papers , Solved Final Term Objective Papers from Virtual Study Solutions For Preparation of Final Term Papers.


Also Read: CS201 Latest Solved MCQs For Final Term Papers

CS201 Assignment no 3:

XYZ University needs a system for student’s courses and their semester details. A data entry operator needs to enter student’s data in to the system, and then the system will show the report of student semester information. Following data will be used by the system.
  • Course code
  • Course name
  • Semester
The system will allow entering data for five courses at a time and will input course code along with course name, later the system will format the report in a more readable form.

Also Read: CS201 Solved Final Term Past Papers Collection

CS201 Assignment no 3 Question:

Your task is to:
Write a C++ program to implement the above mentioned interface

  1. Your program should provide the user with options to enter data for courses along with course code. e.g.
  2. Enter course name along with course code: CS201 Introduction to Programming
  3. After taking course information from user your program should prompt user to enter semester information.
e.g. Enter Semester: Fall 2016
  • The program should input data for five courses and semester.
  • Use structure name “course” in your program. 
  • Use separate functions for taking user inputs, displaying and formatting outputs. 
e.g. Input Courses(),Display Header(),Display Courses(),Format Course(---) etc.

Note: Use structure to implement above program, no credit will be awarded if structure is not used.

Also Read: Virtual University (VU) Exams Pattern

CS201 Assignment No. 3 Solution:

If you want to Get the Solution Directly in Your Inbox. Subscribe us below and save your self Trouble of Searching Assignment Solution.


CS201 Assignment Solution solved.rar, 72 KB

CS201 Assignment No 02 Solution Fall 2016

By: // No comments:

CS201 Assignment No 02 Fall 2016

Here You can download CS201 Assignment No 02 Solution - Discussion Due Date: 02 Dec 2016.

CS201 Assignment No. 02

Q: Write a program that takes input of 10 integers into an array.
Give two options to the user:
1= copy odd numbers from the array to a new array (odd[] array) and sort “odd[]” array in ascending order

2= copy even numbers from the array to a new array (even[] array) and sort “even[]” array in ascending order

Q: Write a function that accept (odd[] or even[]) array and sort it
Use bubble sort technique to sort the given array
Display the sorted array.

Hint:: you can use 3 arrays like arry[], odd[], even[].

Sample output:

Taking input for array from user

Ask user for an option

Pass array to function and display sorted array

CS201 Assignment Instructions

Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:

  • Assignment is submitted after due date.
  • Submitted assignment does not open or file is corrupt.
  • Assignment is copied (From internet/students).
Also Read: PM Laptop Scheme for Virtual University Students 2016-17


CS201 Assignment Tools:

Software allowed to develop Assignment

- Dev C++

CS201 Assignment Objectives:

To enable students to write, compile and execute a program in DevC++. Moreover to familiarize students with the concepts of:
  • Array manipulation
  • Array passing to functions
  • Sorting Of Array (Bubble sort)
Also Read: CS 201 all past solved midterm papers 2015


CS201 Assignment Submission Instructions

You have to submit only.cpp file on the Assignments interface of CS201 at VULMS. Assignment submitted in any other format will not be accepted and will be graded zero marks.

Also Read: HOW TO MAKE DATESHEET FOR EXAM at VU

CS201 Assignment Deadline:

The deadline to submit your CS201 assignment solution is 2nd December, 2016. Your assignment must be submitted within the due date through VULMS. No assignment will be accepted through email after the due date.

CS201 Assignment No 02 Solution Fall 2016

Here is the Complete and Final Solution of CS201 Assignment No 02 for Virtual Students.

Solution Files Fulfills all the requirements...
• Array manipulation
• Array passing to functions
• Sorting Of Array (Bubble sort)

Download links for CS201 Assignment No 02 Solution

Download the CS201 Solution File from the links below

Feel Free to ask any question OR query

You Can Also Download Solved Mid Term PapersShort NotesAssignment SolutionsLecture Wise Questions Answers FilesSolved MCQsSolved Quiz , Solved Mid Term Subjective Papers , Solved Mid Term Objective Papers From This Discussion For Preparation Mid Term Papers of Fall 2015-16.

CS201 Assignment No 2 Due Date 28-06-2016

By: // No comments:

CS201 Assignment

Here we have Cs201 Assignment no 2 as it is continuity of assignment 1. You have to do the same task as you did in assignment 1 but this time you have to use structure variables. 

CS201 Assignment No 2

You have to write C++ program in which;
• You are required to define 2 structures named as Rectangle and Trapezoid.
• Rectangle has 3 data members, width, length and area
• Trapezoid has 4 data members named as height, base1, base2 and area.
• Provide 2 options to the user as below:
 Enter 1 to calculate the area of Rectangle
 Enter 2 to calculate the area of a Trapezoid

• If the user enters 1, then
 Object (variable) of Rectangle structure is created
 The program should ask the user to enter the width and length of the rectangle
 Assign input values to data members of Rectangle Structure
 Then show the result after calculation. Formula for calculating Area of rectangle is
Area = width x Length.

• If the user enters 2, then
 Object (variable) of Trapezoid structure is created
 The program should ask the user to enter the base1, base2, and height of the trapezoid
 Assign input values to data members of Trapezoid structure
 Then shows the result after calculation. Formula for calculating Area of trapezoid is
Area =
• You must implement two different functions for calculating areas of rectangle and trapezoid.
• After taking the choice from the user in form of 1 or 2 and assigning entered values to respective structure data members, the relevant function should be called to calculate area.
• Function for calculating area should return a value that would be stored in data member of structure to store respective area.
• After storing area, it should be displayed on screen.
• After showing the output to the user, you need to ask the user if he/she wants to do another calculation. If the user presses y or Y, then the program should ask the user again to enter the choice of shape otherwise the program should be terminated.

Screenshot of the program execution is given below for both shapes:


Cs201 Assignment no. 2 Solution:

/*
 BY Zohaib Khan "Virtual Study Solutions"
 remove the above type your name and roll no
 This program will calculate the area of rectangle and trapezoid using structure data type
*/
#include <iostream>
using namespace std;

struct Rectangle
 {
  double width;
  double length;
  double area;
 };
 
struct Trapezoid
 {
  double base1;
  double base2;
  double height;
  double area;
 };
 
double rectangleArea( Rectangle rectangle );
double trapezoidArea( Trapezoid trapezoid );
 

 main()
{
 char c;
 
 do{
  int choice;
  cout << "\nEnter 1 to calculate area of rectangle\n";
  cout << "Enter 2 to calculate area of trapezoid\n";
  cout << "\n\nEnter your choice: ";
  cin >> choice;
  
  if(choice == 1)
  { 
   Rectangle rectangle;
   cout << "Enter the width of rectangle: ";
   cin >> rectangle.width;
   cout << "Enter the length of rectangle: ";
   cin >> rectangle.length;
   rectangle.area = rectangleArea( rectangle );
   cout << "The area of rectangle is: " << rectangle.area;
   
  }
  
  else if(choice == 2)
  { 
   Trapezoid trapezoid;
   cout << "Enter the base1 of trapezoid: ";
   cin >> trapezoid.base1;
   cout << "Enter the base2 of trapezoid: ";
   cin >> trapezoid.base2;
   cout << "Enter the height of trapezoid: ";
   cin >> trapezoid.height;
   trapezoid.area = trapezoidArea( trapezoid );
   cout << "\nThe area of trapezoid is: "
    << trapezoid.area;
   
  }
  else{
   cout << "Error! please enter 1 or 2.";
  }
  cout << "\n\nDo you want to do another calculation: ";
  cin >> c;
 } while( c == 'y' || c == 'Y');


   
   return 0;
}

double rectangleArea( Rectangle rectangle)
 {
  return (rectangle.length) * (rectangle.width);
 }

double trapezoidArea(Trapezoid trapezoid )
 {
  return ( trapezoid.height *( (trapezoid.base1 + trapezoid.base2) / 2) );
 }

You should also Read :

We Offer Virtual University Of Pakistan, Assignments, Mid-Term/Final-Term Papers And Quiz, Solved Questions And Much More For Students Of Virtual University.We are here to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

Our main purpose here discussion not just Solution. We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

Cs201 Pre-Assignment Solution and Discussion

By: // No comments:

CS201 Pre-Assignment Solution and Discussion 

Pre – Assignment practice program (Graded)
Problem statement:
                You are required to write a program in which the program will ask the user to enterLower limit and Upper limit for a loop. It means that loop will start from the lower limit and will execute till the upper limit. After taking the input, the program should show the sum of all the numbers from lower limit to upper limit in each iteration of the loop. For example if the user enters 3 as lower limit and 8 as upper limit. The output should be as:
3  7  12  18  25  33
What you are doing here is you are adding the lower limit into the number next to it and showing it in the same iteration.
Also the program will count the even and odd numbers in the output. In this example, the count of the even numbers will be 2 and the odd numbers will be 4. So the final output would be

Sample Output:
Enter the lower limit for the loop: 3
Enter the upper limit for the loop: 8
3  7  12  18  25  33
Even numbers: 2
Odd numbers: 4

Our main purpose here discussion not just Solution
We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

 Solution:

#include<iostream>
using namespace std;
main()
{
int lowerLimit,upperLimit;
int sum=0,even=0,odd=0;
cout"Please enter lowerLimit:";
cin>>lowerLimit;
cout"Please enter upperLimit:";
cin>>upperLimit;
for(int i=lowerLimit;i<=upperLimit;i++)
{
sum=sum+i;
coutsum"\t";
if((sum%2)==0)
{
even=even+1;
}
else
{
odd=odd+1;
}
}
cout "even numbers "even endl;
cout "odd numbers"odd endl;
}

You Can Download Solved Mid Term Papers, Short Notes, Lecture Wise Questions Answers Files, Solved MCQs, Solved Quizzes , Solved Mid Term Subjective Papers , Solved Mid Term Objective Papers From This Discussion For Preparation Mid Term Papers of Fall 2015
For important helping material related to the subject ( Solved MCQsAssignmentsShort NotesSolved Past Papers, E-Books, Recommended Books, FAQs, Help & Tutorials , Short Questions Answers & more). You must view all the featured discussion in this subject group.

CS201 - Assignment 03 Solution

By: // 3 comments:
Download Solution:

Please note that graded assignment no. 3 of CS201 has been uploaded. Due date to upload solutions is 10-07-2015 (Friday 10-July-2015).
All the instructions to solve the assignment are there in assignment file, so make sure that you read all these instructions and upload your solutions before due date. 
Note:
You need to install Winrar to extract compressed assignment file. You can download Winrar from the following link http://www.rarlab.com/download.htm

For any query related to assignment, contact at: CS201@vu.edu.pk
--
Regards,
Instructor CS201

Solution guidelines
The program should operate in following sequence.
  • Program will prompt the user to enter the file name in current directory.
  • System will show a menu with two options:
    • Protect the file
    • Check security status
  • In case user selects the first option (i.e. protect the file), the system will perform the following steps:
    • Read the file
    • Check if the file is already protected or not.
    • In case if file is not protected, program will protect it by the protection mechanism defined above.
    • If file is already protected, system will display appropriate message and exit.
  • If user selects the second option (i.e. check security status), the system will perform following steps:
    • Read the entire file and if key does not exist (i.e. file is not already protected), program will display the message to protect the file first and display menu.
    • If file is already protected, the system will read the contents along with the already existing key. On the basis of contents read, a new key will be generated. If this new key and the existing one (read from the file) do not match, it means that the contents of protected file are changed and vice versa.

Important note
A text file (data.txt) is attached with assignment, use it for protection checking. Video file (Output-Demo.mp4) of desired function is also attached with assignment. Watch the demo video carefully to understand the required functionality (output) of program. Your program should work as per functionality performing in demo video file. You do not need to send text file with your solution. Just upload .cpp file from your LMS account. For any query related to assignment no. 3 contact us at cs201@vu.edu.pk.
Submission
You are required to submit your solution C++ program through LMS i.e. .cpp file



Download Solution:



Solution:

#include <iostream>
#include <string>
#include <cstring>
#include <fstream>

using namespace std;


int GenerateKey(string file){
 int key = 0;
ifstream myfile(file);
 //int val = 0;
if (myfile.is_open())
{
   string line = "";
   while (getline(myfile, line))
   {
       key += line.length();     
   }
 return key;
}
}
bool findKey(string);

int ProtectFile(string filename){
 int key = GenerateKey(filename);
 string mykey = "%";
 ofstream myfile;
 myfile.open(filename,ios::out |ios::app);
  mykey += to_string(key);
  myfile<<mykey;
 myfile.close();
 return key;
 }
int getfileLength(string);
int GetKey(string);
int displayMenu(string filename){
 bool check = false;
 int key = 0;
 int msg = 1;
  check = findKey(filename);
 int getval = 0;
 cout<<"\nOperations on text file\n";
 cout<<"1. Protect my text file\n";
 cout<<"2. Check Security of my text file\n\n";
 cout<<"Enter your choice (1/2): ";
 cin>>getval;
 if(check == false && getval == 2){
  msg = 1;
 }else if(check == false && getval == 1){

  key = ProtectFile(filename);
  msg =  2;
 }
 else if(check == true && getval == 1){
   //checkForChange();
  msg = 3;
 }
 else if(check == true && getval ==2){
  if( GetKey(filename)==getfileLength(filename)){
   msg = 4;
  }
  else if(getfileLength(filename)!=GetKey(filename)){
   msg = 5;
  }
  
 }
 return msg;
 
}
bool findKey(string filename){
 bool check = false;
 string key = "%";
 string line = "";
  ifstream myfile;
 myfile.open(filename, ios::in);
 size_t pos;
while(myfile.good())
  {
      getline(myfile,line); 
      pos=line.find(key); 
      if(pos!=string::npos) 
        {
            check = true;
            break;
        }
  }
  return check;
}
int getfileLength(string filename){
 ifstream myfile (filename);
 int val = 0;
 int key = 0;string line;
if (myfile.is_open())
{  
   while (getline(myfile, line))
   {
       size_t pos = line.find('%');
       if (pos != string::npos)
       {
           line = line.substr(0,pos);
       }
        val += line.length();
   }
 
}
myfile.close();
   return val;  
}
int GetKey(string filename){
 ifstream myfile (filename);
 int val = 0;
 int key = 0;string line;
if (myfile.is_open())
{
   
   while (getline(myfile, line))
   {
       size_t pos = line.find('%');
       if (pos != string::npos)
       {
           line = line.substr(pos+1);
       }
   }
}
myfile.close();
   return atoi(line.c_str()); 
}
int main(){
 string filename = "";
 int key = 0;
 bool choice = false;
 int msg = 1;
 ifstream myfile;
 cout<<"Enter the name of text file in current directory: ";
 cin>>filename;
 
 myfile.open(filename);
 if(!myfile){
  cout<<"\nSorry the name of file "<<filename<<" you entered is not exist in current directory!";
  return 0;
 }else{
  while(msg == 1){
   msg = displayMenu(filename);
   if(msg == 1)
   cout<<"Your text file is not protected, first protect it by using option \"1\"\n\n";
   if(msg == 2){
    cout<<"\nYour text file is protected now!";
   break;
   }
   else if(msg == 3){
    cout<<"\nYour text file is already protected!";
    break;
   }
   else if(msg == 4){
    cout<<"The content of file are not changed after protection.";
    break;
    
   }else if(msg == 5){
    cout<<"Alert! The content of file are changed after protection.";
    break;
   }
   
  }
  
 }

 cout<<endl;
  system("pause"); 
}


My dev version is 5.6.3. if any Query ask in Comments