Showing posts with label CS201. Show all posts
Showing posts with label CS201. Show all posts

CS201 Assignment 3 Solution Fall 2019(2020)

Dear VU (Virtual University of Pakistan) Students, here you read and download CS201 Assignment No.3 Solution Fall 2019(2020). (VU Ki Duniya) Provide single download link. Easy download step.  VU Ki Duniya Previously shared CS609 Assignment No.3 Solution fall – 2019(2020). For latest update you also like our Facebook page, YouTube channel. You may also like CS201 Finalterm Short Notes Lec 23 to 45.

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).
  • Software allowed to develop Assignment Dev C++.
Objective:
In this assignment, the students will learn:
  • How to make Class while dealing with real life problems
  • How to associate functions with Class.
  • How to implement switch statement for Class based functions.
  • How to deal with file handling.
  • How to manipulate already created file.
Lectures Covered: 
  • This assignment covers Lecture 15 to 30
Deadline:
  • Your assignment must be uploaded/submitted at or before 15/01/2020.
Download Solution File:


You can Also Download Midterm Solved Past Papers, Final term Solved past Papers, GDB Solutions, Assignment Solutions, and Solved Quizzes files, PPT Slides, Handouts and Short Notes.

CS201 GDB Solution fall 2017

CS201 gdb SOLUTION FALL 2017

Dear VU (Virtual University of Pakistan) Students, here you read and download CS201 (Introduction to Programing) GDB 1 Solution Fall–2017. GDB Total Marks 05. You can download easily GDB Solution click the download button and get GDB Solution. GDB Open Date 5th January 2018 and GDB Closing Date 11th January 2018. You can also like for latest update our Facebook page, YouTube channel and follow on Google+. (VU Ki Duniya) Previously Shared CS201 (Introduction to Programing) Assignment No.1 Solution fall – 2017. CS201 (Introduction to Programing) Assignment No.2 Solution fall – 2017.

CS201 GDB question description

Suppose you are required to write a C/C++ program for a bank in which all transactions of a day will be compared. Keep in mind a huge volume of transactions per day:
Your code should have following features:
  • The processing speed must be high.
  • The logic of the program must be simple.
  • Which decision structure (if-else and switch statement) would you choose to achieve above mentioned features of code, and also mention reasons in favor of your choice.
[Note: Answer must be comprehensive with logical reasoning. Confine your answer within 3 to 5 lines]

DOWNLOAD CS201 gdb SOLUTION 

Download CS201 GDB Solution by Clicking the Download Button Below in just single Click.

Download

You can Also Download Midterm Solved Past Papers referenceby Moaaz and Waqar SidhuFinal term Solved Past Papers reference by Moaaz and WaqarSidhuGDB SolutionsAssignment Solutions, and Solved Quizzes filesPPTSlidesHandoutsFinal term Short Notes, Mid Term Short Notes and NTS Guidelines.

CS201 Short Notes for Final Term (Lec 23 to 45)

CS201 SHORT NOTES FOR FINAL TERM (LEC 23 TO 45)

Dear VU (Virtual University of Pakistan) Students, here you read and download CS201 (Introduction to Programing) Final term Short Notes(Lecture No 23 to 45). (VU Ki Duniya) Provide single download link. Easy download steps. VU Ki Duniya Previously shared CS201 Assignment No.1 Solutionfall – 2017CS201 Assignment No.2 Solution fall – 2017. For latest updates you also like our Facebook page, YouTubechannel and flow on Google+. You may also like CS201 PPT Slides Lecture No.1 toLecture No.45.


Download CS201 Short Notes for Final Term Lecture 23 to 45:
Here you can download CS201 (Introduction to Programing) Final term Short Notes Lec 23 to 45.
Download CS201 Final Term Solved Subjective:
Here you can also download CS201 (Introduction to Programing) Final term Solved Subjective.
Download CS201 Final Term Solved MCQS:
Here you can also download CS201 (Introduction to Programing) Final term Solved MCQS.
Download CS201 Final Term Solved Mega File Short Question:
Here you can also download CS201 (Introduction to Programing) Final term Solved Mega File for Short Questions.
Download CS201 PPT Slides:
Here you can also download CS201 (Introduction to Programing) PPT Slides Lecture No.1 to Lecture No.45.

CS201 VIVA Questions

CS201 Viva question FALL 2017

Dear Virtual University Students, here you can read and download CS201 VIVA Questions fall 2017. If CS201 VIVA Question was helpful. Please Share It with your friends. You can also like our Facebook page, subscribe YouTube channel and follow on Google+ for Latest Update. Previously we shared CS201 Assignment No.2 Solution Fall - 2017.


Recommended: How to Apply PM Laptop Scheme 

CS201 VIVA QUESTIONs

