Difference between Procedural and Object Oriented Programming

Procedural Oriented ProgrammingObject Oriented Programming
In procedural programming, program is divided into small parts called functions.
Example code :
#include <stdio.h>
/*this function computes the absolute value of a whole number.*/
int abs(int x)
{
if (x>=0) return x;
else return -x;
}
/*this program calls the abs() function defined above twice.*/
int main()
{
int x,
printf(” x=”);
scanf(“%d”, &x);
printf(“Absolute Value of x is %d. \n”, abs(x));
return 0;
}
In object oriented programming, program is divided into small parts called objects.
Example code :

class Parrot:
# class attribute
species = "bird"
# instance attribute
def __init__(self, name, age):
self.name = name
self.age = age
instantiate the Parrot class
blu = Parrot(“Blu”, 10)
woo = Parrot(“Woo”, 15)
access the class attributes
print(“Blu is a {}”.format(blu.class.species))
print(“Woo is also a {}”.format(woo.class.species))
access the instance attributes
print(“{} is {} years old”.format( blu.name, blu.age))
print(“{} is {} years old”.format( woo.name, woo.age))
Procedural programming follows top down approach.
Note: A top-down approach is essentially the breaking down of a program to gain insight into its compositional small program (or module) in a reverse engineering fashion.
Object oriented programming follows bottom up approach.
Note : A bottom-up approach is the piecing together of module (or small program) to give rise to more complex program, thus making the original modules of the emergent program.
There is no access specifier in procedural programming.Object oriented programming have access specifiers like private, public, protected etc.
Adding new data and function is not easy.Adding new data and function is easy.
Procedural programming does not have any proper way for hiding data so it is less secure.Object oriented programming provides data hiding so it is more secure.
In procedural programming, overloading is not possible.Overloading is possible in object oriented programming.
Overloading methods lets you define the same method multiple times so that you can call them with different argument lists (a method’s argument list is called its signature)
In procedural programming, function is more important than data.In object oriented programming, data is more important than function.
Procedural programming is based on unreal world.Object oriented programming is based on real world.
Data can move freely from procedure to procedure in the systemObjects can move and communicate with each other through member functions
Examples: C, FORTRAN, Pascal, Basic etc.Examples: C++, Java, Python, C# etc.
Difference between Procedural and Object Oriented Programming

Mental Ability – Competitive Exam Preparation – Number Series by adding fixed number – NTSE, NCO, NSO, IMO and other Competitive Exams

Mental Ability – Competitive Exam Preparation – Number Series by adding fixed number – NTSE, NCO, NSO, IMO and other Competitive Exams

The sequence or series of numbers created by adding fixed number :

  1. 5 , 7 , 9 , 11 , 13 etc – Number sequence obtained by adding fixed number 2
  2. 6, 11, 16, 21, 26 etc – Number sequence obtained by adding fixed number 5

Similarly number sequence can be obtained by adding two fixed numbers alternatively or by adding two fixed numbers after repeated series. Example below:

5, 7, 10,12, 15, 17, 20 etc – This number sequence is formed by adding 2 and 3 alternatively

5, 6, 7, 9, 11, 13, 16, 19, 22 etc – This number sequence is formed by adding fixed number 1 , 2 and 3 after regular interval i.e after 3 numbers

Below is some questions to practise this. Please leave your answers in comment box on this page or write to us on abhyas.practise@gmail.com.

We will revert back with right answers at the earliest

Complete the sequence by adding fixed numbers

  1. 1234, 1236, 1238, _____, 1242, 1244, _____
  2. 1400, 1500, ______ , 1700, 1800, 1900, ______
  3. 3, 9, 15, _____, 27, 33, 39, ______, 51
  4. 8, 17, _____, 35, 44, _____, 62
  5. 10, 15, 25, 35, 40, 45, 55, 65, _____ , 75, 85, ______
  6. 6, 9, 15, 21, 24, 27, 33, ______ , 42, ______
  7. 3, 5, 7, 10, 13, 16, 18, 20, _____, 25, ______, 31
  8. 10, 20, 50, _____, 90, 100, 130, 160, _____, 180, 210, 240
  9. 1000, 1200, 1600,________, 2200, 2400, 2800, 3200
  10. 86, 96, 116, 136, 166, ______, 236, 276, 326, 376

