FirstRanker Logo

FirstRanker.com - FirstRanker's Choice is a hub of Question Papers & Study Materials for B-Tech, B.E, M-Tech, MCA, M.Sc, MBBS, BDS, MBA, B.Sc, Degree, B.Sc Nursing, B-Pharmacy, D-Pharmacy, MD, Medical, Dental, Engineering students. All services of FirstRanker.com are FREE

Get the MBBS Question Bank Android App

Access previous years' papers, solved question papers, notes, and more on the go!

Install From Play Store

Get the Nursing Question Bank Android App

Access 10+ years of Question Papers with answers, notes for B.Sc Nursing on the go!

Install From Play Store

Download DU (University of Delhi) B-Tech 1st Semester 7796 Programming Fundamentals Question Paper

Download DU (University of Delhi) B-Tech (Bachelor of Technology) 1st Semester 7796 Programming Fundamentals Question Paper

This post was last modified on 31 January 2020

DU B-Tech Last 10 Years 2010-2020 Previous Question Papers (University of Delhi)


FirstRanker.com

Roll No.

S. No. of Question Paper : 7796

--- Content provided by‌ FirstRanker.com ---

Unique Paper Code : 2341101 F-1

Name of the Paper : Programming Fundamentals [DC-1.1]

Name of the Course : B.Tech. in Computer Science

Semester : 1

Duration : 3 Hours Maximum Marks : 75

--- Content provided by​ FirstRanker.com ---

(Write your Roll No. on the top immediately on receipt of this question paper.)

There are two parts of the question paper Part I and Part II. Part I has one question which is compulsory. From Part II attempt any four out of six questions.

Part I

