Wednesday, October 9, 2024

CTSD Model paper SET-4

Instructions:                                                                                

1. This question paper comprises of two sections. Write answer of both the sections in separate answer books.

2. From Section I, Q.1 is compulsory, attempt any THREE from Q. 2 to Q. 5

3. From Section II, Q.6 is compulsory, attempt any THREE from Q. 7 to Q. 10

4. Make suitable assumptions wherever necessary.

5. Start new question on new page.


Section-A (30 Marks)

Q.1 Objective Type Questions - (State, Define, List, etc) (6 Marks)

  1. Define the ‘do-while’ loop.
  2. List the basic data types in C.
  3. State the purpose of the ‘goto’ statement.

Q.2 Answer the following questions.
A) Define flowchart symbols. (2 Marks)
B) Explain the history of C language. (6 Marks)

Q.3 Answer the following questions.
C) What is an enum in C? (2 Marks)
D) Write a program to find the average of three numbers. (6 Marks)

Q.4 Answer the following questions.
A) Define a 2D array. (2 Marks)
B) Write a program to sort an array in ascending order. (6 Marks)

Q.5 Answer the following questions.
A) Explain call by reference. (2 Marks)
B) Write a program to reverse a given number. (6 Marks)


Section-B (30 Marks)

Q.6 Objective Type Questions - (State, Define, List, etc) (6 Marks)

  1. Define typecasting in C.
  2. What is the purpose of the ‘break’ statement?
  3. List the string functions in C.

Q.7 Answer the following questions.
A) Describe the structure of a C program. (2 Marks)
B) Explain the use of recursion with an example. (6 Marks)

Q.8 Answer the following questions.
A) What is a switch case? (2 Marks)
B) Write a program to check whether a number is Armstrong. (6 Marks)

Q.9 Answer the following questions.
A) Define nested loops. (2 Marks)
B) Write a program to generate a multiplication table using a loop. (6 Marks)

Q.10 Answer the following questions.
A) What are string functions? (2 Marks)
B) Write a program to count the total number of words in a string. (6 Marks)

CTSD model Question paper SET-3

Instructions:                                                                                

1. This question paper comprises of two sections. Write answer of both the sections in separate answer books.

2. From Section I, Q.1 is compulsory, attempt any THREE from Q. 2 to Q. 5

3. From Section II, Q.6 is compulsory, attempt any THREE from Q. 7 to Q. 10

4. Make suitable assumptions wherever necessary.

5. Start new question on new page.

aper Set 4

Section-A (30 Marks)

Q.1 Objective Type Questions - (State, Define, List, etc) (6 Marks)

  1. Define type conversion.
  2. List the components of a C program.
  3. State the use of the ‘continue’ statement.

Q.2 Answer the following questions.
A) Define nested if-else statements. (2 Marks)
B) Explain the concept of user-defined functions in C. (6 Marks)

Q.3 Answer the following questions.
C) What is a 1D array? (2 Marks)
D) Write a program to generate a Fibonacci series up to N numbers. (6 Marks)

Q.4 Answer the following questions.
A) Define a string in C. (2 Marks)
B) Write a program to toggle the case of characters in a string. (6 Marks)

Q.5 Answer the following questions.
A) Explain call by value. (2 Marks)
B) Write a program to find the factorial of a number using recursion. (6 Marks)


Section-B (30 Marks)

Q.6 Objective Type Questions - (State, Define, List, etc) (6 Marks)

  1. Define the ‘for’ loop.
  2. What is a string function?
  3. State the difference between call by value and call by reference.

Q.7 Answer the following questions.
A) List the branching statements in C. (2 Marks)
B) Explain how the ‘switch’ statement works with an example. (6 Marks)

Q.8 Answer the following questions.
A) What is a function prototype? (2 Marks)
B) Write a program to generate a result sheet for 5 students using a loop. (6 Marks)

Q.9 Answer the following questions.
A) Define arrays in C. (2 Marks)
B) Write a program to reverse the order of numbers in an array. (6 Marks)

Q.10 Answer the following questions.
A) What is recursion? (2 Marks)
B) Write a program to create a calculator using user-defined functions. (6 Marks)

CTSD Model Question Paper for practice SET-2

Instructions:                                                                                

1. This question paper comprises of two sections. Write answer of both the sections in separate answer books.

2. From Section I, Q.1 is compulsory, attempt any THREE from Q. 2 to Q. 5

3. From Section II, Q.6 is compulsory, attempt any THREE from Q. 7 to Q. 10

4. Make suitable assumptions wherever necessary.

5. Start new question on new page.


Section-A (30 Marks)

Q.1 Objective Type Questions - (State, Define, List, etc) (6 Marks)

  1. Define recursion in programming.
  2. List the loop control statements in C.
  3. State the components of a function in C.

Q.2 Answer the following questions.
A) Define a 2D array. (2 Marks)
B) Explain the concept of nested loops with an example. (6 Marks)

Q.3 Answer the following questions.
C) What is a string function in C? (2 Marks)
D) Write a program to find the maximum of three numbers using else-if ladder. (6 Marks)

