Thursday, 3 November 2016

CLASS-XII STACKS AND QUEUES




PRACTICAL PROGRAMS 
ON
STACKS AND QUEUES



1. Write a menu driven program in C++ to perform insert, delete and display operation on a dynamically allocated queue containing passanger details. consider the following definition of node in the code.


struct node
{
long pno;
char pname[20];
node *next;
};


2. Write a menu driven program in C++ to perform insert, delete and display operation on a dynamically allocated stack containing book details. Consider the following definition of node in the code.

struct node
{
char book_no;
char book_titla[20];
node *next;
};




Thursday, 20 October 2016

Class-XI Programs On While Loop



PRACTICAL QUESTIONS ON WHILE LOOP


     1.       Write a program to enter an integer number and print the series upto n numbers in a given format.
1              2              3              .               .               .               .               n

     2.       Write a program to print all characters from 0 to 255.
     3.       Write a program to enter a decimal number and convert it into binary number.
     4.       Write a program to enter a binary number and convert it into decimal number.
    5.       Write a program to enter a positive integer number and count the total number of digits and sum of digits.
    6.       Write a program to find the factorial of a number.
    7.       Write a program to display the Fibonacci series.
    8.       Write a program to display the hailstone series.
    9.       Write a program to display the Lucas series.
    10.   Write a program to enter an integer number and check if it is a palindrome or not.
    11.   Write a program to enter an integer number and check if it is Armstrong number or not.
    12.   Write a program to enter the lower limit and upper limit of a number and calculate the sum of all numbers in the given limit.
    13.   Write a program to enter a positive integer number and print the table.
    14.   Write a program to enter a number and generates its cube.
    15.   Write a program to count the total even and odd numbers in a given range.
    16.   Write a program to enter a number and check if it is prime number or not.


Thursday, 25 August 2016

CLASS - XI PROGRAMS ON IF ELSE IF LADDER





1.      Given three numbers A, B, and C, write a program to write their values in an ascending order. For example,
 if   A=12, B=10 and  C=15,
Your program should print out:
Smallest number = 10
Next highest number = 12
Highest number = 15

2.      Write a short program to calculate simple interest.
3.      Write a short program to convert a lowercase character to uppercase.
4.      Write a short program to find whether the given character is digit or a letter.
5.      A Program to check number is positive and how many digits number have?
6.      Write a c++ program that inputs the experience and the age of a person. The salary of the person is 6000 if the person is experienced and his age is more than 35, otherwise if the person is experienced and his age is more than 28 but less than 35 then the salary should be 4800 otherwise for experienced person the salary should be 3000 and for the inexperienced person, the salary should be 2000.
7.      A computer contest requires teams of 5 members each. Write a program that asks for the number of players, and then gives the number of teams and no of players left over.
8.      Write a program in c++ to accept monthly salary from the user, find and display income tax with the help of the following rules:
MONTHLY SALARY                                       INCOME TAX
9000 or More                                                  40% of the monthly salary
7500-8999                                                       30% of the monthly salary
7499 or less                                                    20% of the monthly salary   
9.      An electricity board charges according to the following rules:
For the first 100 units- 40P per unit (P- paise)
For the next 200 units-50P per unit
Beyond 300 units-60P per unit.
All users have to pay meter charge also, which is Rs.50/-
10.    Write a program to read the number of units consumed and print out the charges.
Computech  company has ninety-six employees who are divided into four grades as per their basic pay as the following:
GRADE 1            Basic: Rs.10,000 p.m. or more
                             D.A. : 40% of Basic
                             H.R. : 30% of Basic
GRADE 2             Basic : Rs. 5,000 p.m. or more but less than Rs. 10,000
                             D.A. :40% of Basic
                              H.R. : 25% of Basic
GRADE 3              Basic : Less than Rs 5,000 but more than Rs 2,000
                              D.A. : 30% of Basic
                              H.R. : 20% of Basic
GRADE 4               Basic: Rs 2,000 p.m. or less
                                D.A. : 30% of Basic
                               H.R. : 15% of Basic
If the salary, which is total of Basic, D.A. and H.R.A. is above Rs 50,000 per annum  then income tax at the rate of 30% of the annual salary exceeding Rs 50,000 is deducted on monthly basis at source. Taking name of the employee and the basic (monthly) pay as inputs, a pay slip for each employee is to be printed. Write a c++ programme to perform the job.
11.  A Computerized ticket counter of an underground metro station charges for each ride at the following rate :
AGE                                                                    AMOUNT/HEAD
18 or above                                                                  Rs 5
5 or above  but below 18                                            Rs 3
Accompanying kids below 5                                       Nil
Write a c++ programme, which takes as input the number of people of various age groups and prints a ticket.
At the end of the journey, the program states the number of passengers of different age groups who travelled and the total amount received as collection of fares .


Sunday, 21 August 2016

CLASS - XII ASSIGNMENT-2 ON DATA FILE HANDLING



CLASS-XII

PROGRAM ON BINARY FILE


     1.      Given a binary file STUDENT.DAT, containing records of the following class Student type
