New ! Computer Science MCQ Practise Tests



11th Standard English Medium Computer Science Subject Arrays and Structures Book Back 5 Mark Questions with Solution Part - II

11th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 25

    5 Marks

    5 x 5 = 25
  1. Write a C++ program to add two distances using the following structure definition
    struct Distance{
    int feet;
    float inch;
    }d1 , d2, sum;

  2. Write a C++ Program to declare a structure book containing name and author as character array of 20 elements each and price as integer. Declare an array of book. Accept the name, author, price detail for each book. Define a user defined function to display the book details and calculate the total price. Return total price to the calling function.

  3. Write a c++ program to declare and accept an array of professors. Display the details of the department = ”COMP.SCI” and the name of the professors start with ‘A’. The structure “college” should contain the following members.
    prof_id as integer
    name and Department as character array

  4. Write the output of the following c++ program
    #include<iostream>
    #include<stdio>
    #include <string>
    #include<conio>
    using namespace std;
    struct books {
    char name[20], author[20];
    } a[2];
    int main()
    { cout<< "Details of Book No " << 1 << "\n";
    cout<< "------------------------\n";
    cout<< "Book Name :"<<strcpy(a[0].name,"Programming ")<<endl;
    cout<< "Book Author :"<<strcpy(a[0].author,"Dromy")<<endl;
    cout<< "\nDetails of Book No " << 2 << "\n";
    cout<< "------------------------\n";
    cout<< "Book Name :"<<strcpy(a[1].name,"C++programming" )<<endl;
    cout<< "Book Author :"<<strcpy(a[1].author,"BjarneStroustrup ")<<endl;
    cout<<"\n\n";
    cout<< "================================================\n";
    cout<< " S.No\t| Book Name\t|author\n";
    cout<< "====================================================";
    for (int i = 0; i < 2; i++) {
    cout<< "\n " << i + 1 << "\t|" << a[i].name << "\t| " << a[i].author;
    }
    cout<< "\n=================================================";
    return 0;
    }

  5. Debug the error in the following program
    #include <istream.h>
    structPersonRec
    {
    charlastName[10];
    chaefirstName[10];
    int age;
    }
    PersonRecPeopleArrayType[10];
    void main()
    {
    PersonRecord people;
    for (i = 0; i < 10; i++)
    {
    cout<<people.firstName<< ‘ ‘ <<people.lastName <<people.age;
    }
    for (int i = 0; i < 10; i++)
    {
    cout<< "Enter first name: "; cin<<peop[i].firstName;
    cout<< "Enter last name: "; cin>>peop[i].lastName;
    cout<< "Enter age: "; cin>> people[i].age;}
    }

*****************************************

Reviews & Comments about 11th Standard English Medium Computer Science Subject Arrays and Structures Book Back 5 Mark Questions with Solution Part - II updated Book back Questions

Write your Comment