Q.4 Answer the following questions.
A) Define matrix in C. (2 Marks)
B) Write a program to multiply two matrices. (6 Marks)

Q.5 Answer the following questions.
A) Explain the use of the ‘break’ statement in loops. (2 Marks)
B) Write a program to check whether a given number is a palindrome. (6 Marks)


Section-B (30 Marks)

Q.6 Objective Type Questions - (State, Define, List, etc) (6 Marks)

  1. Define a loop in programming.
  2. What is an operator in C?
  3. State the types of user-defined functions.

Q.7 Answer the following questions.
A) List the string functions available in C. (2 Marks)
B) Explain the difference between pre-decrement and post-decrement operators. (6 Marks)

Q.8 Answer the following questions.
A) What is a nested if-else statement? (2 Marks)
B) Write a program to generate an electricity bill based on unit consumption. (6 Marks)

Q.9 Answer the following questions.
A) Define an algorithm. (2 Marks)
B) Write a program to add two matrices. (6 Marks)

Q.10 Answer the following questions.
A) What is a flowchart? (2 Marks)
B) Write a program to arrange a given set of numbers in descending order. (6 Marks)

CTSD - Model Question Paper of 60 Marks for practice SET-1

Instructions:                                                                                

1. This question paper comprises of two sections. Write answer of both the sections in separate answer books.

2. From Section I, Q.1 is compulsory, attempt any THREE from Q. 2 to Q. 5

3. From Section II, Q.6 is compulsory, attempt any THREE from Q. 7 to Q. 10

4. Make suitable assumptions wherever necessary.

5. Start new question on new page.


Section-A (30 Marks)

Q.1 Objective Type Questions - (State, Define, List, etc) (6 Marks)

  1. Define typecasting in C.
  2. List the different data types in C.
  3. State the use of the ‘continue’ statement in loops.

Q.2 Answer the following questions.
A) Define a function in C. (2 Marks)
B) Explain the concept of call by reference with an example. (6 Marks)

Q.3 Answer the following questions.
C) What is a 1D array? (2 Marks)
D) Write a program to generate the first 10 natural numbers using a loop. (6 Marks)

Q.4 Answer the following questions.
A) Define a string in C. (2 Marks)
B) Write a program to find the length of a string. (6 Marks)

Q.5 Answer the following questions.
A) Explain recursion with an example. (2 Marks)
B) Write a program to find the area of a circle using a function. (6 Marks)


Section-B (30 Marks)

Q.6 Objective Type Questions - (State, Define, List, etc) (6 Marks)

  1. Define a loop.
  2. What is an array in C?
  3. State the difference between 'while' and 'do-while' loops.

Q.7 Answer the following questions.
A) List the different types of loops in C. (2 Marks)
B) Explain the use of the ‘for’ loop with an example. (6 Marks)

Q.8 Answer the following questions.
A) What is a switch case? (2 Marks)
B) Write a program to check whether a number is prime. (6 Marks)

Q.9 Answer the following questions.
A) Define nested loops. (2 Marks)
B) Write a program to generate a multiplication table for a given number using nested loops. (6 Marks)

Q.10 Answer the following questions.
A) What is a user-defined function? (2 Marks)
B) Write a program to calculate the factorial of a number using recursion. (6 Marks)

Friday, August 25, 2023

MONGO DB


MongoDB is a cross-platform, document oriented. database that provides high performance, high- availability and easy scalability. MongoDB works on. Concept of collection and document

Database:-

Database is physical container for collections. Each data- buse gets its own set of files on the file system. A single MongoDB server typically has multiple interface, database.

Collection:-

Collection is a group of MangoDB document. It is an eqivalent to RDBMS table. A collection exists. within a single database Collections do not enforce a schema document within a collection can have different fields

Document:-

A document is a set of key-value pair. Document. have dynamic schema. Dynamic schema means. that document in the same collection do not need. to have the same set of fields and structure. and common fields in a collection document. may hold different types of data..

Wednesday, July 11, 2018

constants , final and autoload functions [BCA Sem-3]


Q: What is Class constants ?
A constant is, just like the name implies, a variable that can never be changed. When you declare a constant, you assign a value to it, and after that, the value will never change. Normally, simple variables are just easier to use, but in certain cases constants are preferable, for instance to signal to other programmers (or your self, in case you forget) that this specific value should not be changed during runtime.
Class constants are just like regular constants, except for the fact that they are declared on a class and therefore also accessed through this specific class. Just like with static members, you use the double-colon (Scope resolution) operator to access a class constant. Here is a basic example
class user
{
    const DefaultUsername = "RAJARAM";
    const MinimumPasswordLength = 6;
}

echo "The default username is " . user::DefaultUsername;
echo "The minimum password length is " . user::MinimumPasswordLength;
?>

As you can see, it's much like declaring variables, except there is no access modifier - a constant is always publically available. As required, we immediately assign a value to the constants, which will then stay the same all through execution of the script. To use the constant, we write the name of the class, followed by the double-colon operator and then the name of the constant.

