C Lab Programs

c-techaravind


                                              To compile and execute the program, copy the code into a text file. Save the text file with the extinction .c (ex. program.c). Save your file in turboc2 or borland (it may your othe c-compiler). Now open you IDE (tc.exe) , goto file->pick file. Your source file will be loaded into IDE. Now you can compile and run the file easily.





1)Write a program to swap two numbers.







2)write a program to print digits triangles.







3)print the series upto  'n' terms:  1   4   27  256.......





4)Find roots of a given quadratic equation.





5)Print Sin series







6)Print Cos series







7)Write a menu driven program to do simple arithmetic operations.





8)write a program to add,multiplay and find transposte of two given matrices.





9)Convert the given string to uppercase without using string handling function.


10)Write a program to swap contents of two variables using pointers.




11)Write a program to do array of structures maintenance.







12)write a program to do complex number operations using structures.







13)Write a program to copy 2 files whose names are given as command line arguments.







14)Write a program to concatenate 2 files whose names are given as command line arguments.





15)Write a program to sort given numbers using Quick Sort.





16)Write a program to sort given numbers using Bubble Sort.





17)Write a program to sort given numbers using Merge Sort.





18)Write a program to sort given numbers using Insertion Sort.







19)Binary searching.







20)Linear searching.





21)Factorial By Recursion.





22)Find reverse of number using recursion method.







23)Find the nth Fibbinoic series.







24)Menu driven program for simple string operation.





25)Heap Sort

OOPS (Through Java)

MCA II Semester [R09] Regular Examinations June 2010
                                 OOPS (Through Java)

Time: 3 Hours                                                       Max Marks: 60

Answer any FIVE questions All questions carry EQUAL marks



1. a) Compare procedural programming and object oriented programming.

b) Explain the following OOPs concepts:

i) Encapsulation ii) Inheritance iii) Polymorphism



2. a) Explain constructor overloading with an example.

b) Explain i) this keyword ii) Garbage collection



3. a) Explain dynamic method dispatch with an example.

b) Explain the uses of super keyword with an example.



4. a) Explain defining, creation and accessing a package with an example each.

b) Write the differences between classes and interfaces.



5. a) Explain the creation and usage of your own exception with an example.

b) Explain the thread synchronization with an example.



6. a) Describe delegation event model.

b) Explain the handling of keyboard events with an example.



7. a) Explain the life cycle of an applet.

b) Write an applet program to display a pentagon.



8. a) Write the limitations of AWT components.

b) What is a scroll pane? Explain the usage of JScrollPane class with an example.







MCA II Semester [NR] Supplementary Examinations, June 2010
                             Programming in java

Time: 3 Hours                                                    Max Marks: 60

Answer any FIVE questions All questions carry EQUAL marks



1. a) Explain the following OOPS concepts:

    i) Encapsulation ii) Polymorphism iii) Inheritance

   b) What are the jump statements in Java? Explain them.



2. a) Explain the use of the following statements.

     i) static ii) final

     b) Explain parameter passing techniques in Java with an example each.



3. a) Explain method overloading with an example.

    b) Explain defining, creating and accessing a package with suitable example.



4. a) Write the differences between classes and interfaces.

    b) Explain the usage of try, catch and finally keywords with an example.



5. a) Explain the creation of thread with Runnable interface with an example.

    b) Explain Inter Thread Communication with an example.



6. a) Write a java program illustrating Action Event.

    b) Write a java program to display an ovel inside a rectangle.



7. a) Explain the border and Grid layout managers with an example each.

    b) Explain Applet Life Cycle methods.



8. a) What is URL? Write a java program to parse the URL.

   b) List and explain the string comparison methods available in String class

Business Data Processing

MCA II Semester [R09] Regular Examinations June 2010
                    Business Data Processing

Time: 3 Hours                                             Max Marks: 60



Answer any FIVE questions All questions carry EQUAL marks



1. a) How many divisions are there in a COBOL source program? Indicate whether

    all the divisions are necessary or not.

    b) Define data name. How is it different from a literal?



2. a) Give an account of the entries in various sections of environment division.

    b) Explain the usage of Special names paragraph.



3. a) What is the purpose of PICTURE clause?

     b) Explain different code characters used in PICTURE clause with suitable

         examples.



4. a) Explain the following verbs:

     i) Accept ii) Display iii)Move

     b) Explain the use of ROUNDED & ON SIZE ERROR clauses with examples.



5. Describe IF and EVALUATE statements with your own examples along with

    various types of conditions.