1.     Describe History of C++?
The C++ programming language has a history going back to 1979, when Bjarne Stroustrup was doing work for his Ph.D. thesis. One of the languages Stroustrup had the opportunity to work with was a language called Simula, which as the name implies is a language primarily designed for simulations.
2.     What is Dev. C++?
Bloodshed Dev-C++ is a full-featured Integrated Development Environment (IDE) for the C/C++ programming language. It uses Mingw port of GCC (GNU Compiler Collection) as it's compiler. Dev-C++ can also be used in combination with Cygwin or any other GCC based compiler.

3.     Why Use Dev. C++ instead of C++ DOS IDE?
Dev-C++ is a free IDE for Windows that uses either MinGW or TDM-GCC as underlying compiler. Originally released by Bloodshed Software, but abandoned in 2006, it has recently been forked by Orwell, including a choice of more recent compilers.

4.     What is #Include directive or Copy books or Header File?
Many programming languages and other computer files have a directive, often called include (as well as copy and import), that causes the contents of a second file to be inserted into the original file. These included files are called copybooks or header files.

5.     Why we use curly braces in c?
Curly braces are used to group a set of statements. Often we use them along with loops and conditional statements in order to avoid confusion and to define a clear scope.

6.     What is Main () function?
In C, the "main" function is treated the same as every function, it has a return type (and in some cases accepts inputs via parameters). The only difference is that the main function is "called" by the operating system when the user runs the program.

7.     How many data types are in C?
Void, Int, Float, Character, String

8.     How many types are for integers?
Int or signed int   unsigned int, short int or signed short int, long int or signed long int, unsigned long int

9.     How many types are for Float data type?
Float, double, long double

10.    What is mean by using namespace std; in C?
The built in C++ library routines are kept in the standard namespace. That includes stuff like cout, cin, string, vector, map, etc. Because these tools are used so commonly, it's popular to add "using namespace std" at the top of your source code so that you won't have to type the std:: prefix constantly.

11.    Define the memory size of int variable types?
12.    Define the memory size of Float Variable types?
13.    How declare a variable?
The Syntax of Declare variable is data_type variable_name; where the data_type is the type of data which can hold a variable variable_name might be anything except the C directives and reserve words.

14.    What is namespace?
Consider a situation, when we have two persons with the same name, Zara, in the same class. Whenever we need to differentiate them definitely we would have to use some additional information along with their name, like either the area if they live in different area or their mother or father name, etc. Same situation can arise in your C++ applications. For example, you might be writing some code that has a function called xyz() and there is another library available which is also having same function xyz(). Now the compiler has no way of knowing which version of xyz() function you are referring to within your code. A namespace is designed to overcome this difficulty and is used as additional information to differentiate similar functions, classes, variables etc. with the same name available in different libraries. Using namespace, you can define the context in which names are defined. In essence, a namespace defines a scope.

15.    How define a namespace?
A namespace definition begins with the keyword namespace followed by the namespace name as follows

namespace namespace_name {
   // code declarations
}

To call the namespace-enabled version of either function or variable, prepend the namespace name as follows:

name::code;  // code could be variable or function.

16.    What are reserve words in C?
Reserve or Keywords are the words that C language use for his personal use a user cannot use reserve words as variable, function or class name. Example: IF, Else, Switch, For, While, Float etc.

17.    What rules are for declaring a variable?

1.     Every variable name should start with alphabets or underscore (_).
2.     No spaces are allowed in variable declaration.
3.     Except underscore (_) no other special symbol are allowed in the middle of the variable declaration.
4.     Maximum length of variable is 8 characters depend on compiler and operation system.
5.     Every variable name always should exist in the left hand side of assignment operator.
6.     No keyword should access variable name.

18.    What is difference between declaration and initialization of a Variable?
For a variable, a definition is a declaration which allocates storage for that variable.
 Initialization is the specification of the initial value to be stored in an object, which is not necessarily the same as the first time you explicitly assign a value to it.

19.    What is cin and cout?
cout is used for output, cin for input. Cout and cin are not key words in the C++ language. They are variables, instances of classes that have been declared in .

20.    Define local and global variable?
Variables that are declared inside a function or block are local variables. They can be used only by statements that are inside that function or block of code. Local variables are not known to functions outside their own. Global variables are defined outside of all the functions, usually on top of the program. The global variables will hold their value throughout the life-time of your program. A global variable can be accessed by any function. That is, a global variable is available for use throughout your entire program after its declaration.

21.    Define Syntax Error?
A syntax error is an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language. For compiled languages, syntax errors are detected at compile-time. A program will not compile until all syntax errors are corrected.

22.    What is Run-Time Error?
An error that occurs during the execution of a program. In contrast, compile-time errors occur while a program is being compiled. Runtime errors indicate bugs in the program or problems that the designers had anticipated but could do nothing about. For example, running out of memory will often cause a runtime error.