Question No. 1 is compulsory.

  1. (a) Determine which of the following are valid identifiers. If invalid, state reason : 2
    1. recordl
    2. --- Content provided by⁠ FirstRanker.com ---

    3. return
    4. name and address
    5. file-3
  2. (b) If originally x = 3 and y = 5, 2
    1. What is the value of the expression x++ + ++y ?
    2. --- Content provided by⁠ FirstRanker.com ---

    3. What are the values of x and y after the evaluation of the above expression ?
  3. (c) Give the output of the following : 2
    1. int il = 123;
      float fl = 23.5, f2 = 12.09;
      cout < cout.setf(ios: :fixed, ios: :floatfield);

      --- Content provided by FirstRanker.com ---

      cout< cout.setf(ios: :left, ios: :adjustfield;
      cout< cout<<"%";
      cout.setf(ios: :right, ios: :adjustfield);
      cout<
  4. --- Content provided by⁠ FirstRanker.com ---

  5. (ii) int list [6] = {0}; 3
    for (int i = 0; i < 3; i++)
    list [2*i+1] = i + 2;
    for (i = 0; i < 6; i ++)
    cout <
  6. (iii) int k = 20; 2

    --- Content provided by‍ FirstRanker.com ---

    (k != (k = - k)) ? cout << "true" : cout <<"false";
  7. (iv) class A 3
    {
    public:
    A()

    --- Content provided by‍ FirstRanker.com ---

    {cout<<"class A constructor";}.
    ~A()
    { cout <<" class A destructor";}
    };
  8. class B

    --- Content provided by‌ FirstRanker.com ---

    {
    };
    public:
    B()
    { cout <<"class B constructor";}

    --- Content provided by FirstRanker.com ---

    ~B()
    {cout<<"class B destructor";}
    class C: public B, public A
    {
    };

    --- Content provided by‍ FirstRanker.com ---

    public:
    C()
    {cout<<"class C constructor";}
    ~C()
    {cout<<"class C destructor";}

    --- Content provided by‍ FirstRanker.com ---

    int main ()
    {
    C myc;
    return 0;
    }
  9. --- Content provided by‌ FirstRanker.com ---

  10. (d) Give the output of line 1, line 2 and line 3 : 3
    class A
    {
    int a;
    };

    --- Content provided by‍ FirstRanker.com ---

    protected:
    int b;
    public:
    A () {a = 10; b = 20;}
    int c;

    --- Content provided by FirstRanker.com ---

    void display ()
    { cout <<"Hello Class A";}
    class B: public A
    {
    public:

    --- Content provided by‌ FirstRanker.com ---

    void display ()
    { cout <<"Hello Class B";}
  11. void show ()
    {
    cout < cout < }

    --- Content provided by⁠ FirstRanker.com ---

    };
    int main()
    {
    b myb;
    myb.show();

    --- Content provided by‌ FirstRanker.com ---

    myb.display(); //line 3
    return 0;
    }
  12. (e) Write a program that prints the following pattern : 3
    *

    --- Content provided by‍ FirstRanker.com ---

    * *
    * * *
    * * * *
    * * * * *
    Input to the program is the number of lines.
  13. --- Content provided by​ FirstRanker.com ---

  14. (f) Change the following do while loop to while loop : 3
    int x = 0;
    do
    {
    cout << x ++ < } while (x < 100);
  15. --- Content provided by FirstRanker.com ---

  16. (g) Find the error in the following function definition : 1
    1. void func (int x, int y)
      {
      int z;
      return z;
      }.
    2. --- Content provided by​ FirstRanker.com ---

    3. obj & operator + (obj. ob) 2
      {
      objk;
      k.val = val + ob.val;
      return k;

      --- Content provided by FirstRanker.com ---

      }
  17. (h) What would be printed in the following ? 3
    1. bool b;
      string s1 ("Hello");
      string s2 ("Hello!");

      --- Content provided by‌ FirstRanker.com ---

      b = (sl == s2);
      cout <
    2. string sl ("Hello");
      string s2 ("Hello!");
      int i = firstranker.compare(0,3,s2,0,3);
      cout<
    3. string s1 ("Good Morning");

      --- Content provided by‌ FirstRanker.com ---

      s1.replace(5, 7, "Evening",0,7);
      cout<
  18. --- Content provided by‍ FirstRanker.com ---

  19. (i) What is the role of the generic exception handler, catch(....). Give an example. 3
  20. (j) What do the following file handling keywords do ? Explain each with syntax : 3
    ifstream, ofstream, fstream.

Part II

--- Content provided by⁠ FirstRanker.com ---

Attempt any four questions from this part. All questions carry equal marks.

  1. (a) Given a class employee, given the code for the following :
    1. Create an array of 5 employee objects. 2
    2. Give the prototype of non-member function display to which the array is passed. 2
      Function display returns void.
  2. --- Content provided by​ FirstRanker.com ---

  3. (b) Input an array A containing 10 integers. Write a function to reverse the elements of array A so that last element becomes first, second from the last becomes the second and so on. 4
  4. (c) Write a function called smallest that, given three integers, returns the smallest one. 2
  5. Create a class fraction containing data members num and deno (num denotes numerator and deno denotes denominator) and appropriate methods mentioned below : 3
    1. A default constructor to accept data members. 2
  6. (b) The copy constructor. 2
  7. --- Content provided by‍ FirstRanker.com ---

  8. (c) A member function to add two objects of fraction using operator overloading. 3
  9. (a) Create a file containing roll no., name, marks in 3 subjects of 5 students. Create another file using this file which contains the data of those students whose average marks >=40. Print the contents of both the files. 5
  10. (b) Write a program to find the average of n integer numbers. Read the value of n.
    If n happens to be zero, throw a user defined exception with message "input error".
    Also catch the exception using suitable try and catch block. 5
  11. --- Content provided by FirstRanker.com ---

  12. (a)
    1. Write a base class base, with a pure virtual function print. 2
    2. Derive a class derived with public inheritance. Override print. 2
    3. Overload the print method in the derived class with a single integer parameter to print the parameter. 1
  13. (b)
    1. What is run time polymorphism? How is it achieved ? 2
    2. --- Content provided by‍ FirstRanker.com ---

    3. Differentiate between static binding and dynamic binding. 3
  14. (a) Explain the difference between pass-by-value and pass-by-reference techniques to pass the data to function. Also give a suitable example of each. 5
  15. (b) Differentiate between constants and variables. Give example. 3
  16. (c) Write appropriate declarations for the following : 2
    1. unsigned integer variable: custno
    2. --- Content provided by​ FirstRanker.com ---

    3. double precision variable: c = 0.3333333
  17. (a)
    1. Create an array of 12 strings to store the 12 months in a year. 2
    2. Use string function(s) to create a string that appends the first 3 months. 1
    3. For the last 4 months search and report the position of substring "ber" using string class function. 2
    4. --- Content provided by​ FirstRanker.com ---

  18. (b) Determine the value of the following expressions when i=8, j=5, x=0.005, y=-0.01, c='c' 3
    1. (3*i - 2*j)%(2*j - i)
    2. !(c==99)
    3. (x>y)&&(i>0)||(j<5)
  19. --- Content provided by​ FirstRanker.com ---

  20. (c) Give the output of the following code : 2
    void fun(int& a, int & b, int c)
    {
    b=a+2;
    cout<<"in function a = "<< a <<" b = "< }

    --- Content provided by⁠ FirstRanker.com ---

    int main ()
    {
    int x;
    X = 5;
    fun (x, x, x);

    --- Content provided by‌ FirstRanker.com ---

    cout <<"in main"< return 0;
    }

FirstRanker.com


--- Content provided by​ FirstRanker.com ---


This download link is referred from the post: DU B-Tech Last 10 Years 2010-2020 Previous Question Papers (University of Delhi)