6. a) List the differences among a subscript, an index and an index data item.

    b) A bulb table represents the quantity of 5 brands and 4 different Wattages. Define

    the table in DATA DIVISION. Write the procedure division entries to

            - read the table

            - find the bulbs in stock of all brands and wattages.



7. a) Briefly explain various file characteristics.

    b) Explain sorting concept on files with examples.



8. With suitable examples explain the role of USE statement

    a) When used in connection with input / output statements

    b) When used in the report-writer feature.





MCA II Semester [R06] Supplementary Examinations June 2010
                              Business Data Processing

Time: 3 Hours                                                   Max Marks: 60



Answer any FIVE questions All questions carry EQUAL marks



1. Enumerate four divisions of COBOL. Briefly describe the functions of each of the

    divisions which of the four divisions are machine dependent.



2. a) Summarize the differences between group items and elementary items with

     examples.

    b) Explain the format of Object computer paragraph.



3. a) What is a USAGE clause? What are the options available with usage clause?

      Give the syntax?

    b) Explain the use of level numbers 01-47, 77, 66 and 88 giving suitable example.



4. a) Describe various arithmetic statements of COBOL

     b) Is there any data transfer verb available in COBOL? Explain with suitable

      example.



5. a) Give the general format of the IF statement along the rules governing the

     statement.

    b) What is the function of class condition? Write the structure of a class condition

     and write various rules of class condition. Illustrate through examples



6. a) Describe occurs clause. Explain how an occurs clause can be used for table

    handling-with an example.

    b) Explain he string handling verbs supported by COBOL.



7. a) Explain the role of master file and transaction file in COBOL.

    b) Write a COBOL program that will distribute records from 1 master file to

       several data files based on the class of students.



8. Briefly explain COBOL subroutines. Distinguish call by address and call by

content with suitable examples.




MCA II Semester [NR] Supplementary Examinations June 2009
                   Data Processing Through COBOL

Time: 3 Hours                                                Max Marks: 60



Answer any FIVE questions All questions carry EQUAL marks



1. a) Give the basic structure of a COBOL program.

    b) Write the rules of literals and identifiers in COBOL. Give examples for each.



2. a) Describe the format of procedure division.

    b) The data names FV and R contain the face value of equity share and the rate of

    dividend respectively. Write a COBOL program to calculate the gross dividend

     using the formula: G = (FV*R)/100.



3. What is the role of REDEFINES and RENAMES clause in COBOL? Describe

with the help of an example



4. Give the formats of various arithmetic verbs available in COBOL. What are the

options that are available with arithmetic verbs? Explain the compute and

evaluate statements



5. a) What is the purpose of EVALUATE statement? Give an example

    b) What is the difference between a GOTO statement and a PERFORM statement



6. a) Differentiate between EXAMIME and INSPECT statements with necessary

     examples.

    b) Write a COBOL program for Binary search.



7. a) Distinguish FILE-CONTROL and FILES SECTION entries for all the three

     Organizations.

    b) Describe different ways of accessing records in relative files.



8. a) Explain the role and syntax of LINKAGE SECTION in COBOL .

    b) How will you call a subroutine? Explain with suitable example.

Organizational Structures and Personal Management

MCA II Semester [R09] Regular Examinations June 2010
    Organizational Structures and Personal Management

Time: 3 Hours                                               Max Marks: 60



Answer any FIVE questions All questions carry EQUAL marks



1. Examine the assumptions and criticism against the classical theory of organization.



2. What is morale? How do you measure morale?



3. Write short notes on:

   (a) Authority.

   (b) Responsibility

   (c) Accountability, and

   (d) Organizational design.



4. What are the principal methods that can be used to analyze jobs? What are the methods

would you use? Why?



5. What are the problems in career planning and development? Suggest the measures for

effective career planning and development.



6. Discuss the concept of capability of organizational learning.

.

7. Comment on the contributions of MIS and information technology to the organizational

communication.



8. Discuss the importance of strategic management



MCA II Semester [R06] Supplementary Examinations June 2010
              Organizational Structure & Personal Management

Time: 3 Hours                                                    Max Marks: 60



Answer any FIVE questions All questions carry EQUAL marks



1. What is functional approach to organization? Discuss the advantages and disadvantages

of functional organization?



2. What is system approach? Explain the features of a system.



3. What is personnel policy? Describe the important personnel policies that affect the job of

a personnel manager.



4. What is manpower planning? What factors do you consider while forecasting manpower

needs of an organization?



5. Explain the following terms:

 (a) Job Design

 (b) Job Rotation

 (c) Job Enlargement

 (d) Job enrichment.



6. What is job rotation? How does it help in acquiring new skills and knowledge?