23.    What is Logical Error?
A logic error is a bug in a program that causes it to operate incorrectly, but not to terminate abnormally (or crash). A logic error produces unintended or undesired output or other behavior, although it may not immediately be recognized as such.

24.    What are arithmetic operators?
C language has 5 arithmetic operators (+, -, *, /, %). Arithmetic operators are used to perform arithmetic operations in c programming.

25.    Define Logical Operators?
C Language have 3 types of Logical operator or conditional operators.
Operator    
Description Example
&&    Called Logical AND operator. If both the operands are non-zero, then the condition becomes true.        
(A && B) is false.
||      Called Logical OR Operator. If any of the two operands is non-zero, then the condition becomes true.        
(A || B) is true.
!       Called Logical NOT Operator. It is used to reverse the logical state of its operand. If a condition is true, then Logical NOT operator will make it false.       ! (A && B) is true.

26.    What is Conditional operator?
A ternary operator or Conditional Operator is an operator that takes three arguments. The arguments and result can be of different types. Many programming languages that use C-like syntax feature a ternary operator, ?:, which defines a conditional expression. Since this operator is often the only existing ternary operator in the language, it is sometimes simply referred to as "the ternary operator". In some languages, this operator is referred to as "the conditional operator". Another example for a ternary operator is between, as used in SQL and Python.

27.    Difference between operators and operands?
Operands are the objects that are manipulated and operators are the symbols that represent specific actions. For example, in the expression. 5 + x. and 5 are operands and + is an operator. All expressions have at least one operand.
28.    Describe about file streams?
29.    What are conditional statements?
In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language, which perform different computations or actions depending on whether a programmer-specified Boolean condition evaluates to true or false. Example: IF. Then, Switch.

30.    What are repletion statements?
In C programming Language it is often necessary to repeat the same block of code a given number of times, or until a certain condition is met. Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable. You can use one or more loops inside any other while, for, or do. While loop.

31.    Define Nested If and Nested Loop?
In C++ we can use if statement in the else block. Or we can also include if block in another if block, it’s called nested IF. The placing of one loop inside the body of another loop is called nesting.  When you "nest" two loops, the outer loop takes control of the number of complete repetitions of the inner loop.  While all types of loops may be nested, the most commonly nested loops are for loops.

32.    What is pre-processor Directive?
The C preprocessor modifies a source file before handing it over to the compiler, allowing conditional compilation with #ifdef, defining constants with #define, including header files with #include.

33.    Why use strcpy() function?
This function use to copy string from one string variable to other string variable. Example strcpy(s1, s2) copy string from s2 to s1.

34.    What is a Function?
A function is a group of statements that together perform a task. Every C program has at least one function, which is main (), and all the most trivial programs can define additional functions. You can divide up your code into separate functions.

35.    What are parameters of a function?
In computer programming, a parameter is a special kind of variable, used in a subroutine to refer to one of the pieces of data provided as input to the subroutine. These pieces of data are called arguments. An ordered list of parameters is usually included in the definition of a subroutine, so that, each time the subroutine is called, its arguments for that call can be assigned to the corresponding parameters.

36.    What is a pointer?
The variable that stores the address of another variable is called a pointer. Pointers are a very powerful feature of the language that has many uses in lower level programming.

37.    Difference between a pointer variable and a Variable?
Both are variables a pointer hold the memory address of a variable and an Variable that hold his value both variable must be same type to work with each other.

38.    What is a Class?
A class in C++ is a user defined type or data structure declared with keyword class that has data and functions (also called methods) as its members whose access is governed by the three access specifies private, protected or public (by default access to members of a class is private).

39.    What is a Class object?
Object is a class type variable. Objects are also called instance of the class. Each object contains all members (variables and functions) declared in the class. We can access any data member or member function from object of that class using. Operator.

40.    How can we refer to the global variable if the local and the global variable names are same?
We can apply scope resolution operator :: for the scope of global variable. The scope resolution operator helps to identify and specify the context to which an identifier refers, particularly by specifying a namespace. The specific uses vary across different programming languages with the notions of scoping. In many languages the scope resolution operator is written "::".

41.    What is recursion?
Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function.

42.    What is an identifier?
An Identifier can only have alphanumeric characters (a-z, A-Z, 0-9) and underscore (_). The first character of an identifier can only contain alphabet (a-z, A-Z) or underscore (_). Identifiers are also case sensitive in C. For example name and Name are two different identifier in C.

43.    What is friend class and friend Function?
Friend Function: A C++ friend functions are special functions which can access the private members of a class. They are considered to be a loophole in the Object Oriented Programming concepts, but logical use of them can make them useful in certain cases.
Friend Class: A C++ friend class is a special class that can access the members, objects and methods of another class.

