CS201 Final Term Past Paper Fall 2005
- Type
- Final term past paper
- Course
- CS201 Introduction to Programming
- Size
- PDF 191 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 4. Download the file for all 4 pages.
anyone.
attempt it to the best of your understanding.
make an appropriate assumption and use it to solve the problem.
d. All coding questions should be answered using the C ++ syntax. You are allowed to use the Dev-C++ compiler to write and test your code. If you do so please remember to copy and paste your code into the examination solution area.
(Do NOT share your code; your colleague could get higher marks than you!!)
**WARNING: Please note that Virtual University takes serious note of
unfair means. Anyone found involved in cheating will get an `F` grade in
this course.
Total Questions: 13
Q1. Marks : 2
A function declaration has the same relationship to a function definition that
a class definition has to an object definition an object declaration has to an object a variable has to a variable declaration a variable declaration has to the variable itself they have no relationship
Q2. Marks : 12
Write a function to overload subtraction operator for Class Order, which you created in previous question. The class has following attributes/ data members i) OrderID ii) Items iii) PricesOfItems
Write the main () to call the - operator and print the result also. This operator should subtract the items of one object from the other.
Q3. Marks : 4
What is the difference between an array and a structure?
Q4. Marks : 2
When we write a class template the first line must be:
1 template < class class_type> 2 template < class data_type> template < class T >, Here T can be replaced with any name but it is preferable. 4 class class-name() 5 class template< class_name>
Q5. Marks : 2
A friend function of a class has access
To all data member and functions of the class Only to other friend functions of the class Only to private data of the class Only to public data of the class To private data declared in main()
Q6. Marks : 5
Briefly describe the role of each of the following within a class:
1. Instance variables 2. Instance methods 3. Constructors
Q7. Marks : 20
Create a class named Order. This class has the following attributes/ data members
a) Create the object of this class using parameterized constructor in order to initialize OrderID and Items data members. Default values of both the data members must be equal to 1. b) Write the following member functions of this class; i) OrderBill ( ), this function will calculate the invoice of an order and display the result. The formula to calculate the invoice is
invoice=SumPrices();
ii) SumPrices( ), this function will sum the prices of the items entered by the user from keyboard in PricesOfItems array and returns the result.
c) Write the setter functions for OrderID, Items, and PricesOfItems. And getter functions for OrderID and Items.
Also write the main () to create the object of class Order.
Q8. Marks : 2
The new operator
is used to declare objects or variables can not create and initialize an object names an object or variable returns an address to an object or variable can allocate an appropriate amount of memory for an object or variable
Q9. Marks : 15
Write a program that inputs one string of max length of 10. If the string is identical to " Virtual", output the message " Correct Password"; otherwise, output the first four characters in the message and the length of the message.
Q10. Marks : 2
If we open a file stream myfile for reading, what will give us the current position of the file pointer?
1 tellg() 2 tellp() 3 seekg() 4 seekp() 5 fstream.h
Q11. Marks : 2
There is a class Student, Which one of the following is a valid destructor for this class.
1 Student();
Related CS201 files
All CS201 files →- CS201 Final Term Past Paper Spring 2005 Final term PDF 201 KB
- CS201 Final Term Past Paper Spring 2006 Session 1 Final term PDF 161 KB
- CS201 Final Term Past Paper Fall 2008 Final term PDF 299 KB
- CS201 Final Term Past Paper Fall 2010 Final term DOC 26 KB
- CS201 Highlighted Handouts Set 3 Highlighted PDF 3.3 MB
- CS201 Quiz 1 2021 Quiz PDF 353 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.