Q: Explain The "final" keyword
In some cases you may want to prevent a class from being inherited from or a function to be overridden. This can be done with the final keyword, which simply causes PHP to throw an error if anyone tries to extend your final class or override your final function.
A final class could look like this:
final class Animal
{
    public $name;
}
A class with a final function could look like this:
class Animal
{
    final public function Greet()
    {
        return "The final word!";   
    }
}
The two can be combined if you need to, but they can also be used independently, as seen in the examples above.

Q:EXPLAIN Autoloading Classes
The spl_autoload_register() function registers any number of autoloaders, enabling for classes and interfaces to be automatically loaded if they are currently not defined. By registering autoloaders, PHP is given a last chance to load the class or interface before it fails with an error.
If one class depends on another, if your application ever changes, you have to work extra hard to be sure that the relationships between your classes are maintainable. But with autoloading classes in PHP this may not be necessary.
·         __autoload( ) — Attempt to load undefined class , void __autoload ( string $class )
·         spl_autoload_register() - Register given function as __autoload() implementation


Example #1 Autoload example
This example attempts to load the classes MyClass1 and MyClass2 from the files MyClass1.php and MyClass2.php respectively.
spl_autoload_register(function ($class_name) {
    include $class_name . '.php';
});

$obj  = new MyClass1();
$obj2 = new MyClass2();
?>
Example #2 Autoloading with exception handling
This example throws an exception and demonstrates the try/catch block.
spl_autoload_register(function ($name) {
    echo "Want to load $name.\n";
    throw new Exception("Unable to load $name.");
});

try {
    $obj = new NonLoadableClass();
} catch (Exception $e) {
    echo $e->getMessage(), "\n";
}
?>
Example #3
Image.php
  class Image {
       
      function __construct() {
          echo 'Class Image loaded successfully
';
      }

  }
?>
Test.php
  class Test {
       
      function __construct() {
          echo 'Class Test working
';
      }

  }
?>
Myprg.php
function __autoload($class_name) {
    if(file_exists($class_name . '.php')) {
        require_once($class_name . '.php');   
    } else {
        throw new Exception("Unable to load $class_name.");
    }
}

try {
    $a = new Test();
    $b = new Image();
} catch (Exception $e) {
    echo $e->getMessage(), "\n";
}
?>

Thursday, August 10, 2017

Explain in brief EDVAC, ENIAC OR Write note on EDVAC, ENIAC.

EDVAC, the first modern stored program computer to be designed, used a central control unit that only interpreted four instructions. All ofthe arithmetic-related instructions were passed on to its arithmetic unit and further decoded there. ENIAC consumed an estimated 174 kW. By comparison, a typical personal computer may use around 400 W;over four hundred times less. ENIAC were able to process between 5and 100 operations per second A modern "commodity" microprocessor (as of 2007 )can process billions of operations per second. and many of these operations are more complicated and useful than early computer operations.

Define the programming tehchnique ?

Computer program, a set of instructions in a programming language, intended to be executed on a computer to perform a task. the term usually implies a self -contained entity, as opposed to a routine or a library.

Program, in computer science, synonymous with software: a sequence of instructions that can be executed by a computer. The term can refer to the original source code or to the executable(machine language) version. The term program implies a degree of completeness; that is a source code program comprises all statements and files necessary for complete interpretation or compilation , and executable program can be loaded into a given environment and executed independently of other programs.

Source code, in computer science, human readable program statements written in the high level or assembly language, as opposed to object code, which is derived from the source code and designed to be machine readable.

Object code,in computer science. the code, generated by a compiler or an assembler, that was translated from the source code of program. The term most commonly refers to machine code that can be directly executed by the system's central processing unit (CPU) but it can also be assembly language source code or variation of machine code Pre-programming tools available as follows:

Algorithm:
Algorithm, in mathematics. method of solving a problem by repeatedly using a simpler computational method. A basic example is the process of long division in arithmetic. The term algorithm is now applied to many kinds of problem solving that employ a mechanical sequence of steps, as in setting up computer program. The sequence may be displayed in the form of a flowchart in order to make it easier to follow. 

As with algorithms used in arithmetic, algorithms for computers can range from the simple to the highly complex. In all cases. however. the task that the algorithm is to accomplish must be definable. The definition may involve mathematical or logic terms or a compilation of data or written instructions. In terms of ordinary computer usage, this means that algorithms must be programmable, even if the tasks themselves turn out to have no solution. In computational devices with a built-in microcomputer logic, this logic is a form of algorithm. As computers increase in complexity more and more software algorithms are taking the form of what is called hard software. That is, they are increasingly becoming part of the basic circuitry of computers or are easily attached adjuncts, as well as standing alone in special devices such as payroll machines. Many different applications algorithms are now available, and highly advanced systems such as artificial intelligence algorithms may become common in the future.

Flow chart:
Flow chart sequential diagram employed in many fields to show the step-by-step procedures used in performing a task. as in manufacturing, or solving a problem. as in an algorithm. Flowcharts are commonly used in the designing of computer programs.