7. What is strategic management? What is strategy? Discuss the criteria for effective

strategy.



8. What is listening? Explain the role of effective listening in the communication

process







MCA II Semester [NR] Supplementary Examinations June 2009
            Organizational Structure & Personal Management

Time: 3 Hours                                                Max Marks: 60



Answer any FIVE questions All questions carry EQUAL marks



1. What are the classical theories of organization?



2. What is committee? What are the merits of committees?



3. What is decision-making? Explain the importance of decision-making in an organization.



4. “Personnel administration is a line responsibility but a staff function” Discuss.



5. What are the different methods of interview techniques? Explain them in detail.



6. Distinguish between training and education? Are you trained or educated in your college.



7. Explain the concept of core competence.



8. Discuss the communication skills necessary for managing conflicts

OPERATING SYSTEMS

MCA II Semester [R09] Regular Examinations June 2010
                         OPERATING SYSTEMS

Time: 3 Hours                                               Max Marks: 60



Answer any FIVE questions All questions carry EQUAL marks



1. a) Explain about the various memories hierarchy.

    b) What are the services offered by the operating system?



2. a) Define Process? Explain about Process scheduling.

    b) Write the short notes on Thread Libraries



3. a)Explain about Multi-Processor Scheduling.

    b) What is a critical section problem? Suggest a classic software based solution?



4. What is Deadlock? Explain methods for handling Deadlocks.



5. a) What is paging and explain about demand paging.

    b) Explain about contiguous memory allocation in the memory management



6. a) Explain about the different types of file access methods.

    b) Explain about the file system structure.



7. a) Discuss about N- step- SCAN policy for disk scheduling.

    b) Write a short note on RAID Structure

    c) Differentiate between logical I/O and device I/O.



8. a) Define Threat? Explain different types of Threats.

    b) Compare active attacks with passive attacks.





MCA II Semester [R06] Supplementary Examinations June 2010
                             OPERATING SYSTEMS

Time: 3 Hours                                                 Max Marks: 60

Answer any FIVE questions All questions carry EQUAL marks



1. What is an operating system and explain different types of operating system.



2 a)Define Process? Explain about Process scheduling.

   b) Explain about Multi-Processor Scheduling



3. a) Explain about the logical versus physical address space?

    b) What is a paging and explain the different types of page replacement algorithms.



4. a) Explain about the file access methods.

    b) Explain about the Directory structure and different directory schemes.



5. a) Explain the process of the critical section problem

    b) Write Short note on Semaphores



6. a) What is a deadlock? How problems of deadlock be handled?

    b) Explain about Deadlock Prevention.



7. a) Explain about the Unix file system and advantages of Unix.

    b) Write a short note on Inter Process Communication.



8. a) Explain design Principles of Linux System

    b) Explain about Security in Linux System.





MCA II Semester [NR] Supplementary Examinations June 2009

                           OPERATING SYSTEMS

Time: 3 Hours                                                    Max Marks: 60



Answer any FIVE questions All questions carry EQUAL marks



1. a) What is an operating system and explain different types of operating system.

    b) What are the services offered by the operating system?



2. a) What is a process Control Block? What is the information it contains?

    b) Explain about the different scheduling algorithms with examples.



3. Explain about the following:

    a) Semaphores

    b) Critical Region



4. a) What is a deadlock? How deadlock problem can be handled?

    b) Explain about Deadlock Prevention.



5. a) Describe the swapping policy of an OS.

    b) What is paging? Describe page replacement approach in an OS.



6. a) Discuss LRU-Approximation page Replacement.

    b) Consider LRU, FIFO, Optimal page replacement algorithms. Rank these algorithms

        from bad to perfect according to their page fault rate. Separate those algorithms which

        suffer from Belady’s anomaly from those which do not.



7. Explain various techniques implemented for free space management, discuss with

Suitable examples.



8. a) Give the classification of intruders. Explain each class.

    b) Write a brief note on intrusion detection.

Operations Research

MCA II Semester [R09] Regular Examinations June 2010
                            Operations Research

Time: 3 Hours                                              Max Marks: 60



Answer any FIVE questions All questions carry EQUAL marks

1.

 (a) Define Operations Research.

 (b) Give at least five applications of Operations Research.

 (c) Explain characteristics of Operations Research.



2.

 (a) Solve the following LPP using Graphical method

 Maximize Z = 2x1+3x2

 Subject to the constraints

  x1+x2 <= 400

  2x1 + x2 <= 600

  &x1 >= 0, x2 >= 0

  (b) What are artificial variables and give importance.

  (c) Explain simplex method in detail.



3.

