TRUE IQ COMPUTER ONLINE ACADENY
SOLVED QUESTIONS
+1 COMPUTER
APPLICATION
SOLVED QUESTIONS
FROM
PREVIOUS QUESTION PAPERS
HTTPS://TRUEIQ1.BLOGSPOT.COM
PLUS ONE COMPUTER APPLICATION
First Year Computer Application(Commerce)
Previous Questions Chapter wise ..
Chapter 1. Fundamentals of Computer
1. Meaningful and processed form of data is known as ...................
Ans. Information
2. which of the following is known as the brain of the computer.
a). Central Processing unit
b).Control Unit
c). Arithmetic Logic Unit
d). Monitor
Ans. a
3. Name the character representation coding scheme developed in India and approved by
the Bureau of Indian Standards(BIS).
Ans. ISCII stands for Indian Standard Code for Information Interchange or Indian
Script Code for Information Interchange.
4. .Find the smallest number in the list.
(a) (1101)2
b) (A)16
c) (13)8
d) (15)10
Ans. b
5. .Fill the series .
(151)8 ,(153)8,(155)8,................ ,.................
Ans. (157)8,(160)8
6. Convert the Hexadecimal (A2D) into octal equivalent
Ans. (A2D)16= (1010 0010 1101)2
101,000,101,101 = (5055)8
7. Represent -83 in 1’s Complement form
8. Write a short note on Unicode.
Using 8-bit ASCII we can represent only 256 characters. This cannot represent all
characters of written languages of the world and other symbols. Unicode is developed to resolve
this problem. It aims to provide a standard character encoding scheme, which is universal and
efficient. It provides a unique number for every character, no matter what the language and
platform be. Unicode originally used 16 bits which can represent up to 65,536 characters.
9. Fill in the blanks
a). (DA)16 = (…. …….)2
b). (25)10 = (…….. ..)8
Ans.a. (11011010)2
b. (29)8
10. Represent -35 in the following forms:
(Hint: Use 8 bit form of representation)
a). Sign and magnitude.
b). One’s complement.
c). Two’s complement.
Binary value of 35 =100011
8 bit form of 35= (00100011)2
then (-35)10 =( 11011100)2
a) Sign and magnitude = 1 and 1011100
On's complement = 11011100
Two's complement = 11011100+1= 11011101
11. If the binary equivalent of 56 is (111000)2 find the 1's complement form, and Sign &
Magnitude form of –56 (negative 56) in 8 bits.
If (56)=(111000)2
1's complement form = (000111)2
Binary value of 56 in 8 bit form= (00111000)2
Binary value of -56 in 8 bit form= (11000111)2
sign bit is MSB 1 and remaining bit is magnitude that is 1000111
To get the negative integer number representation on 8 bits,
signed binary one's complement, replace all the bits on 0 with 1s
and all the bits set on 1 with 0s (reversing the digits):
!(0011 1000) = 1100 0111
12. Despite of the high speed and accuracy, computers are said to be the slaves of human
beings. why?
computers can execute millions of instructions in a second. The results produced after
processing the data are very accurate, but computers do not have adequate knowledge or
intelligence to interpret the results. They only carry out instructions like an obedient servant. The
computer gives correct results only if the data and instructions given are correct. The term
Garbage In Garbage Out (GIGO) is used to mean this feature. That is, if a wrong input is given
to the computer, it will give a wrong output.
13. a)Write the two’s complement form of the decimal number -119
b)State the benefit of using two’s complement representation as compared to one’s
complement form.
Ans. a). Binary of 119 in 8-bit form = (01110111)2
-119 in 1’s complement form = (10001000)2
2's complement form= 10001000+1= (10001001)2
b). The primary advantage of two's complement over one's complement is that two's
complement only has one value for zero. One's complement has a "positive" zero
and a "negative" zero. Next, to add numbers using one's complement you have to
first do binary addition, then add in an end-around carry value.
14. Data processing refers to the activities performed on data to generate information. List the
stages of data processing.
(a) Capturing data (b) Input of data (c) Storage of data (d) Processing / manipulating
data (e) Output of information (f) Distribution of information
Capturing data
When we apply for admission to the higher secondary course, we usually provide details
through a prescribed application form. The authority is actually collecting the required data for
the admission process through the proforma. This is the first stage in data processing. The
proforma, also known as the source document, is so designed that all relevant data to be recorded
in proper order and format. Thus, preparation of hard copy of source document and data
collection are the activities that take place in this stage.
Input
In the case of seeking admission, we submit the filled up application form to the school.
There the data is extracted and fed into the computer. Sometimes, we may enter these details
directly into the computer. Feeding data to the computer for processing is known as input. The
input data is usually stored in computers before it is processed.
Storage
In many cases, the amount of data given to the computers will be large. Besides, the data
entry may not be completed in a single session or a day. In the case of admissions, the data of
lakhs of applicants is input to the computer. It usually takes a few weeks to complete the data
entry. So the data input at different times should be stored then and there. The processing will
start only after the entire data is stored. The information obtained as a result of processing is also
stored in the computer. This stored data and information can be used in future for various
purposes.
Process
The data stored in computers is retrieved for processing. Various operations like calculation,
classification, comparison, sorting, filtering, summarising etc. are carried out as part of
processing. In the case of admission to the higher secondary course, Weighted Grade Point
Average (WGPA) of each applicant is calculated. Then the applicants are listed under various
categories based on the descending order of WGPA. Here, school of choice, course, and
performance in various co-curricular activities are considered. Finally, allotment lists for schools
and allotment slips for applicants are prepared.
Output
The information obtained after processing will be available in this stage. Output stage should
provide the information in such a form that the beneficiary should be able to take decision or
solve the problem. In the case of admission to the higher secondary course, allotment slip for the
applicant and allotment list for the school are generated in the desired format as outputs.
Distribution of information
The information obtained in the output stage is distributed to the beneficiaries. They take
decisions or solve problems according to the information. For example in higher secondary
admission, the allotment slips are distributed to applicants for joining the school allotted and
allotment lists are issued to the schools for admitting the eligible applicants. The allotment slips
may be used to prepare admission register or roll list of classes. The allotment lists may be used
to prepare nominal roll for registering the students for public examination.
15. a). Convert (1010.11)2 to decimal.
b). Find the missing terms in the following series.
(18)16 , (1A)16 , (1C)16 , ……. , ……….
Ans. (1010.11)2
decimal part 1010=0*2^0+1*2^1+0*2^2+1*2^3
=0+2+0+8
= 10
fractional part 11=1*2^-1+1*2^-2
= 1/2+1/4
=.5+.25
=.75
so the answer is (10.75)10
b). (1E)16,(20)16
16. If (M)8 = (96)10 = (N)2, find M and N.
(M)8=(96)10
M=140
(96)10= (1100000)2
N=1100000
17. .If (11011)2=(A)8=(B)16=(C)10 .Find the value of A,B and C.
(11011)2
For octal conversion grouping 3bits format
then one 0 add in MSB
that is the binary bit 011011=011,111=(37)8
For hexadecimal conversion grouping 4 bits format
then three 0s add in MSB
that is our bit becomes 00011011=0001,1011
(1B)16
(11011)2= 1*2^0+1*2^1+0*2^2+1*2^3+1*2^4
= 1+2+0+8+16
=(27)10
Then A=37 ,B=1B and C=27
(37)8,(1B)16 & (27)10
PLUS ONE COMPUTER APPLICATION
First Year Computer Application(Commerce)
Previous Questions Chapter wise ..
Chapter 2.Components Of The Computer System
1. Write the full form of HDMI
Ans. High Definition Multimedia Interface
2. The process of converting source code into object code is called ….. …….
Ans. Compilation
3. Write an example of an operating system that is a free and open source software
1) Linux kernel. The Linux kernel is a prominent example of free and open source software. ...
2) GNU Utilities and Compilers. ...
3) Ubuntu. ...
4) BSD Operating Systems. ...
4. .. …… is a software used for removing worms and trojans
Ans. Anti-virus
5. “Central Processing Unit(CPU) is the brain of the computer”.What is the role of Control
Unit(CU) in the CPU
The Central Processing Unit (CPU) is the "brain" of the computer. It executes instructions
(from software) and tells other components what to do. ... The Control Unit deciphers and carries
out instructions.
6.USB stands for--------------
Ans. Universal Serial Bus
7. “ e-Waste is one of the major problems which we are facing all over the world”. Justify the
statement
Yes. The reason often comes down to their packaging. There is definitely a false sense of
security when it comes to our electronics being non-hazardous when they become waste. Part of
the problem is the packaging of the devices. Their sleek and appealing exteriors make it hard to
see them as waste.
8. Which one of the following CPU register hold the address of the next instruction to be
executed by the processor.
a). Accumulator
b). Instruction Register(IR)
c). Memory address register
d). program Counter(PC)
Ans. d
9. Which one of the following is used to connect a projector to a computer?
a) USB port
b) PS/2 port
c) Parallel port
d) VGA port
Ans. d
10. Differentiate between a compiler and an interpreter.
Compiler is also a language processor that translates a program written in high level
language into machine language. It scans the entire program in a single run. If there is any error
in the program, the compiler provides a list of error messages along with the line number at the
end of the compilation. If there are no syntax errors, the compiler will generate an object file.
Translation using compiler is called compilation. After translation compilers are not required in
memory to run the program. The programming languages that have a compiler are C, C++,
Pascal, etc
Interpreter is another kind of language processor that converts a HLL program into
machine language line by line. If there is an error in one line, it reports and the execution of the
program is terminated. It will continue the translation only after correcting the error. BASIC is
an interpreted language.
11. Compare RAM and ROM
RAM ROM
1. It is faster than ROM It is a slower memory
2 It stores the operating system, application It stores the program required to
boot programs and data when
initially the the computer
Computer is functioning
3. It allows reading and writing. Usually allows reading only.
4. It is volatile, i.e. its contents are lost It is non-volatile
when the device is powered off.
12. Consider that NSS volunteers of your school have taken up a campaign to educate your
friends in other schools to reduce e-Waste.
a). Write four captions(methods) for the campaign through which students can reduce the
volume of e-waste produced
b). Explain e-Waste disposal methods
c). Define the term, green - computing. How can you implement green –computing
Ans. a). Reuse: It refers to second-hand use or usage after the equipment has been upgraded or
modified.
b). Recycling of e-Waste: Recycling is the process of making or manufacturing new
products from a product that has originally served its purpose.
c). Refuse : Use alternatives if there is or buy only it is necessary.
d). Incineration: It is a controlled and complete combustion process in which the waste is burned
in specially designed incinerators at a high temperature
e). Land filling: It is one of the most widely used, but not recommended methods for disposal of
e-Waste.
c). Green computing is the designing, manufacturing, using and disposing of computers and
associated components efficiently and effectively with minimal or no impact on the
environment. To make computer green,
a). Green design: Designing energy-efficient and eco-friendly computers, servers, printers,
projectors and other digital devices.
b). Green manufacturing: Minimising waste during the manufacturing of computers and other
components
c). Green use: Minimising the electricity consumption of computers and peripheral devices and
using them in an eco-friendly manner. Minimise printing and maximize the use of soft copy
d). Green disposal: Reconstructing or recycling unwanted electronic equipment.
13. Arrange the following memory storage devices on the base of their speed in ascending
order.
a). Hard Disk b). Cache c). RAM d). Registers
Ans. c). RAM
a). Hard Disk
b). Cache
d). Registers
14. Differentiate or define the terms software and hardware in a computer system. Give one
example for each.
Hardware is the tangible and visible parts of a computer.
Eg. Processor, Mother board etc
Software is a set of programs that help us to use the computer system or electronic devices
efficiently.
Eg. Operating System, Antivirus etc.
15. What do you mean by utility software? List any four types of utility software with their use
Utility software is a set of programs which help users in system maintenance tasks and in
performing tasks of routine nature.
Some examples are,
a). Compression tools: Large files can be compressed so that they take less storage area. hese
compressed files can be decompressed into its original form when needed.
Eg. Winzip, 7zip etc.
b). Disk defragmenter: Disk defragmenter is a program that rearranges files on a computer
hard disk.
c). Backup software: Backup means duplicating the disk information as a protection from loss.
d). Antivirus software: Antivirus software is a utility program that scans the computer system
for viruses and removes them.
16. Explain any five commonly used secondary or (auxilliary) memory devices.
Different categories of storage devices are magnetic, optical and semiconductor memory.
i. Magnetic storage devices Magnetic storage devices use plastic tape or metal/plastic disks
coated with Magnetic materials. Data is recorded magnetically in these devices. Eg. 1.
Floppy Disk, 2. Hard Disk, 3. Magnetic Tape
a). Floppy Disk: It is made up of plastic coated with magnetic material. Its capacity is 1.44 MB.
A floppy drive is used to read the data from a floppy disk. Data will lose when it kept inside a
magnetic field or other chemicals, because it coated with magnetic substances.
b). Magnetic Tape: It can store huge volume of data and cheap. Data is stored in thin tape coated
with magnetic material. It is a sequential access medium.
c). Hard Disk: It contains a group of metallic disks, coated with magnetic material in a dust proof
case. Each plate has read write head. It has huge capacity from 10 GB to 4 or more TB. The
recordable surface of a disk is divided into number or invisible concentric circles called Tracks.
Each track again divided into pie shaped segments called sectors.
ii. Optical storage devices Optical disk is a data storage medium which uses low-powered laser
beam to read from and write data into it. It consists of an aluminum foil sandwiched between two
circular plastic disks. Data is written on a single continuous spiral in the form of pits and lands.
They are classified into three,
a). Compact Disk (CD): It is made up of a layer of aluminum on a plastic plate. Its capacity is
700 MB. It may be CDROM or WORM (write ones read many) or CD R/W. To read and write
red beam of laser light is used.
b). Digital Versatile Disc (DVD): It is faster and has more storage capacity than CD. Its capacity
is from 4.7 GB to 15.9GB
c) Blue Ray DVD: Used to store High Definition videos and huge amount of data storage. It uses
blue-violet LASSER beams that allows data is packed more tightly.
iii. Semiconductor storage (Flash memory) Flash drives use EEPROM chips for data storage.
They do not contain any moving parts. Flash memory is faster and durable when compared to
other types of secondary memory.
a). USB flash drive A flash drive is a small external storage device, which consists of flash
memory typically the size of a human thumb. USB flash drives are portable and rewritable.
b). Flash memory cards Flash memory card is another type of flash memory. They are flat and
small in size.
17. Compare Dot matrix printer, Ink jet printer, Laser printer and Thermal printer on the basis
of their working speed, quality of printing, and expense for printing
Characters are formed by the impact of pin sets. When print head moves pins are strike on the
paper. They versatile (can print both text and graphics), Print cost is low but low speed, low
quality and noisy. But we can change the font settings.
Inkjet printers form the image on the page by spraying tiny droplets of ink from the print head.
There is no physical contact between print head and paper. Printing speed is high. It gives high
quality with colour printing and it does not produce noise. But the cost of ink cartridges makes it
a costly in the long run.
Here carbon powder (toner) acts as carbon ribbon. The image to be printed is transferred to a
drum using a laser beam. The toner powder sticks onto the portions traced on the drum by the
laser beam. It is transferred to a paper by rolling the paper over the drum. Printing speed is high.
It gives high quality with colour printing and it does not produce noise.
Thermal printing produces a printed image by selectively heating heat-sensitive thermal paper
when it passes over the thermal print head. The coating turns black in the areas where it is
heated, producing an image.
18. What are the types of memories used in computer
Memory is a place where we can store data, instructions and results temporarily or
permanently. Memory can be classified into two: primary memory and secondary memory.
Primary memory in a computer holds data, intermediate results and results of ongoing jobs
temporarily. Eg. RAM. (Random Access Memory): It refers to the main memory that
microprocessor can read from and write to. Data can be stored and retrieved at random from
anywhere within the RAM.
ROM is a permanent memory that can perform only read operations and its contents cannot be
easily altered. ROM is non-volatile; the contents are retained even after the power is switched
off. Eg. Basic Input Output System (BIOS).
Some modified types of ROM are,
a). PROM - Programmable ROM which can be programmed only once.
b).EPROM - Erasable Programmable ROM that can be erased using ultra violet radiation
and can be programmed using special electronic circuits.
c).EEPROM - Electrically Erasable Programmable ROM which can be erased and rewritten
electrically. Eg. Pen Drive
Cache memory is a small and fast memory between the processor and RAM. It helps to improve
the speed and performance of the computer system.
Secondary memory is permanent memory. Secondary memory is much larger in size than RAM,
but is slower. It stores programs and data but the processor cannot access them directly.
Eg. Hard Disk, CD , ROMs etc.
19. Mr.Rajmohan wants to buy a computer.He is an engineer by profession.He wants a device to
Draw which can be used to ‘draw directly on the screen.
a)Suggest him an input device.
b)Suggest him any four practices of green computing
Ans. a) Light pen
b). green IT includes hardware, software, tools, strategies and practices that improve and
promote environmental sustainability. Green IT benefits the environment by improving energy
efficiency, reducing greenhouse gas emissions, using less harmful materials, the re-use and
recycling is also important.
PLUS ONE COMPUTER APPLICATION
First Year Computer Application(Commerce) Previous Questions
Chapter wise ..
Chapter 3. Principles Of Programming And Problem Solving
1. Fill the blank
Source Code ---- ……….. …. …… Object Code
Ans. Translation
2. The process of converting source code into object code is called………
Ans. Translation
3. In a flowchart, the terminal symbol(ellipse) is used to indicate … .. and …..
Ans. Start and Stop
4. . .. … is the step by step procedure to solve problem.
Ans. Algorithm
5. Observe the following statements.
a)Internal documentation consists of procedure for installing and using the
program.
b)Flowchart are pictorial representation of algorithms.
Choose the most appropriate answer from the options given below.
i)Statement a) is correct
ii)Statement b) is correct
iii)Both statements are correct
iv)Both statements are incorrect.
Ans. i.
6. Which of the following is not a part of program documentation?
a). Writing comments in the source code.
b). Detecting and correcting errors.
c). preparation of system Manual.
d). Preparation of user manual.
Ans. b
7. While writing a C++ program, a student forgot to put semicolon at the end of the
declaration statement .What type of error can he expect during compilation?
Ans. Syntax Error.
8. Write short notes on the following :
a). Coding
b). Debugging
Ans.a. writing of actual program in computer language.
b. Finding and correcting of errors in the program .
9. What are the characteristics of an algorithm?
a). It will begin with instructions to accept inputs.
b). Uses variables to refer data.
c). Each instructions should be precise and clear.
d). Instructions should be simple.
e). The total time taken to carry out all steps should be finite.
f). After performing the instructions, the desired output must be obtained
10. Briefly explain different phases in programming.
a). Problem Identification : To identify the data involved in processing, its types,
formula to be used, activities involve and the output to be obtained.
b). Preparing of Algorithms and flowchart: to develop a step by step procedure
for problem solving.
c). Coding: writing of actual program in computer language.
d) Translation: Conversion of high level language program to machine language.
e). Debugging : Finding and correcting of errors in the program
f). Execution and testing : Running of the program and testing for correctness.
g). Documentation: It will help to understand the program for proper usage and
modification.
Two types of documentations.
1) Internal documentation : Adding comments in program code etc..
2) External Documentation: Writing manuals about the program for user help.
11. Write an algorithm to find the sum and average of 3 numbers.
Step 1 : Start
Step 2 : Get the input of three real numbers and store in a,b,c
Step 3: calculate sum <- a + b + c
Step 4: calculate avg <- sum / 3
Step 5: print sum and avg.
Step 6 : Stop
12. Draw a flowchart to find the sum and average of even numbers between 1 and 99.
13. Write a short note on the importance of internal documentation.
A computerised system cannot be considered to be complete until it is properly
documented. In fact documentation is an on-going process that starts in the problem
study phase of the system and continues till its implementation and operation. We can
write comments in the source code as part of documentation. It is known as internal
documentation. It helps the debugging process as well as program modification at a
later stage.
14. Draw any six flow chart symbols and specify their standardized meanings.
15. Explain the different types of errors that may occur in a program
l there are two types of errors that occur in a program - syntax errors and
logical errors. Syntax errors result when the rules or syntax of the programming
language are not followed. Such program errors typically involve incorrect
punctuation, incorrect word sequence, undefined term, or illegal use of terms or
constructs. Almost all language processors detect syntax errors when the program is
given for translation. They print error messages that include the line number of the
statement having errors and give hints about the nature of the error.
The second type of error, named logical error, is due to improper planning of the
program's logic. The language processor successfully translates the source code into
machine code if there are no syntax errors. During the execution of the program,
computer actually follows the program instructions and gives the output as per the
instructions. But the output may not be correct. This is known as logical error. When a
logical error occurs, all you know is that the computer is not giving the correct output.
The computers do not tell us what is wrong. It should be identified by the programmer
or user. In order to determine whether or not there is a logical error, the program must
be tested.
16. Explain two types of documentation in programming.
The second type of error, named logical error, is due to improper planning of
the program's logic. The language processor successfully translates the source code
into machine code if there are no syntax errors. During the execution of the program,
computer actually follows the program instructions and gives the output as per the
instructions. But the output may not be correct. This is known as logical error. When a
logical error occurs, all you know is that the computer is not giving the correct output.
The computers do not tell us what is wrong. It should be identified by the programmer
or user. In order to determine whether or not there is a logical error, the program must
be tested.
Another version of documentation is the preparation of system manual and
user manual. These are hard copy documents that contain functioning of the system,
its requirements etc. and the procedure for installing and using the programs. While
developing software for various applications, these manuals are mandatory. This kind
of documentation is known as external documentation.
17. Errors may occur in two stages of programming.
a) Name these two stages. Explain the nature of errors in these stages.
b) The process of correcting these errors is known as .......
Ans. a) Debugging , Execution and Testing are the stages of programming.Syntax
errors ,Logical errors and Run-time errors are the errors in these stages.
Syntax errors result when the rules or syntax of the programming language are
not followed. Such program errors typically involve incorrect punctuation, incorrect
word sequence, undefined term, or illegal use of terms or constructs. Almost all
language processors detect syntax errors when the program is given for translation.
The second type of error, named logical error, is due to improper planning of the
program's logic. The language processor successfully translates the source code into
machine code if there are no syntax errors. During the execution of the program,
computer actually follows the program instructions and gives the output as per the
instructions. But the output may not be correct. This is known as logical error.
For example consider an instruction A= B/C. This statement causes interruption
in execution if the value of C happens to be zero. In such a situation, the error
messages may be displayed by the error-handling function of the language. These
errors are known as Run-time error. These errors can be rectified by providing
instructions for checking the validity of the data before it gets processed by the
subsequent instructions in the program.
b) Debugging.
18. .An algorithm is a finite sequence of instruction to solve a problem.
a)What are the characteristics of algorithm ?
b)Pictorial representation of algorithm is called .....................
Ans. a) a). It will begin with instructions to accept inputs.
b). Uses variables to refer data.
c). Each instructions should be precise and clear.
d). Instructions should be simple.
e). The total time taken to carry out all steps should be finite.
f). After performing the instructions, the desired output must be obtained.
b) Flowchart
19. Write an algorithm And Flowchart to find and display fist 100 natural numbers.
Refer text book page no.99
PLUS ONE COMPUTER APPLICATION
First Year Computer Application(Commerce) Previous Questions
Chapter wise ..
Chapter 4. Getting Started With C++
1. Which header file is responsible for cout and cin objects ?
<iostream>
2. C++ uses the .......... language processor for translation.
Ans. IDE
3. .. ….. ..are tokens that never change their values while execution takes place.
Ans. Constants/ Literals
4. IDE stands for … …. …. … …
Ans. Integrated Development Environment
5. Identify and classify the different tokens in the following C++ statement. Age =
18;
Ans: age : identifier =: operator 18 : Literal ; : Punctuator
6. Explain the rules for naming identifiers
Identifier is an arbitrary long sequence of letters, digits and underscores( _ )
The first character must be a letter or underscore ( _ ).
White space and special characters are not allowed.
Keywords cannot be used as identifiers.
Upper and lower case letters are treated differently, i.e. C++ is case sensitive
7. The following are invalid identifiers in C++. Write a reason for each
a) Id#
b) void
c) 2ab
d) avg hgt
8. Define tokens in C++. List ant four types of tokens
The term ‘token’ in the C++ language is similar to the term ‘word’ in natural
languages. Tokens are the fundamental building blocks of the program. They are also
known as lexical units. C++ has five types of tokens as listed below:
1. Keywords 2. Identifiers 3. Literals 4. Punctuators 5. Operators
9. a). What is a token in C++ ?
b). Distinguish between keywords and identifiers
Ans. The term ‘token’ in the C++ language is similar to the term ‘word’ in natural
languages. Tokens are the fundamental building blocks of the program.
b. Identifiers are the user-defined words that are used to name different program
elements such as memory locations, statements, functions, objects, classes etc. The
identifiers of memory locations are called variables. The identifiers assigned to
statements are called labels. The identifiers used to refer a set of statements are called
function names.
The words (tokens) that convey a specific meaning to the language compiler are
called keywords. These are also known as reserved words as they are reserved by the
language for special purposes and cannot be redefined for any other purposes. The set
of 48 keywords
PLUS ONE COMPUTER APPLICATION
First Year Computer Application(Commerce) Previous Questions Chapter wise ..
Chapter 5. Data Types And Operators
1. Given that x= 5 y=5. What will be the value of the expression x > y|| y > x?
Ans. False
2. While writing a C++ program, a student forget to put semicolon at the end of a declaration
statement.What type of error can he expect during compilation ?
Ans. Syntax Error
3. The memory size of float data type in C++ is ............... bytes.
a)2
b)4
c)8
d)10
Ans. b
4. Explain different types of logical operators on C++
and (&&):( Result will be true only if both the combined expressions have true value)
or(||):Result will be true only if any of the combined expressions have true value )
not(!): To get the negation of the give expression
d). input/out put operators: input(get from or extract operator), output (put to or insertion
operator)
e). Assignment operator: = (to assign a value to a variable).
5. What is the difference between “=” and “= =” operators?
When we have to store a value in a memory location, assignment operator (=) is used.
This is a binary operator and hence two operands are required. The first operand should be a
variable where the value of the second operand is to be stored.
The = symbol assigns a value to a variable, whereas == symbol compares two values and
gives True or False as the result.
6. What is the difference between x= 5 and x ==5 in C++
x=5 means the value 5 is assigned or stored the variable X but X==5 means both values
are compares and it gives true or false as the result.
7. Identify the name of following operators in C++.
&& , || , !
Ans. && : Logical And
|| : Logical Or
! : Logical Not
8. .Write the declaration in C++ for a variable that can be used to store height of a student.
Justify, why you have selected this data type in the declaration.
Ans. float Height ;
9. Which of the following is not a character constant in C++?
a) ‘a’
b) a
c) ‘8’
d)’\a’
Ans. b
10. . Memory requirement of void data type in C++ is .......... byte(s
Ans. 0 byte
11. .Let X and Y are two variables of int data type, then correct the following input
statement.
cin<< X >> Y;
Ans. cin>>X>>Y;
12. Write the output of the following C++ expressions. Let a=7,b=2.
a) a+b *3/ ++b;
b) a<=7&&b>1;
Ans. a) 7+2*3/++2 = 7+2*3/3 =7+2*1 =7+2=9
b) 7<=7&&2>1 ----->True statement
13. Write value returned by the C++ expressions
a). 60 % 25;
b). 22 / 7;
Ans. a. 10
b. 3
14. How do the type modifiers affect the size and range of int and char data types?
By using different number of bytes to store values, C++ offers three types of integers :
short, int, and long that can represent up to three different integer sizes. Each comes in both
signed and unsigned versions.In integer 4 bytes are used,ranges from 2147483648 to
+2147483647.
The char type can also be signed or unsigned. Unlike int, char is neither signed nor unsigned by
default. The choice is left to the C++ implementation in order to allow the implementer to best fit
the type to the hardware properties.
However, these distinctions are particularly important if you are using char as a numeric type.
The unsigned char represents the range 0 to 256 and signed char represents the range -128 to
127.In char 1 byte is used.
15 . Explain the difference between float g=9.8 ; and const float g=9.8?
ref 6th chapter QS 12
16. What is implicit type conversion?Why it is called type promotion ?
Implicit Type Conversion also known as 'automatic type conversion'. Done by the
compiler on its own, without any external trigger from the user. Generally takes place when in an
expression more than one data type is present. In such condition type conversion (type
promotion) takes place to avoid lose of data.
17. Distinguish between float and double data types in C++.
Float : They are numbers with fractional part. It uses four bytes of memory. It can be
represented either by scientific notation or mantissa exponential method.
Double: It is used for handling large floating point numbers. It uses 8 bytes of memory.
18. . What is a variable ?Differentiate between memory address and content of the variable.
Name given to a memory location is known as variable. It is use to store and retrieve data.
It have three part: a) variable name b). Memory address(starting address of the allocated
memory) c). Content .
The RAM of a computer consists of collection of cells each of which can store one byte of
data. Every cell (or byte) in RAM will be assigned a unique address to refer it. All the variables
are connected to one or more memory locations in RAM. The base address of a variable is the
starting address of the allocated memory space.
The value stored in the location is called content of the variable. This is also called the R-value
of the variable. Type and size of the content depends on the data type of the variable. Here the
variable name is Num and it consumes 4 bytes of memory at memory addresses 1001, 1002,
1003 and 1004. The content of this variable is 18. That is L-value of Num is 1001 and R-value is
18.
19. Briefly explain any two expressions in C++.
expressions are composed of operators and operands. It is evaluated to get a
value(returning of value) On the basis of operators expressions can be divided into,
a). Arithmetic expression: Expression in which arithmetic operators are used ( may be integer
or floating point expression)
b). Relational expression : Expression in which relational operators are used
20. Predict the output of the following operations. x = -5 and y = 3 initially.
a). –x
b). x/y
c). x % y
d). –x + -y
Ans.a. -(-5) = 5
b. -5/3 =-1
c. -5%3 = -2
d. -(-5)+-3 =2
21. . Consider the following statement. int length;
Then what is the difference between (a) and (b)? a). length = 50; b). length = = 50;
refer Qs no.s 5 and 6
22. Write sample statements in C++ for the cascading of input and output operators
Multiple use of Input / Output operators in a single statement is called cascading of I/O
Operator. Here the values are assigned to the variables from left to right.
Eg. cout << x <<y <<z;
cin >> x >> y;
23. Explain the operations involved in the following C++ expressions and write the output.
a) 5/2+3
b) (10%3)/2.0
Ans. a. 5
b. 0.5
24. Write four different C++ statements to add 1 to the value stored in the variable
Num.
25. What is the output of the following C++ statements.
X= -7 Y = 3
a) add –x with –y
b) x modulus y
Ans. a. -(-7)+3 =10
b. -7%3 = -1
26. . What are data types ?Explain the fundamental data types in C++.
Data types are the means to identify the nature of the data and the set of operations that
can be performed on the data.
There are three types of data types C++,
a). Fundamental data type (built in Data types):
They are defined in the C++ compiler. They can not be further broken down. There are 5 types
of Fundamental data types,
1). Char: They are symbols covered by the character set of C++ language. It uses only one byte
of memory (storing in memory with its ASCII value).
2). Int : Whole numbers without fractional part. It can be positive or negative, or zero. It uses
Four bytes of memory based on GCC compiler.
3). Float : They are numbers with fractional part. It uses four bytes of memory. It can be
represented either by scientific notation or mantissa exponential method.
4). Double: It is used for handling large floating point numbers. It uses 8 bytes of memory.
5). Void : uses zero bytes of memory.
27. Classify the identifiers given below as valid and invalid .Give reason for invalidity.
sum
if
_Num 1
Switch
stud Age
Ans. Valid: sum,_Num1
Invalid : if ,Switch,stud Age
if and Switch are keywords. stud Age is invalid identifier because white space is prohibited.
28.If a=5, b=7 and c=3. Predict the output of the following expresssions.
a) a<c
b) b%a
c) (a<c) && (a<b)
d) a/c
Ans. a. False
b. 7%5 = 2
c. False
d. 5/3 =1
29. Predict the value of 'b' in the following C++ code after execution of each code snippet
a) and b) Justify your answer.
a) a = 5; b = a++;
b) a = 5; b = ++a;
Ans. a. b=5
b. b=6
30. List the three numeric data types in C++ with an example for each
31. If a = 5, b = 4, c = 3, d = 4 then what is the result in x after following operation?
X=a + b – c * d;
Ans. X =5+4-3*4 = 5+4-12 = -3
32. Is there any difference between (a) and (b) by considering the following statement? char
Gender; a). Gender = ‘M’; b). Gender = “M”;
In Gender='M' means Characters are the symbols covered by the character set of the C++
language. All letters, digits, special symbols, punctuations, etc. come under this category. When
these characters are used as data they are considered as char type data in C++. We can say that
the keyword char represents character literals of C++. Each char type data is allowed one byte of
memory.
Gender="M" is wrong statement because single character representation using single quote.
33. Write a short note on arithmetic And logical operators in C++.
Arithmetic operators are defined to perform basic arithmetic operations such as addition,
subtraction, multiplication and division. The symbols used for this are +, -, * and / respectively.
C++ also provides a special operator % (modulus operator) for getting remainder during
division. All these operators are binary operators. Note that + and - are used as unary operators
too. The operands required for these operations are numeric data. The result of these operations
will also be numeric.
Using relational operators, we can compare values. Examples are 3<5, num!=10, etc. These
comparison operations are called relational expressions in C++. In some cases, two or more
comparisons may need to be combined. In Mathematics we may use expressions like a>b>c. But
in C++, it is not possible. We have to separate this into two, as a>b and b>c and these are to be
combined using the logical operator &&, i.e. (a>b)&&(b>c). The result of such logical
combinations will also be either True or False (i.e. 1 or 0). The logical operators are && (logical
AND), || (logical OR) and ! (logical NOT).
34. Write the equivalent arithmetic operations for the given C++ short hands.
i) x% =20; il) a+=2; Iii)p / = 5;
b) What is the difference between a = 20 and a = = 20?
Ans. X=X%20
b. a=a+2
c. p=p/5
a=20 means the constant 20 is assigned to the variable a. a==20 means compares two
values and it gives may true or false as the result.
35. Classify the following identifiers valid or invalid. If invalid give reason.
a). Length_1
b). _Length1
c). Length 1
d). 1Length
Ans. Valid: Length_1 ,_Length1
Invalid : Length 1 ,1Length. Because identifiers are not using digit in first and
Between words white spaces are not alloweded.
PLUS ONE COMPUTER APPLICATION
First Year Computer Application(Commerce) Previous Questions Chapter wise ..
Chapter 6. Introduction To Programming
1. What is the name files created to support C++ programs and kept in the standard library
2. In C++ which among the following is NOT a rule for a valid idea
a)The first character must be a letter or underscore(_).
b)White space and special characters are not allowed
c)Keywords can be used as an identifier
d)Upper and lower case can be treated differently.
Ans. c
3. The arithmetic assignment operation Y/=10 is equivalent to ...................
a) Y=10
b) Y=Y+10
c) Y=Y/10
d) None of these
Ans. c
4. .Which of the following is not a C++ statement?
a). x = x + 10;
b). x + = 10;
c). x + 10 = x;
d). x = 10+ x;
Ans. c
5. Which header file is responsible for cout and cin objects?
Ans. <iostream>
6. C++ program execution starts and ends within ......... function
Ans. main( )
7. Write output of the following program?
# include <iostream>
using namespace std;
int main ()
{ Int a = 10 ;
cout<<”\n a= “ << a--;
cout<<”\n a= “ << --a;
return 0;
}
Ans. output
10, 8
8. The following program finds the sum of three numbers. Modify the program to find the
average. (Average should display fractional part also).
#include<iostream>
using namespace std;
int main ( )
{ int x ,y , z, result;
cout<<"Enter values f or x ,y, z" ;
cin>>x>>y>z;
result=x+y+z;
cout<<"The answer is ="<<result;
return 0;
}
Average of 3 numbers
#include<iostream>
using namespace std;
int main ( )
{
int x ,y , z;
float avg;
cout<<"Enter values for x ,y, z" ;
cin>>x>>y>z;
avg = (x+y+z)/3;
cout<<"The answer is ="<<avg;
return 0;
}
9. Detect and correct the errors in the following C++ code.
#include<iostream>
using namespace std;
int main ( )
{
int a, b;
cout<<” Enter two numbers: “;
cin>>a and b;
a + b = c;
cout<<"Sum = “<<c;
return 0;
}
Ans.
#include<iostream>
using namespace std;
int main ( )
{
int a, b,c;
cout<<" Enter two numbers:'';
cin>>a >> b;
c= a+b;
cout<<"Sum = “<<c;
return 0;
}
10. .In the following program,some lines are missing.Fill the missing lines and complete it.
#include<iostream.h>
...............................................
{
Int num1,num2,sum;
cout<<”Enter two numbers:”;
..................................................................
..................................................................
Cout<<”Sum of numbers are =”<<sum;
}
Ans.
#include<iostream.h>
using namespace std;
int main( )
{
int num1,num2,sum;
cout<<”Enter two numbers:”;
cin>>num1>>num2;
sum= num1+num2;
Cout<<”Sum of numbers are =”<<sum;
return 0;
}
11. a). Consider the structure of C++ program given below and answer the following question.
#include<iostream>
using namespace std;
int main( )
{
Statements;
}
Write the preprocessor directive statement in the code?
b). Explain the header files in a program
Ans. a. #include
b. Header files contain information about functions, objects or derived data types and are
available along with compiler.
12. Explain the difference between float g=9.8 ; and const float g=9.8?
The const key word is used in the variable declaration to make its access read only, ie we
can’t change its value.
example const float g= 9.8
So const is known as access modifier.
But float g=9.8 is not a constant value.It change its value.
PLUS ONE COMPUTER APPLICATION
First Year Computer Application(Commerce) Previous Questions Chapter wise ..
Chapter 7. Control Statements
1. Rewrite the following C++ statement using if … else cout <<( n % 2 == 0?”EVEN” :
“ODD”);
Ans: if(n%2 == 0)
cout<<”EVEN”;
else
cout<<”ODD”;
2. Rewrite the following C++ code using if . . . else statement.
large = (n1 > n2) ? n1 : n2 ;
Ans. if(n1>n2)
cout<<n1;
else
cout<<n2;
3. Explain elements of looping statements with suitable examples.
for loop:
Syntax:
for (initialization ; test expression; update statement)
{
body of the loop;
}
eg.
for ( n=1; n< = 10; ++n)
cout << n
At first initialization takes place n=1 Then test expression evaluated n<=10 If it is true
body of the loop executed, otherwise the program control goes out of the for loop. After
execution of loop body update expression is executed ++n. it will repeated until test expression
become false.
while loop:
Syntax
Initialization of loop control variable
while ( test expression)
{
body of the loop;
updating of loop control variable;
}
eg.
n=1;
while( n< = 10)
{
cout << n ;
++n;
}
At first initialization takes place n=1 Then test expression evaluated n<=10 If it is true
body of the loop executed, otherwise the program control goes out of the while loop. After
execution of update expression ++n . repetition takes place until test expression become false.
do--while loop:
Syntax
Initialization of loop control variable;
do
{
body of the loop;
updating of loop control variable;
}
( test expression);
eg.
n=1;
do
{
cout << n ;
++n;
}
while(n<= 10);
At first initialization takes place n=1 Then test expression evaluated n<=10 If it is true
body of the loop executed, otherwise the program control goes out of the while loop. After
execution of update expression ++n . repetition takes place until test expression become false.
4. Write a C++ program to find the sum of squares of first 10 odd numbers.
5. Write a C++ program to check whether a given year is a leap year or not.
#include<iostream>
using namespace std;
int main() {
int year = 2016;
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
cout<<year<<" is a leap year";
else
cout<<year<<" is not a leap year";
return 0;
}
Output
2016 is a leap year
6. Write a C++ program print first 10 even natural numbers.
1. #include<iostream>
2. using namespace std;
3.
4. int main()
5. {
6. for(int i = 0; i < 10; i++){
7. cout<< 2 * i + 1 << ' ';
8. }
9. return 0;
10. }
7. Write output of the following C++ program
# include <iostream>
using namespace std;
int main ()
{
Int a, b, c ;
a=b=1;
c = 2;
if (a + b > c))
cout<<”\n RED”;
else if(a + b < c)
cout<<”\n GREEN”;
else
cout<<”\n BLUE”;
return 0;
}
Output:
BLUE
8. Explain the various iteration statements in C++ with syntax and example
Iteration statements are used to perform repeated execution of a set of one or more
statements in a program. They are also known as looping statements.
A looping statement has four parts
a). initialization of control variable
b). test expression
c). update statement for control variable
d). body of the loop
eg. for loop, while loop, do while loop
9.Identify the name of the following operators in C++.
&&,||,!
&& ---->AND Operator
|| ----------> OR Operator
! ----------> NOT Operator
10. do ..... while loop is a ................ controlled loop.
Ans. exit controlled loop
11. The following program finds the sum of three numbers.Modify the program to find the
average.(Average should display fractional part also).
#include<iostream>
using namespace std;
int main( )
int x,y,z,result;
cout<<”Enter values for x,y,z;
cin>>x>>y>>z;
result=x+y+z;
cout<<The answer is =”<<result;
return 0;
}
Ans.
#include<iostream>
using namespace std;
int main( )
int x,y,z;
float avg;
cout<<”Enter values for x,y,z;
cin>>x>>y>>z;
avg=(x+y+z)/3;
cout<<The answer is =”<<avg;
return 0;
}
12. The following code segment prints first 10 natural numbers.
int n=1;
while (n<=10)
{
cout<<n<<” “;
++n;
}
a)Modify the program to print first 100 natural numbers.
ans. int n=1;
while(n<=100)
{
cout<<n<<" "
++n;
}
b)Rewrite the above code using for loop.
Ans.
for(int n=1;n<=10:++n)
{
cout<<n<<" ";
}
13. List the four important elements of a loop.
Loop statements usually have four components: initialization (usually of a loop control
variable), continuation test on whether to do another iteration, an update step, and a loop body.
14. Write C++ program to input a digit and print it in words.
(Hint : if digit = 1 then print “ ONE “)
#include<iostream>
#include<cmath>
using namespace std;
int reverse(int v,int lim) /*Method to reverse the number*/
{
if(lim==1)
return v;
else
return (((v%10)*pow(10,lim-1))+reverse(v/10,lim-1));
}
void print_c(int digit,int l,int r=12) /*Method to print word equivalent
of a number*/
{
if(l!=2) /*l is the length of number */
{ /*digit is the digit being processed*/
switch(digit) /*TO print digit at ones place*/
{
case 1: cout<<"one ";
break;
case 2: cout<<"two ";
break;
case 3: cout<<"three ";
break;
case 4: cout<<"four ";
break;
case 5: cout<<"five ";
break;
case 6: cout<<"six ";
break;
case 7: cout<<"seven ";
break;
case 8: cout<<"eight ";
break;
case 9: cout<<"nine ";
break;
}
}
else if(l==2) /*to print digit at tens place*/
{
switch(digit)
{
case 1: switch(r) /*TO print values such as ten,thirteen etc.*/
{
case 0: cout<<"ten";
break;
case 1: cout<<"eleven";
break;
case 2: cout<<"twelve";
break;
case 3: cout<<"thirteen";
break;
case 4: cout<<"fourteen";
break;
case 5: cout<<"fifteen";
break;
case 6: cout<<"sixteen";
break;
case 7: cout<<"seventeen";
break;
case 8: cout<<"eighteen";
break;
case 9: cout<<"nineteen";
break;
}
break;
case 2: cout<<"twenty ";
break;
case 3: cout<<"thirty ";
break;
case 4: cout<<"fourty ";
break;
case 5: cout<<"fifty ";
break;
case 6: cout<<"sixty ";
break;
case 7: cout<<"seventy ";
break;
case 8: cout<<"eighty ";
break;
case 9: cout<<"ninty ";
break;
case 0: cout<<"";
break;
}
}
}
int main()
{
int num,temp,length=0,result,n,m=0;
cout<<"Enter the number :";
cin>>num;
temp=num;
for(;num>0;num/=10)
{
length++;
}
result=reverse(temp,length);
while(result)
{
n=result%10;
m=m*10+n;
result/=10;
if(length==1)
{
print_c(n,length); /*To print the digit at ones place*/
}
else if(length==2)
{
if(n==1)
{
print_c(n,length,result); /*To print the digit at tens place like
ten,twelve etc.*/
break;
}
else
{
print_c(n,length); /*To print the digit at tens place like
twenty,thirty etc.*/
length--;
}
}
else if(length==3)
{
print_c(n,length); /*To print the digit at hundred place*/
length--;
if(n!=0)
{
cout<<"hundred ";
}
}
else if(length==4)
{
print_c(n,length); /*To print the digit at thousand place*/
length--;
cout<<"thousand ";
}