class Student
{
            char S_Admno[lO];    //Admission number of student
            char S_Name[30];       //Name of student
            int Percentage;            //Marks Percentage of student
            public:
                        void EnterData();
                        void DisplayData();
                        int get_Percentage();
};
Write a program in C++, that would read contents of file STUDENT.DAT and display the details of those Students whose Percentage is above 75.

      2.      Assuming the class Computer as follows :
class computer
{
            char chiptype[10];
            int speed;
            public:
                        void getdetails();
                        void showdetails();
};
Write a function readfile( ) to read all the records present in an already existing binary file SHIP.DAT and display them on the screen, also count the number of records present in the file.

      3.      Consider the given class

class student
{
            int admno;
            char name[20];
public:
          void getdata();
          void showdata();
          int retadmno();
};

Write a menu driven program for the following:

1.     Add new records
2.     Display records
3.     Search and display record
4.     Delete the record
5.     Modify the record

4.      Write a menu driven program in C++ to perform the following functions on a binary file “BOOK.DAT” containing objects of the following class:
class Book
{           int BookNo;
            char Book_name[20];
  public:
            void enterdetails();
            void showdetails();
            int Rbook_no() {return Book_no;}
            int Rbook_name() {return Book_name;}

};
a)      Append Records
b)      Modify a record for a given book no.
c)      Delete a record with a given book no.
d)      Search for a record with a given Book name
e)      Display a sorted list of records (sort on Book No.)
            f)       Display a sorted list of records (Sort on Book Name)

5.      A blood bank maintains a data file that contains the following information for every donor: Name, Date of Birth, Telephone number, Blood group. Write a program in C++ to do the following:
a) Given a blood group, display name, date of birth and phone number of all the persons of the given    
   blood group.
b) Append records in the file.
c)  Input a telephone number and modify the corresponding record.

6.      Declare a structure telerec in C++, containing name (20 characters) and telephone number. Write a program to maintain a file of telephone records. The program should allow the following functions on the file:
a)      To append records in the file.
b)      Display the name for a given telephone number. If the telephone number does not exist then display error message "record not found".
            c)      Display the telephone number(s) for a given name. If the name does not exist then display error message "record not found".

      7.      Assuming the class TOYS as declared below and write a program in C++ to read the objects of TOYS from binary file TOYS.DAT and display details of those TOYS, which are meant for children of AgeRange "5 to 8".                                                                                                          
class TOYS
    {
            int ToyCode;
            char ToyName[10];
            char AgeRange;
            public:
            void Enter()
            void Display()
                        char* WhatAge()
 };
       8.      Write a program in C++ to search for a camera from a binary file “CAMERA.DAT” containing the objects of class CAMERA (as defined below). The user should enter the Model No and the function should search and display the details of the CAMERA.                                 
 class CAMERA                                            
 {
            long ModelNo;
            float MegaPixel;
            int Zoom;
            char Details[120];
            public:
            void Enter();
            void Display();
            long GetModelNo();

};

Thursday, 11 August 2016

CLASS-XI BASIC PROGRAMS IN C++





SIMPLE PROGRAMS IN C++

1.                  Write a program to calculate the area and perimeter of rectangle and square.
2.                  Write a program to calculate the area and circumference of a circle.
3.                  Write a program to calculate the surface area and volume of a cuboid.
4.                  Write a program to calculate the area of a triangle using heron’s formula.
5.                  Write a program to enter the temperature in Fahrenheit and convert into Celsius
6.                  Write a program to calculate the speed of a vehicle.
7.                  Write a program to swap two integer numbers by using third variable.
8.                   Write a program to swap two integer numbers without using third variable.
9.                   Write a program to calculate the discriminant of a quadratic equation.
10.               Write a program to enter the salary of an employee and calculate the gross salary and net salary as per the following : (salary !=0)
              (Gross Salary=Basic+HRA+DA)
             (Net Salary=Gross Salary-PF)

HRA
DA
PF
5% OF Salary
2% Salary
12% of salary



Thursday, 26 May 2016

CLASS - XII ASSIGNMENT ON DATA FILE HANDLING


PROGRAMS ON DATA FILE HANDLING

1.      Write a program in a C++ to read the content of a text file “DELHI.TXT” and display all those lines on screen, which are either starting with ‘D’ or starting with ‘M’.
2.      Write a program in a C++ to count the number of lowercase alphabets and uppercase alphabets present in a text file “BOOK.TXT”.
3.      Assume a text file “coordinate.txt” is already created. Using this file create a C++ program to count the number of words having first character capital.
4.      Write a program to count number of lines from a text files that ends at ‘.’
5.       Write a function in C++ to count the number of alphabets, number of digita, number of white spaces  present in a text file “BOOK.TXT
6.      Write a program in C++ to count the number of vowels present in a text file “BOOK.TXT”.
7.        Assume a text file “Test.txt” is already created. Using this file, write a program  to create three files “LOWER.TXT” which contains all the lowercase vowels and “UPPER.TXT” which contains all the uppercase vowels and “DIGIT.TXT” which contains all digits.
8.        Write a program in a C++ to display the sum of digits present in a text file “Fees.txt”.
9.        Write a program in a C++ to display the product of digits present in a text file “Number.txt”.
10.    Write a program in a C++ to find the largest digit present in a text file “Marks.txt”
11.  Write a program CountYouMe() in C++ which reads the contents of a text file story.txt and counts the words You and Me (not case sensitive).
For example, if the file contains:
You are my best friend.
You and me make a good team.
The function should display the output as
Count for You: 2