Please like and share this post if you like this page.

Unified Cyber Olympiad 2020 – Class 2 Examination Papers – Part 5

Unified Cyber Olympiad 2020 – Class 2 Examination Papers – Part 5
CLASS : 2


Select the correct option to answer every question given below.

Class – 2 Computers

41. Select the incorrect match.

42. The mouse which has a rubber or a metal ball under its belly is known as _.
(A) Mechanical mouse (B) Optical mouse
(C) 3D mouse (D) Tactile mouse

43. Who am I ?
• I am the processing unit of a computer.
• All major activities of the computer are
coordinated by me.



44. The given images shows the use of computers in

(A) Police station (B) Bank
(C) School (D) None of these

45. By speaking into __ you can record your voice in the computer.

Class – 2 English

46. Complete spellings correctly for given pictures and match them correctly to get the complete mark.

(A) P = (ii), Q = (iii), R = (i), S = (iv)
(B) P = (iv), Q = (ii), R = (iii), S = (i)
(C) P = (i), Q = (ii), R = (iii), S = (iv)
(D) P = (ii), Q = (iii), R = (iv), S = (i)

47. Select option that is a plural.
(A) Class (B) Rice (C) Sheep (D) Cheese

48. Which option is a wrong spelling ?
(A) Sparrow (B) Girraffe (C) Elephant (D) Zebra

49. Select option that is a collective noun.
(A) Rack (B) Sack (C) Pack (D) Hack

50. Select option that can be a past tense.
(A) Catch (B) Cut (C) Sell (D) Eat

Unified Cyber Olympiad 2020 – Class 2 Examination Papers – Part 4

Unified Cyber Olympiad 2020 – Class 2 Examination Papers – Part 4
CLASS : 2


Select the correct option to answer every question given below.

Class – 2 Computers

31. Which of the following is/are an example of the latest computing device ?


32. Select the option which refers to the use of computers in the picture.


(A) Sports (B) Hospitals
(C) Defence (D) Railways

33. Select the correct device that is used only for output.


34. Who am I ?
• I have numbers and letters printed on it.
• It is required to type data into a computer.

35. Which of the following is not an electric device ?

36. Which device is used in supermarkets for billing purposes ?


37. Who am I ?
• A portable video game console.
• I comprises of built in screen, game controls and speakers.
(A) Handheld game console
(B) Mouse console
(C) Keyboard console
(D) Portable speaker console

38. What kind of computer device do you see here ?


(A) input (B) output
(C) storage (D) processing

39. Which of the following statements is CORRECT about the given images ?

(A) Image 1 shows input, Image 2 shows output and Image 3 shows processing.
(B) Image 1 shows output, Image 2 shows input and Image 3 shows processing.
(C) Image 1 shows input, Image 2 shows processing and Image 3 shows output.
(D) Image 1 shows output, Image 2 shows processing and Image 3 shows input.

40. Which of the following statements indicate that computers are used in hospitals ?
(A) Computers are used to maintain records of patients.
(B) They can also be used to diagnose the presence of
disease in a patient.
(C) They also help the doctors in performing operations.
(D) All of these

Unified Cyber Olympiad 2020 – Class 2 Examination Papers – Part 3

Unified Cyber Olympiad 2020 – Class 2 Examination Papers – Part 3
CLASS : 2

Select the correct option to answer every question given below.

Class – 2 Reasoning

21. Choose the odd one out.


22. Which tile in the options complete the grid ?

23. Select the shadow of the given figure.

24. Count the number of smiley.


(A) 18 (B) 22 (C) 20 (D) 21

25. Find the total number of differences between two images.


(A) 2 (B) 3 (C) 4 (D) 1