(a) Explain various methods to find Basic Feasible Solution to Transportations

Problems.

(b) Give mathematical definition of assignment problem.

(c) We have five jobs each of which must go through the machines A, B and C in the

order ABC. Determine the sequence that will minimize the total elapsed time

Job No        1  2  3  4  5

Machine A   5  7  6  9  5

Machine B   2  1  4  5  3

Machine C   3  7  5  6  7



4. The cost of a machine is Rs 61000 and its scrap value is Rs 1000. the maintenance cost

found from past experiences are as follows

Year                    1        2      3       4       5        6       7       8

Maintenance

Cost in rs.      1000 2500 4000 6000 9000 12000 1600 20000

When should the machine be replaced?



5. A T.V repairman finds that the time spent on his jobs has an exponential distribution with

mean 30 minutes. If he repairs sets in the order in which they come in. if the arrival of

sets approximately Poisson with an average rate of 10 per 8-hour day, what is the

repairman’s expected idle time each day? How many jobs are ahead of the average set

just brought in?



6. The annual demand of an item is 3200 units. The unit cost is Rs. 6/- and inventory

carrying charges 25% per annum. If the cost of one procurement is Rs. 150/-. Determine

 (a) EOQ

 (b) Number of orders per year.

 (c) Time between two consecutive orders.

 (d) The optimal cost.



7. solve the following game



                                          Player B

                                             I   II   III

              Player A              I -4   6   3

                                        II -3  -3  4

                                       III  2  -3  4

8. Cosider the following schedule

Job                 :(1, 2) (1, 3) (1, 4) (2, 4) (3, 4) (4, 5)

Duration(days):  9         8       14      5        6       1

(a) Construct network diagram

(b) What is the project duration

(c) Identify critical, Non-critical activities.

(d) Critical path.







MCA II Semester [R06] Supplementary Examinations June 2010
                           Operations Research

Time: 3 Hours                                              Max Marks: 60



Answer any FIVE questions All questions carry EQUAL marks



1. (a) Define LPP give example

    (b) Solve the following LPP using Graphical method.

         Minimize Z = 5x1 + 5/2 x2

      Subject to the constraints

      2x1 + 4x2 >=40

      3x1 + 2x2 >=50

     & x1, x2 >=0

    (c) Solve the following LPP using simplex method

     Maximize Z = 7x1 + 5x2

     Subject to the constraints

      x1+ 2x2 <= 6

    4x1 + 3x2<=12

    & x1, x2>0



2. (a) Define Assignment problem mathematically.

    (b) Find the optimal solution of the following 5 x 4 Transportation problem

                                           costs

                                     10 20 5 7 10

                                     13  9 12 8 20

                                      4  15   7 9 30              supply 

                                    14   7  1  0  40

                                      3 12  5 19 50

          Demand         60 60  20 10



3. A machine operator has to perform three operations turning, threading and knurling on a

number of different jobs. The time required to perform these operations (in minutes) for

each job is known. Determine the order in which the jobs should be processed in order to

minimize the total time required to turn out all the jobs. Also find the minimum elapsed

time.

Job->        I    II  III  IV V VI

Turning      3   12  5   2   9  11

Threading  8     6  4   6   3   1

knurling    13  14  9  12  8  13



4. A machine costs Rs.10, 000/-. Its operating cost and resale value are given in the table.

Determine at what time it could be replaced?



Year           1      2       3       4       5       6       7      8

Operating

Cost     1000 1200 1400 1700 2000 2500 3000 3500

Resale

value    6000 4000 3200 2600 2500 2400 2000 1600



5. In a railway marshalling yard, goods train arrive at the rate of 30 trains per day. Assume

that the inter arrival time follows an exponential distribution and the service time is also

to be assumed as exponential with mean 36 minutes. Calculate

   (a) The probability that the yard is empty.

   (b) The average queue length assuming that the line capacity of the yard is 9 trains



6. The demand rate of a particular item is 12, 000 units per year. The set-up cost per run is

Rs. 350/- and the holding cost is Rs. 0.20/- per unit per month. If no shortages are

allowed and the replacement is instantaneous, determine

  (a) The optimum run size.

  (b) The optimum scheduling period.

  (c) Minimum expected annual cost.



7. (a) Explain the theory of dominance in the solution of rectangular games.

    (b) Solve the game graphically whose pay off matrix for the player A is given



                                B

                             I       II

                       I    2        4

        A           II    2        3

                     III    3         2

                     IV  -2         6



8. What is dynamic programming and give the importance of the dynamic programming.

State and establish Bellman’s Principle of Optimality

 
Etutos © 2010-2011