Count for Me: 1

Tuesday, 3 May 2016

CLASS- XI ASSIGNMENT-3 DATA REPRESENTATION




CHAPTER - 3


  1. Give the value of 8801127, and 255 in 8-bit unsigned representation.
  2. Give the value of +88-88 , -10+1-128, and +127 in 8-bit 2's complement signed representation.
  3. Give the value of +88-88 , -10+1-127, and +127 in 8-bit sign-magnitude representation.
  4. Give the value of +88-88 , -10+1-127 and +127 in 8-bit 1's complement representation.
  5.  Do Binary Addition and subtraction for the following:    
           Binary Addition
           1. 101 + 11 =
           2. 111 + 111 =
           3. 1010 + 1010 =
           4. 11101 + 1010 =
           5. 11111 + 11111 =


          

CLASS-IX CHAPTER-3


COMPUTER LANGUAGES AND SOFTWARE

Q1. What are the two types of computer languages? Categorize and define them.
Ans. The two types of computer languages are:
1.      low level language(LLL)
2.      high level language(HLL)
CATEGORIES OF LLL:
1.      Machine language:
a.      This is also called as the First Generation Computer Languages.
b.      It  contains all the instructions in the Binary Form i.e. in 0s and 1’s.
c.        It is very difficult to understand for the user to understand. Because all the instructions are written into the Form of 0 and 1.      
d.      It increases the Speed of Processing of the Computer System.
2.       Assembly Language: 
a.        The Programs are written into the Form of some Words in English Language Forms.
b.        For Example if a user wants to add two Numbers then he has to use Some Mnemonics like this ADD A,B in this  ADD is the Mnemonics which is used for Performing the Add Operation. 
High level languages: These are the instructions written in English like language. It uses variables, arrays and complex mathematical calculations.
Various HLL are; COBOL, PASCAL, C, C++, JAVA etc.

Q2. What is 4GLs? What is its advantage?
Ans. 4GL is a fourth generation programming language and is developed for a specific purpose or a certain type of work such as developing any commercial software.
Main advantages are to reduce programming effort, time and total cost of the software development.

Q3. What are the various generations of computer languages?
Ans. The various generations of computer languages are:
1.      Machine language or first generation.
2.      Assembly language or Second generation.
3.      High level language or third generation.
4.      4GL or fourth generation are user friendly and portable.
5.      Fifth generation are used in the field of artificial intelligence, fuzzy logic and neural networks.

Q4. What is software? Give classification of computer software.
Ans. Software is a set of program instructions which when executed gives some desired results.
Classification:

Image result for basic classification of software



Q-5 Define the following:
1.      System software
2.      Assembler
3.      Compilers
4.      Interpreters
5.      Operating system
6.      Application software
7.      General purpose application software
8.      Customized software
9.      Utility software

Ans.
1.      System software:  it is a set of programs that are used to control the operations of the computer system such as input and output, saving a file, prints a document etc.
2.      Assembler: it is a software that converts assembly language program into machine language program.
3.      Compilers: it is a software program that converts an entire HLL program into machine language program.
4.      Interpreters: it is a software program that converts HLL program into machine language program line by line.
5.      Operating system: it is system software that acts as an interface between user and machine. It is required to start and shut down the system.
6.      Application software: These are a set of programs that are put together for a specific purpose or task.
10.  General purpose application software: these softwares are created by vast companies for general purpose use. Anyone can purchase it and use it for its own purpose. E.g. word processing software, excel, PowerPoint, desktop publishing software etc.
11.  Customized software: a software which is created and modified by a person or a company for its own use and cannot be used by any other customer. These are also known as business software.  For e.g.: restaurant billing system, library management system, school management software etc.
12.  Utility software: it is a small program that provides additional capabilities to your operating system. They are also called service routines. For e.g.: disk fragmenter, network managers, disk cleanup etc.

Q6 Differentiate between compiler and interpreter.
Ans. The various differences are:
Q7 what are the various disk management tools? Explain in brief.
Ans. the various disk management tools are:
1.      Disk cleanup: helps to free space in hard drive by deleting unnecessary program files.
2.      Disk defragmenter: consolidates or group together fragmented files and folders at one place and free space at one place. This process is known as defragmentation.
3.      Systems restore utility: it is a component of windows XP home edition. It can be used to restore the computer to its previous state without deleting any file.
4.      Special utilities: these are the special utilities like compression utilities, encryption/decryption etc. Norton antivirus, McAfee, quickheal is all utility softwares.

Q8. What are the various functions of operating system?
Ans. The various functions are:
1.      Program execution
2.      I/O device management
3.      Information management
4.      Memory management
5.      Error handling

6.      Information and resource protection