Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

QuestionBank_ProgrammingInCSharp

Question benk Dcom
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

QuestionBank_ProgrammingInCSharp

Question benk Dcom
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

AKS UNIVERSITY, SATNA

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING


Course: BCA | Semester: 3
Subject: Programming in C#
Title: Unit & Topic Vise Questions

Theory
Unit 1: Introduction to C#
Very Short Answer Questions
1. What is C#?
2. Compare C# with C++.
3. Compare C# with Java.
4. List any three features of C#.
5. Define a variable in C#.
6. Name two data types in C#.
7. What are operators in C#?
8. Mention the use of comments in C#.
9. What is the difference between a while loop and a do-while loop?
10. Define the "break" statement in C#.
Short Answer Questions
1. Explain the history of C#.
2. What are the main features of C#?
3. How is a variable declared in C#? Provide an example.
4. Differentiate between if-else and switch statements in C#.
5. Write a short note on the "goto" statement.
6. Illustrate the use of "continue" in a for loop.
Long Answer Questions
1. Discuss the advantages of C# over C++ and Java.
2. Explain the various data types available in C# with examples.

Program
1. Write a program in C# demonstrating the use of if-else, switch, and loops.
2. Write a program to demonstrate the use of variables and data types in C#.
3. Create a program to perform arithmetic operations using operators in C#.
4. Write a program to check whether a given number is even or odd using if-else.
5. Create a program to display a day of the week using the switch statement.
6. Write a program to print the first 10 numbers in reverse order using a for loop.
7. Implement a program to calculate the sum of digits of a number using a while loop.
8. Write a program to demonstrate the use of break and continue statements in a loop.
9. Create a program that uses the goto statement to jump between labeled sections of code.
10. Write a program to calculate the factorial of a number using a do-while loop.

Unit 2: Functions, Arrays, and OOP Concepts in C#


Very Short Answer Questions
1. What is a function in C#?
2. Define an array in C#.
3. List the four principles of Object-Oriented Programming.
4. What is inheritance?
5. What is polymorphism in C#?
6. Define encapsulation with an example.
7. What is the purpose of a constructor in C#?
8. Define an enum in C#.
9. What is the "static" keyword used for in C#?
Short Answer Questions
1. Explain the concept of method overloading in C#.
2. What is the difference between a constructor and a destructor?
3. Write a program to demonstrate the use of an array in C#.
4. How is encapsulation achieved in C#?
5. Describe the concept of abstraction with an example.
Long Answer Questions
1. Write a detailed note on inheritance in C# with examples.
2. Explain the concepts of polymorphism and its types in C#. Provide examples.
3. Discuss the role of constructors and destructors in object-oriented programming.

Program:
1. Write a program to demonstrate single dimensional array
2. Write a program to demonstrate 2D array
3. Write a program to demonstrate 3D array
4. Create a program to find the maximum and minimum element in an array.
5. Write a program to sort an array in ascending order using a loop.
6. Implement a program to demonstrate the concept of method overloading.
7. Write a program to define a class and create objects of the class to access its methods.
8. Create a program to demonstrate the concept of inheritance.
9. Write a program to implement method overriding using a base and derived class.
10. Create a program to demonstrate encapsulation by creating private fields and public properties.

Unit 3: Properties, Inheritance, Polymorphism, and Namespaces


Very Short Answer Questions
1. What are properties in C#?
2. Define aggregation with an example.
3. What is the difference between abstract class and interface?
4. What is a namespace in C#?
5. Define access modifiers in C#.
Short Answer Questions
1. How are properties used in C#?
2. Explain the concept of method overriding in C#.
3. Write a short note on the "sealed" keyword.
4. Differentiate between private, protected, and public access modifiers.
5. Explain the purpose of an interface in C#.
Long Answer Questions
1. Write a program to demonstrate the use of inheritance and polymorphism in C#.
2. Explain the concept of encapsulation with a real-world example.
3. Compare abstract classes and interfaces in detail.

Program :
1. Write a program to demonstrate the use of properties in C#.
2. Implement a program to show aggregation by creating a class within another class.
3. Write a program to create an interface and implement it in a class.
4. Create a program to demonstrate the use of sealed classes and methods.
5. Write a program to show the difference between public, private, and protected access modifiers.

Unit 4: Strings, Exceptions, and File I/O


Very Short Answer Questions
1. What is a string in C#?
2. What is exception handling?
3. Define a custom exception in C#.
4. What is the purpose of the "finally" block in exception handling?
5. List any two classes from the System.IO namespace.
Short Answer Questions
1. Explain the difference between checked and unchecked exceptions in C#.
2. How is serialization achieved in C#?
3. Describe the role of the StreamReader and StreamWriter classes.
4. Write a program to handle exceptions using try-catch blocks.
Long Answer Questions
1. Write a detailed note on file handling in C# with examples.
2. Explain serialization and deserialization with an example program in C#.
3. Discuss the different types of exceptions in C# and how they are handled.

Program:
1. Write a program to find the frequency of characters in a string.
2. Create a program to reverse a string without using built-in functions.
3. Write a program to demonstrate the use of try-catch-finally for exception handling.
4. Implement a program to create a custom exception and throw it under specific conditions.

Unit 5: Generics, Delegates, and Multithreading


Very Short Answer Questions
1. What are generics in C#?
2. Define a delegate in C#.
3. What is reflection in C#?
4. What is multithreading?
5. List the states in a thread life cycle.
Short Answer Questions
1. Explain the difference between a generic class and a generic method.
2. How is synchronization achieved in multithreading?
3. Write a short note on the "ThreadPriority" property.
4. What is the purpose of the Thread.Sleep() method?
5. Describe the concept of a web service in C#.
Long Answer Questions
1. Write a program to demonstrate the use of generics in C#.
2. Explain delegates and their types in detail with examples.
3. Discuss the multithreading model in C# and explain thread synchronization techniques.
4. Describe the concept of reflection and how it is implemented in C#.

Program:
1. Write a program to find the frequency of characters in a string.
2. Create a program to reverse a string without using built-in functions.
3. Write a program to demonstrate the use of try-catch-finally for exception handling.
4. Implement a program to create a custom exception and throw it under specific conditions.

You might also like