Sponsored Links


Results 1 to 3 of 3

Thread: CS201 Midterm Paper May 2010

  1. #1
    Senior Member Guru's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    117

    99 CS201 Midterm Paper May 2010

    Sponsored Links1


    MIDTERM PAPER
    CS201 May 2010


    Q1: Write down the general syntax of switch statement. 2 Marks

    Q2: Why we close a file after use? 2 Marks

    Q3: When a pointer is incremented then how many bytes will it move to change its address?
    2 Marks

    Q4: If there are 2n element in an array then what would be the number of iterations required to search a number using binary and linear search? 3 Marks

    Q5: write down the functions definition if we want to pass the argument to a function by reference without changing the values stored at address. 5 Marks

    Sponsored Links

    Q6: What will be the output of the following code segment 5 Marks

    , int x= 6;
    int y;
    x = x << 1;
    y = x >> 1;
    cout << “x = ” << x << “\n”;
    cout << “y = ” << y;

  2. #2
    Senior Member viki's Avatar
    Join Date
    May 2010
    Posts
    2,132
    MIDTERM EXAMINATION
    Spring 2010
    CS201- Introduction to Programming

    Question No: 1 ( Marks: 1 ) - Please choose one


    C language is developed by

    ► Bill Gates

    ► Robert Lafore

    ► Dennis Ritchie

    ► Deitel & Deitel



    Question No: 2 ( Marks: 1 ) - Please choose one


    Which of the following choice is not an example of an int datatype?

    ► 0

    ► -32

    ► 65531

    ► -4.0



    Question No: 3 ( Marks: 1 ) - Please choose one


    In flow chart, the symbol used for decision making is,

    ► Rectangle

    ► Circle

    ► Arrow

    ► Diamond



    Question No: 4 ( Marks: 1 ) - Please choose one


    Switch statement deals with,

    ► Integer data only

    ► float data only

    ► character data only

    ► Integer and character data



    Question No: 5 ( Marks: 1 ) - Please choose one


    Default case in switch statement is,

    ► Must

    ► Optional

    ► syntax error

    ► Necessary



    Question No: 6 ( Marks: 1 ) - Please choose one


    *.doc is _____________ by type.
    .


    ► Sequential File


    ► Random Access File


    ► Data File


    ► Record File





    Question No: 7 ( Marks: 1 ) - Please choose one


    Member function tellg() returns the current location of the _____________ pointer.

    ► tellptr()


    ► write()


    ► seekg()


    ► get()





    Question No: 8 ( Marks: 1 ) - Please choose one


    Dealing with structures and functions passing by reference is the most economical method


    ► True

    ► False



    Question No: 9 ( Marks: 1 ) - Please choose one


    In C/C++ all character strings are terminated with,

    ► Null character

    ► String

    ► Zero

    ► Full stop



    Question No: 10 ( Marks: 1 ) - Please choose one


    Word processor is


    ► Operating system

    ► Application software

    ► Device driver

    ► Utility software



    Question No: 11 ( Marks: 1 ) - Please choose one


    Which of the following can not be a variable name?

    ► area

    ► _area

    ► 10area

    ► area2



    Question No: 12 ( Marks: 1 ) - Please choose one


    Which looping process is best, when the number of iterations is known?

    ► for

    ► while

    ► do-while

    ► all looping processes require that the iterations be known



    Question No: 13 ( Marks: 1 ) - Please choose one


    By default an array of characters is passed by value to a function,


    ► True

    ► False



    Question No: 14 ( Marks: 1 ) - Please choose one


    Which of the following operator is used to access the address of a variable?



    ► * operator


    ► -> operator


    ► && operator

    ► & operator



    Question No: 15 ( Marks: 1 ) - Please choose one


    The name of an array represents address of first location of array element.


    ► True

    ► False



    Question No: 16 ( Marks: 1 ) - Please choose one


    Let suppose

    Union intorDouble{
    Int ival;
    Double charvar;
    };

    main(){
    intorDouble VAZ;
    int size ;
    size = sizeof(VAZ);
    }

    What will be the value of variable "size", if int occupies 4 bytes and double occupies 8 bytes?


    ► 2

    ► 4

    ► 8

    ► 12



    Question No: 17 ( Marks: 2 )


    What is the difference between for loop and while loop?



    Question No: 18 ( Marks: 2 )


    Consider the structure

    struct Customer
    {
    int custnum;
    int salary;
    float commission;
    };

    A programmer wants to assign 2000 for the structure member salary in the above example of structure Customer with structure variable cust1 What line of code should he write



    Question No: 19 ( Marks: 2 )


    When a pointer is incremented then how many bytes will it move to change its address?



    Question No: 20 ( Marks: 3 )


    If there are 2n elements in an array then what would be the number of iterations required to search a number using binary search and linear search?



    Question No: 21 ( Marks: 3 )


    Perform left shift operation on a binary number 0101 and write the result in binary and decimal.



    Question No: 22 ( Marks: 5 )


    What will be the output of following code segment?
    void func(int [], int);
    main(){
    int arr[5] = {2, 3, 5, 6, 7} ;
    func(arr, 5) ;

    for (int i = 0; i<5; i++)
    cout << arr[i] << “ ”;
    }
    void func(int a[], int size){
    for (int i = 0; i<size; i++)
    a[i] = 2*a[i];
    }



    Question No: 23 ( Marks: 5 )


    What is random access file and how data can be read and write into random access file?
    :o:o--------------------------------------------------------------------------------------:o:o
    [B]The more knowledge you have, the greater will be your fear of Allah.[/B]

    Please Join My [B]Group Vuhelp[/B][B], Birthday Wishing, Daily Hadees[/B] [CODE][B]http://vuhelp.net/groups/vuhelp.html[/B]
    [B]http://vuhelp.net/groups/birthday-wishing.html[/B]
    [B]http://vuhelp.net/groups/daily-hadees.html[/B][/CODE]
    [CENTER][B][COLOR="Red"][SIZE="4"]Email: [email]viki@vuhelp.net[/email][/SIZE][/COLOR][/B][/CENTER]

  3. #3
    Senior Member viki's Avatar
    Join Date
    May 2010
    Posts
    2,132
    CS 201 Introductiontoprogramming
    16 MCQS most from past pappers.
    2 or three short question from past pappers
    Q1 which variable will be used in Inner code block if we have the same names of varables at outer code block. 2marks
    Q2 write a declearation statement of the array of 10 elements of type float include an initialization of the first four elements to 1.0,2.0,3.0,4.0. 2 marks
    Q3 which . Functions used to read/write more than a single character or a single line while using Files? 2marks.
    Q4 What is differnet B/W tellf() and tellp() functions. 3mrks
    Q5 what is different B/W variable andpointer 3 marks
    Q6 write a C/C++ programm which define array of 10 elements and take a number as input if this number is in the array show its position if not thenshow a messeg that number is not in the array. 5 marks.
    Q7 what will be the output of following programme?
    Intx = 6 ;
    Int y;
    X = x<<1;
    Cout<<x=”<<x<<\n;
    Cout<<”y=”<<y;
    :o:o--------------------------------------------------------------------------------------:o:o
    [B]The more knowledge you have, the greater will be your fear of Allah.[/B]

    Please Join My [B]Group Vuhelp[/B][B], Birthday Wishing, Daily Hadees[/B] [CODE][B]http://vuhelp.net/groups/vuhelp.html[/B]
    [B]http://vuhelp.net/groups/birthday-wishing.html[/B]
    [B]http://vuhelp.net/groups/daily-hadees.html[/B][/CODE]
    [CENTER][B][COLOR="Red"][SIZE="4"]Email: [email]viki@vuhelp.net[/email][/SIZE][/COLOR][/B][/CENTER]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 11
    Last Post: 07-15-2011, 08:43 PM
  2. cs201 current midterm paper fall 2010 4 december
    By Xpert in forum Current Papers 2010
    Replies: 1
    Last Post: 12-04-2010, 02:52 AM
  3. cs201 current midterm paper fall 2010 december
    By Xpert in forum Current Papers 2010
    Replies: 1
    Last Post: 12-03-2010, 02:27 PM
  4. Replies: 0
    Last Post: 11-25-2010, 05:22 PM
  5. My cs201 paper held on August 15th, 2010 cs201
    By desireforheaven in forum Current Papers 2010
    Replies: 0
    Last Post: 11-01-2010, 01:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft