0% found this document useful (0 votes)
25 views2 pages

Oops Assignment

Uploaded by

sheerr420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Oops Assignment

Uploaded by

sheerr420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ASSIGNMENT-1*

1. (a) How do classes and objects function within the object-oriented programming
paradigm, and what is their interconnection?

(b) Define constants and provide the syntax for declaring them in C++.

(c) Explain the mechanism of data sharing among functions in a procedure-oriented


programming.

(d) Elaborate on the fundamental principles of object-oriented programming (OOP) and


demonstrate their distinctions from alternative programming paradigms.

(e) What is the importance of the main() function in C++? Provide an example to illustrate its
significance.

2. (a) Write a C++ program that includes a function to calculate both the circumference and
area of a rectangle and circle. Then, invoke this function from the main() function of the
program.

(b) Develop a C++ program to determine the second smallest and second largest and element
within an array.

3. Compare the usage and characteristics of for, while, and do-while loops in C++.
Additionally, create a program utilizing a while loop to calculate and print the sum of all odd
numbers from 1 to 50.

4. (a) Develop a C++ program that utilizes recursion to calculate the factorial of a given
number.

(b) Describe the difference between local and global variables in C++.

(c) Point out the error present in the following program.

#include

void main()

{ int i = 0;

j = j + 1;

cout « j « " ";

/*comment \*//j = j + 1; cout <<j; }

5. (a) Describe the significance of loop control statements like break and continue in C++
loops. Furthermore, outline a C++ program showcasing various logical and bitwise operators
and their implementation.

(b) Develop a C++ program that converts each letter in a provided string to the succeeding letter
in the alphabet. For example, 'b' becomes 'c', 'c' becomes’d’, and 'z' becomes 'a'.

6. (a) Outline the rationale behind considering object-oriented programming beneficial or


essential in contemporary software development.

(b) Enumerate the methods through which object-oriented programming is employed to address
real-world problems.

7. (a) Compare and contrast a string with a character array in C++. Additionally, elucidate
all built-in string functions provided in C++.

(b) Develop a C++ program containing a function named sum_Of_Digits, which accepts an
integer as input and returns the sum of its digits. Prompt the user to input an integer and display
the sum of its digits utilizing the sum_Of_Digits function.

8. Explain the distinctions between 1Dimenssion and 2 Dimensions arrays. Furthermore,


present a C++ program to compute the sum of all elements in a 3x3 matrix.

9. What defines a function? What types of functions exist in C++? Clarify with a relevant
example.

10. Describe the categorization of operators in C++, and present a C++ program utilizing a
while loop to generate the Fibonacci series up to n terms.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy