GO TO INDEX
Computer Studies II
Model Paper 2022
For Class X (Science Group)
Solution
SECTION 'B'
Short Question & Answer
Q.2: Explain the function of Inverter.
Ans: Function Of Inverter:
The Not Gate is a digital circuit that has a single input and single output. It is also called inverter because it performs a basic logic function called inversion or complementation. The Inverter has the following functions:
- The purpose of the inverter is to change one logic level to the opposite level.
- In terms of bits, it changes a 1 to 0 and vice-versa.
- NOT gate is called the inverter because output state is always opposite to the input state, so when the input is low signal, output is high signal and vice-versa.
- In digital logic, an inverter is a logic gate which implements logical negation.
OR
The NOT gate is known as the Function Inverter. The output of a NOT gate is the inverse of the input. It is represented by a bar on the top of the output. The NOT gate is a digital circuit that has a single input and a single output.Q.3: Why do we use Header Files?
Ans: Purpose Or Use Of Header File:
The primary purpose of a header file is to propagate declarations to code files. Header files allow us to put declarations in one location and then import them wherever we need them. This can save a lot of typing in multi-file programs.
OR
When we want to use any function in our C++ program then first we need to import their definition from C++ library. For importing their declaration and definition we need to include header file in program by using #include. Header file include at the top of any C++ program. The primary purpose of a header file is to propagate declarations to code files. Header files allow us to put declarations in one location and then import them wherever we need them. This can save a lot of typing in multi-file programs.Q.4: What are the Advantages of Developing Algorithms?
Ans: Advantages of Developing Algorithms:
- It helps in reducing the Chances of Error in a Program.
- It is a Step by step Representation of a Program that makes it Easier to Understand.
- It Does not involve any Programming Language which helps anyone to understand it without being a Programmer.
- Algorithm Breaks down the problem into smaller steps which makes it easier to convert the instructions into a Program.
Q No.5: List any three advantages of IDE?
Ans: Advantages of Using IDE:
- It gets you less time and Effort in Writing a Program.
- It helps in different programmers to Work on the same Project.
- It helps in Debugging the Syntax Errors in the Program.
- It makes the Programming Easier through Shortcut Keys.
Q.6: Write the function of "For" loop?
Ans: Function Of "For Loop":
For Loop: The for loop is used to repeat a statement or a block of statements for a specific number of times. The for loop includes initialization of counter, the condition and the increment.
Syntax:
for(initialization; , condition; , increment or decrement)
{
statements;
}
OR
1. "for" Loop:
- It is used to repeat a statement or a block of statements or a sequence of statements for a specified number of times.
- It is a pre-test loop as condition is tested at the start of loop.
- It starts with keyword “for” followed by loop expression parenthesis.
-
Loop expression includes
(i) Initialization,
(ii) Test Expression
(iii) Increment Or decrement - The body of the loop may have one or more statements. If there are more than one statements then they are enclosed in braces.
Syntax:
for(initialization; condition testing; increment/decrement)
{
statement(s);
}
Q.7: List 5 Common High Level Languages used and Describe any one?
Ans: Common High Level Languages:
- Python
- Java
- C++
- C#:
- JavaScript:
- Pasacl
- COBOL
- FORTRAN
- BASIC
Python:
Python is used for Data Analytics, Machine Learning, AI Programming, and many other tasks
Uses in Popular Apps: Google, Spotify, Instagram
Java:
Java Language is Mostly used for Mobile Application Development
Some popular uses of Java are: Facebook, Messenger, Whatsapp
C / C++:
C is general purpose language that also works well with microcomputers. It is useful for developing operating systems, spreadsheets programs, database programs, Browsers. C++ is a version of C that incorporates object-oriented technologies. Some Popular uses are: Windows, Mozilla Firefox
C#:
C# (C-sharp) is Mostly used in Developing Games and Web Applications Some Popular Uses are: Temple Run, Pubg
JavaScript:
Used in Developing Websites Some Popular Uses are: Netflix, Facebook Web
Pascal:
A language that is widely used on microcomputers and easy to learn is Pascal, named after Blaise Pascal, a French mathematician. This language has become quite popular in computer science educational programs.
COBOL:
COBOL which stands for Common Business-Oriented Language is one of the most frequently used programming languages in business. Though harder to learn than BASIC its logic is easier to understand for a person who is not a trained programmer.
FORTRAN:
Short for Formula Translation, FORTRAN is a widely used scientific and mathematical language. It is very useful for processing complex formulas. That’s why many scientific and engineering programs have been written in this language.
BASIC:
BASIC, in full Beginner’s All-purpose Symbolic Instruction Code, computer programming language is One of the simplest high-level languages, with commands similar to English, it can be learned with relative ease even by schoolchildren and novice programmers. Its small size and simplicity made BASIC a popular language for early personal computers.
(Note: Name any 5 and describe any one as mention in question)
Q.8: Why do we need a language translator?
Ans: Language Translator:
The computer can only understand the Machine Language which can be difficult to understand by Humans. So, the Programmers use High-Level Language to build a Program. This high-level language program is called Source Code. The translator is used to convert the Source Code into Machine Language which is also Called Object Code.
OR
Computers only understand machine code (binary) which is difficult to read, write and maintain. Therefore Programmers prefer to use a variety of high and low-level programming languages. Language translators are used to translate high level language into machine language so that computer can act upon the instruction given to it.A program written in any language is called as source code.A translator takes a program written in source language as input and converts it into a machine language as output. It also detects and reports the error during translation.
Q.9: What is the basic difference between \n and \t?
- Ans: Difference Between \n And \t:
- \n: “n” stands for Newline or line feed. It inserts a new line and the cursor moves to the beginning of the next line.
- \t: “t” stands for Horizontal tab. It is used to shift the cursor to a couple of spaces to the right in the same line.
Q.10: What are the two basic concept of scratch environments?
Ans: Basic Concepts Of Scratch Environment:
The two basic concepts of Scratch Environment are:
- Sprite
- Script
1. SPRITE:
The sprites are the images of cartoons, characters or objects that we add in our project. We can have multiple sprites in our project but at least one sprite is always needed for the project. Cat is the default sprite in scratch.
2. SCRIPT:
To create a game, interactive story, animation or art work in scratch, We must add visual instructions to tell a sprite exactly what to do. The scripts are instructions that make sprites perform a task. Each sprite in a scratch project has an area for scripts through which it is programmed. Clicking on a script's thumbnail in the sprite pane will bring up the script area of that sprite.
OR
The scripts are the visual instructions to tell a sprite what to exactly do. In short, Scripts are the instructions in a visual form that make a sprite perform a specific task.Q.11: Write the purpose and syntax of the following functions (any 2): (i) cin (ii)getch() (iii) cout
Ans: (i) cin statement:
- cin is a pre defined object that reads data from the keyboard with the extraction operator(>>).
- It allows to accept data from standard input devices.
- Syntax: cin >> varaible;
(iii) getch ():
- It is a predefined function.
- It is defined in conio.h.(Console input and output header file).
- It stands for get character.
- It is used to get a single character input from user (keyboard) during execution of program.
- The entered character it is not displayed or printed on the screen.
- It is used to hold the output screen until the user press any key from the keyboard.
- Syntax: int getch();
(iii) cout statement:
- cout stands for "Character Output". Here 'C' menas "character" and 'Out' means "output".
- Cout is a predefined object in C++. It is used to produce output on the standard output device which is usually the display screen or monitor.
- The data needed to be displayed on the screen is inserted in the standard output stream (cout) using the insertion operator (<<).
- Syntax: cout << variable or cout <<exp./string << variable
Q.12: What is the purpose of Jump statements?
Ans: Jump Statements:
Jump statements change the execution of a program from its normal sequence.
Following are the jump statements in C++
- Break
- Continue
- Goto
- Return
- exit
Q.13: Write down three advantages of user define function..
Ans: Advantages of User-Defined Functions:
- The user-defined functions breaks the complex code into simpler and small one’s.
- It increases the readability of the program.
- It is easy to debug small user Defined functions.
- It can help in reducing the repetition of the same code.
OR
Ans: Advantages Of User Define Function In C++:
User defined functions in C programming has following advantages:
-
Reduction in Program Size:
Since any sequence of statements which are repeatedly used in a program can be combined together to form a user defined functions. And this functions can be called as many times as required. This avoids writing of same code again and again reducing program size. -
Reducing Complexity of Program:
Complex program can be decomposed into small sub-programs or user defined functions. -
Easy to Debug and Maintain:
During debugging it is very easy to locate and isolate faulty functions. It is also easy to maintain program that uses user defined functions. -
Readability of Program:
Since while using user defined function, a complex problem is divided in to different sub-programs with clear objective and interface which makes easy to understand the logic behind the program. -
Code Reusability:
Once user defined function is implemented it can be called or used as many times as required which reduces code repeatability and increases code reusability.
Long Question Answers
Q.14: What is the difference between source code and object code?Ans: DIFFERENCE BETWEEN SOURCE CODE AND OBJECT CODE
S.NO. | SOURCE CODE | OBJECT CODE |
---|---|---|
1. | Source code is another name for source program. | Object code is another name for object program. |
2. | A collection of computer instructions written using a human readable programming language. | A sequence of statements in binary digits that is generated after compiling the object code. |
3. | Contains English words according to syntax of programming language. | Contains binaries. |
4. | Programmers create the source code. | Compilers create the object code. |
5. | It is the input to the computer. | It is the output to the computer. |
6. | Programmers can read the source code. | Machines can read the object code. |
OR
S.NO. | SOURCE CODE | OBJECT CODE |
---|---|---|
1. | Source code is another name for source program. | Object code is another name for object program. |
2. | Source code is generated by humans or programmers. | Object code is generated by a compiler or another translator. |
3. | Source code is human-understandable. | Object code is not human-understandable. |
4. | Source code is high-level code. | Object code is low-level code. |
5. | It is less close to the machine. | It is more close to the machine. |
Q.15: Draw and define flowchart symbols?
Flowchart Symbols:
Flowchart is made up of different symbols to represent or show program and its flow. Some of them are as follows:
Q.16: Draw the Logic circuit of the following Boolean expression
a) Y = ABC (A + D)
b): X = AB (C + D)
a) Solution:
b) Solution:
when will you posts solutions?
ReplyDeleteFrom Monday Inshallah
Delete
Deletethank you so much sir .... its really helpfulll
Logic gates ko paper pe pencil se draw krty hen ya blue ink pen se?
DeleteI think black marker is better, but not confirmed. Kindly ask from your school teacher
DeleteJAZAKALLAH
Sir please mcqs bhi de de important
ReplyDeleteVery helpful sir👌
ReplyDeleteKindly upload all subjects model paper solutions.
Thank you!!
Excellent work Thank you so much Sir
ReplyDeleteKindly upload all subjects model paper
very helpful sir
ReplyDeleteVery useful Thank you so much .Bht asaan alfaz me hen saare sawalt . thank you so much
ReplyDelete