44.    What are constructors and destructors?
Constructor: A class constructor is a special member function of a class that is executed whenever we create new objects of that class. A constructor will have exact same name as the class and it does not have any return type at all, not even void. Constructors can be very useful for setting initial values for certain member variables.
Destructors: A destructor is a special member function of a class that is executed whenever an object of its class goes out of scope or whenever the delete expression is applied to a pointer to the object of that class. A destructor will have exact same name as the class prefixed with a tilde (~) and it can neither return a value nor can it take any parameters. Destructor can be very useful for releasing resources before coming out of the program like closing files, releasing memories etc.

45.    What is the difference between actual and formal parameters?
The parameters sent to the function at calling end are called as actual parameters while at the
Receiving of the function definition called as formal parameters.

46.    What is difference between including the header file with-in angular braces < > and double quotes “”?
If a header file is included with in < > then the compiler searches for the particular header file
Only with in the built in include path. If a header file is included with in “ “, then the compiler
Searches for the particular header file first in the current working directory, if not found then in the built in include path

47.    If a pointer is declared for a class, which operator can be used to access it?
Arrow operator (->) is used for accessing members of structure using pointer variable, whenever we declare structure variable then member can be accessed using the dot operator. But when pointer to a structure is used then arrow operator is used. Both dot and arrow operator serves same function to access member of structure.

48.    What is function overriding?
Function overloading (also method overloading) is a programming concept that allows programmers to define two or more functions with the same name. Each function has a unique signature (or header), which is derived from: function/procedure name. Number of arguments. Arguments' type.

49.    Is it possible to have Virtual Constructor? If yes, how? If not, Why not possible?
There is nothing like Virtual Constructor. The Constructor can’t be virtual as the constructor
Is a code which is responsible for creating an instance of a class and it can’t be delegated to any other object by virtual keyword mean.

50.    What is a dangling pointer?
A dangling pointer arises when you use the address of an object after its lifetime is over. This may occur in situations like returning addresses of the automatic variables from a function or using the address of the memory block after it is freed.

51.    What is a smart pointer?
A smart pointer is a C++ class that mimics a regular pointer in syntax and some semantics, but it does more. Because smart pointers to different types of objects tend to have a lot of code in common, almost all good-quality smart pointers in existence are template by the pointe type.

52.    What is the difference between a pointer and a reference?
A reference must always refer to some object and, therefore, must always be initialized; pointers do not have such restrictions. A pointer can be reassigned to point to different objects while a reference always refers to an object with which it was initialized.

53.    What is the difference between const char *myPointer and char *const myPointer?
Const char *myPointer is a non-constant pointer to constant data; while char *const myPointer is a constant pointer to non-constant data.


Dear VU Students!

CS201 Assignment 2 Solution fall 2017

CS201 ASSIGNMENT 2 SOLUTION FALL 2017

Dear Virtual University Students, here you can read and download CS201 AssignmentNo.2 Solution fall 2017. CS201Assignment Opining Date 16 November 2017 and Closing Date 23 November 2017. Assignment Total Marks: 20. So, harry up Download the CS201Assignment Solution File and submit Your Assignment Solution. Easily you can Download Solution file click the Download Button and Get Assignment Solution File. Any Question for Assignment so easily you can Contact me using Contact form. If assignment solution was helpful. Please Share It with your friends. You can also like our Facebook page, subscribe YouTube channel and follow on Google+ for Latest Update.

IMPORTANT ASSIGNMENT INSTRUCTION 

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).
  • Software allowed to develop Assignment -Dev C++

ASSIGNMENT objectives INSTRUCTION 

To enable students to write, compile and execute a program in Dev C++. Moreover, to familiarize students with the concepts of:
  1. If else structure
  2. Loops
  3. Passing array to a function
  4. Multidimensional array declaration
  5. Multidimensional array manipulation

ASSIGNMENT Submission INSTRUCTION 

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. 

ASSIGNMENT QUESTION tasks

Write a program that will generate random numbers and that numbers will be stored in a two-dimensional array. Then display the generated values on the screen and then also print the even numbers from the generated array elements.

TASKS No.1

First of all, you are required to generate random numbers from 1 to 500. For this, you are required to create a function named as “generateArray. The generate Array will load two- dimensional array with random numbers from 1 to 500. The size of the two-dimensional array will be 7*7.

TASKS NO.2

Defined a function named as “showArray(), which will display the elements of the two- dimensional array on the screen. See the sample output.

TASKS NO.3

The final task is to find the even numbers in this array and display it on the console. For this purpose create a function findEvenNumber().

Sample output:

DOWNLOAD COMPLETE ASSIGNMENT SOLUTION

Download CS201 Assignment Solution by Clicking the Download Button Below in just single Click.

Download

You can Also Download Midterm Solved Past PapersFinal term Solved Past PapersGDB SolutionsAssignment Solutions, and Solved Quizzes files, PPT Slides, Handouts and Short Notes.