26. The shapes are put one behind the other. Identify the shape in the THIRD position from the front.


27. Which colour tile is used for more number of times ?

28. The image is cut through the red dotted lines. Which option cannot be one of the pieces after the cut ?

29. Select the matching pair.
Young : Old : : Wide : ?
(A) insufficient (B) narrow
(C) big (D) long

30. If the dots numbered 2-4-6-2 are connected, which shape will they form ?

Unified Cyber Olympiad 2020 – Class 2 Examination Papers – Part 2

Unified Cyber Olympiad 2020 – Class 2 Examination Papers – Part 2
CLASS : 2

Select the correct option to answer every question given below.

Class – 2 Mental Ability

11. Sahas needs to place 3 numbers in place of question
marks. Choose the correct option of numbers that will
make equation true.
? + ? – ? = 15
(A) 7, 2, 5 (B) 4, 10, 7
(C) 2, 6, 10 (D) 10, 7, 2


12. Which two trees are of the same height ?

(A) Q and S (B) P and R
(C) P and Q (D) R and S

13. Navya has a bag of marbles in three colours. She has twelve more red marbles than white marbles. She has three fewer white marbles than green ones. There are eight green marbles. How many marbles are in the bag ?


(A) 30 (B) 23 (C) 25 (D) 39

14. Eesha and Jhony each have 15 tiger stickers. Tinku has 20 tiger stickers. Which process could they use to find out how many tiger stickers they have altogether ?


(A) Add 15 and 20
(B) Add 15 and 20, then multiply by 2
(C) Multiply 15 and 20
(D) Multiply 15 by 2, then add 20

15. Select the number that replaces the question mark.

(A) 14 (B) 13 (C) 6 (D) 8

Class – 2 Reasoning

16. Which option should go in place of question mark ?

17. Which option completes the second pair in the same way as the first pair ?

18. Identify the hidden animal from the given image and select the correct option.


(A) Frog (B) Snake
(C) Fish (D) Camel

19. Choose the odd one out ?

Which option completes the second pair in the same way as the first pair ?

Unified Cyber Olympiad 2020 – Class 2 Examination Papers – Part 1

The content contains examination questions for the Unified Cyber Olympiad 2020 for Class 2. It includes questions related to mental ability, number bonds, arithmetic operations, shapes, and counting. Topics covered include numbers, pictures, shapes, counting, and basic arithmetic.

Unified Cyber Olympiad 2020 – Class 2 Examination Papers – Part 1
CLASS : 2

Select the correct option to answer every question given below.
Class – 2 Mental Ability

1. What is the missing number in the number bond ?

(A) 5 (B) 6 (C) 3 (D) 4

2. Manasa has 6 more stickers than Priya. Priya has 15
stickers. How many stickers will be there with Manasa ?
(A) 21 (B) 19 (C) 20 (D) 18

3. Which is the sixth animal from the left ?

(A) C (B) D (C) E (D) F

4. Which number statement best represents the given picture ?


(A) 5 + 2 = 7 (B) 7 – 2 = 5
(C) 3 + 2 = 5 (D) 5 – 2 = 3

5. Which of the given images are in the shape of a circle ?

(A) 1, 3, 6 (B) 1, 5, 6
(C) 3, 4, 5 (D) 1, 6

6. If there are 12 girls and 8 boys in each group, how many children are there in 8 groups ?
(A) 80 (B) 140 (C) 120 (D) 160

7. The arrow shows how much the minute hand travels.
Based on the picture, how many minutes have passed ?

(A) 25 minutes (B) 30 minutes
(C) 35 minutes (D) 45 minutes

8. Which pair of cards have a sum of 28 ?



9. Which pair of children saved the same amount of money ?



(A) Krish and Ria (B) Maya and Krish
(C) Ria and Maya (D) Anu and Maya

10. Kushi has 10. She spent some money on an eraser and had 6 left. How much did the eraser cost ?
(A) 5 (B) 4 (C) 8 (D) 6