UP Board Solutions for Class 10 Commerce Chapter 25 Organisation and Enterprise

UP Board Solutions for Class 10 Commerce Chapter 25 Organisation and Enterprise

Organisation and Enterprise Objective Type Questions (1 Mark)

Question 1.
The term enterprise means:
(a) Risk-taking
(b) Profit Making
(c) A borrowed loan from market
(d) None of these
Answer:
(a) Risk-taking

Question 2.
Modern business has become very …………
(a) easy affair
(b) doubtful affair
(c) complicated affair
(d) None of these
Answer:
(c) complicated affair

UP Board Solutions

Question 3.
The functions of organisation and enterprise are ………..
(a) different
(b) similar
(c) dependable each other
(d) None of these
Answer:
(a) different

Question 4.
The entrepreneures are the owners of business and the organisers are the ………. of the business.
(a) Customers
(b) Debtors
(c) Creditors
(d) Employers
Answer:
(d) Employers

Question 5.
The organisers get salary for the service they render to the business, the entrepreneures get …………. for taking risks.
(a) Salary
(b) Rent
(c) Wages
(d) Profit
Answer:
(d) Profit

UP Board Solutions

Question 6.
Which of the following items is not the Capital from Economics point of view? (UP 2019)
(a) Fixed Deposit
(b) Investment in shares
(c) Jewellery
(d) Government securities.
Answer:
(c) Jewellery

Organisation and Enterprise Definite Answer Type Questions (1 Mark)

Question 1.
Is there no need for any research for the successful organisation? Give answer in Yes or No.
Answer:
No.

Question 2.
In enterprise an attempt to undertaking risk and bear uncertainty? Give answer in Yes or No.
Answer:
Yes.

UP Board Solutions

Organisation and Enterprise Very Short Answer Type Questions (2 Marks)

Question 1.
What is the organisation?
Answer:
The organisation is an important factor of production and enterprise is different from an organisation. Some economists still think that organisation and enterprise are the same and can be used (UPBoardSolutions.com) interchanging. In common language, the organisation means a systematic arrangement of different parts of a thing to achieve the desired result. In economics also we use the term organisation in the same sense.

Question 2.
Point out any two points of difference between organiser and entrepreneur.
Answer:
The functions of organisation and enterprise are different. The joint-stock company is the most typical business unit in which the organisation is undertaken by a paid manager and enterprise by shareholders. The functions of organisation and risk-bearing are theoretically separate. Organisers supervise and administer business while entrepreneurs take a risk.
The entrepreneurs are the owners of the business and the organisers are the employees of the business.

UP Board Solutions

The organisers get a salary for the services they render to the business, the entrepreneurs get profits for taking risks and get nothing if the business does not make any profit. The entrepreneurs bear losses when the business (UPBoardSolutions.com) runs into a loss.

Organisation and Enterprise Short Answer Type Questions (4 Marks)

Question 1.
Discuss any four functions of the organiser.
Answer:
Functions of the organiser are as follows:
(a) Sale of the Product: He tries to achieve the speedy sale at a maximum price.

(b) Provision of Proper Tools to Labourer: He provides necessary tools and machinery to labourers and does not let machinery stand idle.

(c) To find out an entrepreneur: After completing the investigations regarding the most profitable channel of investing productive resource, the organiser finds out an entrepreneur who is ready to undertake risk in the proposed business.

(d) The localisation of Production: The organiser locates the production unit (UPBoardSolutions.com) itself. In doing so he keeps in his mind several consideration such as nearness to the raw material and the power resources, availability of trained labour, transport facilities, providing to the market etc.

UP Board Solutions

Question 2.
Define the importance of organisation.
Answer:
Modern business has become a very complicated affair. It is affected by many factors. Even a small factor may change the entire form of business. Big business firms use complicated machinery which needs constant care. Labourers of varying degree of skill and ability are engaged by them. Thus a business house of today is difficult to run without the expert guidance of an organiser. He brings together the three factors of production land, labour and capital and organises them so efficiently that they give the best results. Without (UPBoardSolutions.com) an organiser, these factors can reap no fruit. Without him, capital will go waste. Labour will be misdirected. Without an organiser, production is not possible in this world.

UP Board Solutions for Class 10 Commerce

UP Board Solutions for Class 10 Commerce Chapter 24 Capital: Meaning, Classification and Characteristics

UP Board Solutions for Class 10 Commerce Chapter 24 Capital: Meaning, Classification and Characteristics

Capital: Meaning, Classification and Characteristics Objective Type Questions (1 Mark)

Question 1.
All capital is the product of (UP 2017)
(a) Investment
(b) Saving
(c) Production
(d) None of these
Answer:
(b) Saving

Question 2.
By the term capital formation we mean:
(a) Fixed Assets
(b) Capital Formation
(c) Investment
(d) None of these
Answer:
(b) Capital Formation

UP Board Solutions

Question 3.
……… and forced savings constitute the two types of savings.
(a) Voluntary
(b) Non-voluntary
(c) Either (a) or (b)
(d) none of these
Answer:
(a) Voluntary

Question 4.
…….. and ………. are essential for making additions to the stock of capital.
(a) Saving, Capital
(b) Capital, Investment
(c) Saving, Investment
(d) None of these
Answer:
(c) Saving, Investment

Question 5.
Under-developed countries are characterised by ……….. rate of capital formation.
(a) High
(b) Low
(c) Either (a) or (b)
(d) None of these
Answer:
(b) Low

UP Board Solutions

Capital: Meaning, Classification and Characteristics Definite Answer Type Questions (1 Mark)

Question 1.
Give the name of any two kinds of capital.
Answer:
Fixed and circulating (UPBoardSolutions.com) capital.

Question 2.
Which term is used in the service of money or wealth or property?
Answer:
Capital.

Question 3.
What are the primary factors of production?
Answer:
Land and Labour.

Capital: Meaning, Classification and Characteristics Very Short Answer Type Questions (2 Marks)

Question 1.
Define Capital.
Answer:
According to Marshall, “Capital consists of those kinds of wealth other than free gifts and nature which yield income.”
According to Thomas, “Capital is that part of the (UPBoardSolutions.com) wealth of individuals and communities, other than land, which is used in the production of further wealth.”

Question 2.
Give any two functions of capital.
Answer:
The following are the functions of capital:

  • Capital makes the provision of tools and implements to workers for productive purposes.
  • A part of capital is spent on purchasing raw materials.

UP Board Solutions

Capital: Meaning, Classification and Characteristics Short Answer Type Questions (4 Marks)

Question 1.
What is the importance of capital in production?
Answer:
Capital has been a very important factor of production even in earlier stages of human development. In the hunting, stage man used some implements to kill wild animals for food. These implements were his capital. Since then capital in some form or the other has played a significant role in the economic development of society. Under capitalism, capital is most (UPBoardSolutions.com) significant. It is equally important under communism. Though capital is not a primary factor of production yet its importance is as great as that of any primary factor of production such as land as labour.

Question 2.
What do you mean by Gross Capital Formation and Net Capital Formation? (UP 2016)
Answer:
Every producing unit has to make provisions for the depreciation of the plant and machinery. So, it keeps aside a part of its profits for replacing the warm out machinery and plant. But it sometimes keeps another part of its income away for buying new machinery and equipment when it feels a need to expand itself. So every producing unit not only keeps its capital intact but it tries to expand its productive capacity through making additions to further capital in future. So, the gross capital formation induces two things:

  • Maintaining capital intact.
  • Making further additions to capital equipment to expand the volume of production.

UP Board Solutions

While net capital formation includes only one thing, i.e., making further Addition to capital equipment.

Question 3.
Make out the main differences between Fixed and Circulating Capital. (UP 2009, 17)
Answer:
Difference between Fixed Capital and Circulating Capital:
Fixed Capital: Fixed Capital exists in a durable shape, renders continuous service for many years and its return is spread over a greater length of time. Fixed Capital includes those goods which are used again and again for further production. Their utility does not get exhausted in a single-use. For example, machinery is used in a factory for several years until it becomes (UPBoardSolutions.com) useless. Similarly, factory premises are fixed capital because they are used for several years. Examples of fixed capital are machinery, plant, tools, implements, building and other durable goods.

Circulating Capital: Circulating capital refers to those goods which can be used only once in production or those goods which cannot be used in production over and over again. They are single-use producer goods. Examples of circulating capital are raw materials, fuel and goods in process, money paid on wages to workers etc.

UP Board Solutions

Question 4.
Draw a clear line of demarcation between Capital and Wealth. Mention the point of differences between Land and Capital. (UP 2009)
Answer:
Difference between Capital and Wealth: Capital is that part of the wealth that is used for the production of further wealth. Thus, “all wealth is not capital, though all capital is wealth.”

Professor Benham and Fisher do not find any difference between wealth and capital because both are used for production and consumption. According to these scholars, all wealth is capital because the direct effect of goods is on production of wealth. The only difference lies in use. If, for example, a car is bought for excursions and enjoyment, it is not capital, but if it (UPBoardSolutions.com) is bought for doing business, it is capital.
Differences between Land and Capital

UP Board Solutions

Land Capital
1. Land is a free gift of nature. 1. Capital is formed through human efforts, i.e., it is a ‘produced’ agent of production.
2. Land lacks mobility. 2. Capital is fairly mobile.
3. The supply of land is fixed and limited in the area. In the event of fluctuations in rent, its supply cannot be increased or withdrawn. 3. Supply of capital can be increased or decreased with human efforts.
4. Rent of land varies. 4. Income from capital is more or less uniform.
5. Land is a permanent factor of production and indestructible. Land does not depreciate or wear out. 5. Capital is perishable and becomes completely worn out and the same needs to be replaced.

Question 5.
Distinguish between wealth and capital. Explain the importance of capital in production. (UP 2019)
Answer:
Difference between capital and wealth
Capital is a part of wealth which is used for the production of further wealth. Thus, “All wealth is not capital, Though all capital is wealth”.

Professor Benham and Fisher do not find any difference between wealth and capital because both are used for production and consumption. According to these scholars, all wealth is capital because the direct effect of goods is on production of wealth. The only difference lies in use if for example. A car is bought for excursions and enjoyment. It is not capital but if it is bought for doing business it is capital.

UP Board Solutions

Importance of capital is production in the modern large scale production system. Capital is a very important factor of production, so important that other factors of production manpower resources of a country cannot be utilised without capital nor can the natural resources be exploited for the use of man.

Capital has been a very important factor of production even in the earlier stage of human development in the haunting stage man used some implements to kill wild animals for food. These implements were his capital. Since then capital in some form or the other has played a significant role in the economic development of society. Under capitalism capital is most (UPBoardSolutions.com) significant it is equally important under communism. Though capital is not a primary factor of production. Yet its importance is as great as that of any primary factor of production such as land or labour.

UP Board Solutions

Capital: Meaning, Classification and Characteristics Long Answer Type Questions (8 Marks)

Question 1.
Define Capital and write its characteristics.
Or
Clarify the meaning of Capital. Describe the importance of capital in the business. (UP 2012)
Answer:
Meaning of Capital: Capital generally means money, but in Economics, the term capital means that part of man-made wealth which is used for further production of wealth. In the words of Marshall, “Capital consists of all those kinds of wealth other than free gifts of nature, which yield income.”

Characteristics of Capital: The main characteristics of capital are as follows:
1. Capital is man-made factor of production. Under capital, only man-made factors can be included such as machines, buildings etc. On the contrary, the gifts from nature such as land, climate etc. cannot be considered as capital.

2. All wealth cannot be counted as capital, but only that part of the wealth which is helpful in further production is counted as capital.

3. No production is possible without capital. But capital does not produce anything by itself. Production is carried out with the help of capital and it is rightly said that capital is an inactive factor of production.

4. The capital involves the element of time. The capital renders its services for a period of time. This is the reason why the payment of capital is measured in terms of a particular rate, per cent and per year.

5. The capital is subjected to depreciation. The capital used in the form of machinery (UPBoardSolutions.com) due to constant use suffers wear and tear. Therefore, this needs to be replaced.

UP Board Solutions

6. Capital possesses the quality of mobility. Capital is the most mobile factor of production. The capitalist can carry his capital anywhere he likes without any difficulty.

7. Capital has the characteristics of elasticity. Supply of capital can be increased or decreased depending upon the situation.

8. Production is possible only due to the use of capital. The application of capital (UPBoardSolutions.com) increases the efficiency of labour and productive power of all the factors of production with which it is combined and used.

UP Board Solutions for Class 10 Commerce

UP Board Solutions for Class 10 Computer Science Revision Problem

UP Board Solutions for Class 10 Computer Science Revision Problem

Question 1.
Write about the different components of the computer.
Answer:
The three components of the computer are:
1. Computer Hardware: The electronic and mechanical components that make up a computer are called hardware. All computer systems contain four types of hardware components:

  • Input Devices
  • Output Devices
  • Computer Processor
  • Secondary Storage (UPBoardSolutions.com) Devices.

UP Board Solutions for Class 10 Computer Science Revision Problem
2. Computer Software: Software is a series of instructions that tell the hardware how to perform tasks. Without software, hardware is useless. Hardware needs the instructions provided by the software to process data (UPBoardSolutions.com) into information. Computer software can be divided into two parts Le., System software and Application software.

UP Board Solutions

3. Computer User: The person who communicates with a computer or uses the information it generates is called a User.
UP Board Solutions for Class 10 Computer Science Revision Problem

Question 2.
Define different data types used in ‘C’ language. (UP 2011, 12, 19)
Answer:
Data Types in ‘C’ Language: In ‘C’ language, the foil- owing Data Types are used:

  1. Numeric data type
  2. Alphanumeric data type
  3. Date and time data type
  4. Logical data type.

1. Numeric data type: Numbers of any type constitute numeric data. The numeric data can contain only the numeric characters of 0 to 9, with or without the decimal point. Some important numeric data types are int, float and double types.

Type int: The data type, which stores numeric data, is one of the basic data types in any programming language. It contains a sequence of one or more digits. For example—int sum. The variable ‘sum’ can store an integer value. It stores non-fractional values and occupies 2 bytes.

UP Board Solutions

Type float: The float data type can be used for storing values containing decimal places. The difference between int and float is only that the int type includes only whole numbers but the float type includes both whole as well (UPBoardSolutions.com) as fractional numbers. It occupies 4 bytes.

Type double: The type double is used, when the accuracy obtained using the variable of the type float is not sufficient. Variables of the type double can store twice the number of digits as can a float type. It occupies 8 bytes. The type float saves memory as it takes only half as much space as a double.

2. Alphanumeric data type: This data type can be made up of any type of characters.
Numeric = 0 to 9
Alphabetic = A to Z and a to z
Special Characters = #, $, *, etc.
These types of characters are generally enclosed within quotes “122” is considered alphanumeric data. On alphanumeric data mathematical calculations cannot be performed.
For example:
Char can store a single character
e.g., char A = ‘X’ char A[5] = “HARSH”
A char type can also store a collection of characters known as a string.

3. Date and Time data type: These are special data types for date and time values.
Date: It is a single data type that handles both date and time values.
Time: It can handle date and time values separately.

UP Board Solutions

4. Logical data type: Logical data can have only two values le., true and false.(UPBoardSolutions.com)  A single data type handles logical data. It is represented by Boolean data type.

Question 3.
WAP that reads an integer N and calculate its factorial. (UP 2004, 05)
Answer:

#include<stdio.h>
#include<conio.h>
main()
{
int n, i, fact = 1;
printf (“Enter Non-Negative value \n”);
scanf (“%d”, &n);
for (i = 1; i <= n; i ++)
{
fact = fact * i;
}
printf (“factorial of %d = %d”, n, fact);
}

Question 4.
Write a program in C language which can arrange ten numbers in ascending order. Print the output in a column. (UP 2007, 12, 19)
Or
Write a program in C language which will find out prime numbers between 1 and 100 and will print them in a column. (UP 2008)
Answer:

#include<stdio.h>
#include<conio.h>
void main ()
{
int x [10];
int * i, sum = 0;
printf (“ Enter 10 numeric values \n”);
for (i = 0; i< = 10; i + +)
{
scanf (“% d \n”, & x [i]);
sum = sum + x [1];
}
printf (“sum of the elements is % d ”, sum);
getch ();
}

Question 5.
WAP to create a file in write mode and accept data from the user, and write it on file “student.txt.”
Answer:
Program:

#include<stdio.h>
#include<conio.h>
void main ()
{
char ch;
FILE *fp = fopen (“Student.txt”, “w”);
clrscr ();
if (fp = = NULL)
{
perror (“Error in opening file”);
exit (1);
}
ch = getc (stdin);
while (ch ! = ‘*’)
{
void main ()
{
char ch;
FILE *fp = fopen (“Student.txt”, “a”);
clrscr ( );
if (fp = = NULL)
}

UP Board Solutions

Question 6.
Write a program to take the contents of a text file and copy them into another text file, character by character. (UP 2008, 16)
Answer:
Program:

#include<stdio.h>
#include<conio.h>
void main()
{
FILE * fsrc, *ftgt;
char ch;
clrscr();
fsrc = fopen(“tryl.c”,“r”);
if (fs == NULL) .
{
puts (“Cannot open source file”)
exit ();
}
ftgt = fopen (“try2.c”, “w”);
if(ft == NULL)
{
puts (“Cannot open target file”);
fclose(fs);
exit();
}
while(l)
{
ch = fgetc(fsrc);
if (ch == EOF)
break;
else
fputc(ch.ftgt);
}
fclose(fsrc);
fclose(ftgt);
}

Question 7.
What is a programming language? Write the classification of programming language. (UP 2010)
Or
Explain the following:

  1. Low-Level Language
  2. High-Level Language.

Or
What ‘Generation of programming language? Explain.(UP 2018)
Answer:
Programming Language: Language is a means of communication. Whenever we want to communicate with com- puter system, we need to do so using a language which is acceptable and understood by a computer. A language which (UPBoardSolutions.com) is used to accomplish a task and write a solution to a given problem in the form of a program is known as the programming language.
A programming language has its own set of characters, terms, instructions, Commands, syntaxes and guidelines to use these commands. A program is always written following these rules and guidelines.

UP Board Solutions

Classification of Programming Languages: Programming languages can be classified on the basis of generations of computers as follows:
UP Board Solutions for Class 10 Computer Science Revision Problem
This classification is according to the generic upgradations in the languages as per time. As time passed by, every language made significant improvements and showed some additional features.
Similar kinds of classification of programming languages can be written as following on the basis of characteristics and features of languages.
UP Board Solutions for Class 10 Computer Science Revision Problem
The above classification is in increasing order of developmental phases of languages too.
Low-Level Language: The languages that were used in the first-generation and early second generation are called as low-level languages. They directly used computer memories and other storage hardware like registers to write programs. (UPBoardSolutions.com) These languages were highly hardware dependent or machine-dependent. Programs written for one kind of hardware platform cannot be used on some other machine. Low-level languages are further divided into the following two categories :

UP Board Solutions

  1. Machine Language,
  2. Assembly Language.

1. Machine Language: As the name suggests, it used the data in writing programs which were directly understood by the computer. A computer can only accept and work on electronic signals. These electronic signals are actually a presence or absence of electronic current in a circuit. The presence of a pulse in a circuit is denoted by 1 and absence is symbolised by ‘O’. These are the only two digits which are used by a computer system and they are known as Binary digits (or abbreviated as Bits). A language that uses these two binary digits to write computer program is known as machine language.
A program written in machine language comprises instructions in the form of a series of 1’s and 0’s.
Machine language instruction is divided into two parts:

  • Opcode,
  • Operand (Address part).

OpCode: This is the first part of an instruction which tells to the computer, what is to be done or which operation is to be performed.

Operand: This is the second part of a machine language instruction which tells (UPBoardSolutions.com) the address and location of data on which operation is to be performed.
UP Board Solutions for Class 10 Computer Science Revision Problem

2. Assembly Language: Assembly language was an advancement over machine language. It is considered as a low-level language of the second generation. In this language, binary representations for various types of data are replaced by some codes. These codes are known as ‘Mnemonics’. In assembly language, there are predefined mnemonics for an opcode, operands, registers (memory locations) etc. They collectively form an assembly language program.

UP Board Solutions
High-Level Languages: Languages that were developed after machine language and assembly languages were put under the category of high-level languages.

Characteristics of High-Level Languages:

  1. High-level languages use simple English words and commonly used mathematical symbols. This feature of high-level language makes it easier for programmers to write programs in it.
  2. Programs written in high-level languages are highly readable simply by looking at a program. Any computer literate can understand the objective of the program. These languages provide better documentation facility in programs.
  3. High-level languages are procedure-oriented. It means that they concentrate (UPBoardSolutions.com) more on procedures followed to solve any given problem.
  4. Debugging of programs written in high-level languages is much easier and fast as compared to assembly language.
  5. Programs written in high-level languages are machine-independent. It means that these programs can run on a wide variety of hardware platforms by making slight modifications if needed.
  6. High-level languages are translator based languages. This translator could either be an interpreter or a compiler.

Translator Based Languages: High-level languages can also be called as translator based languages. As explained earlier, the computer only understands machine language [le., language of 0’s and 1’s) and any other form of instruction given to it needs to be translated into machine language. High-level languages generally use simple English words and phrases which must be translated into its machine-level equivalents before execution. Therefore, for every high-level language, a separate translator is essential.

Translator: It is a kind of system software which converts a program written in high level language into machine language. This machine language code is actually executed by the computer to achieve results.

UP Board Solutions
Translators can be divided into following two categories and accordingly languages are also classified as either :

  1. Interpreter based language
  2. Compiler based language.

1. Interpreter: It is a translator for high level languages. It translates every single instruction linewise and then executes it. This process continues until the end of the program. If it encounters any error, it is informed to the user immediately. Until an error is removed, the interpreter does not proceed in a forward direction. Thus, we can say that every single line of a program (also known as source program) is checked for errors, translated and executed sequentially. Basic is an interpreter based language.

2. Compiler: It is a translator for converting programs written in high level language into machine language. Its major function is the same as that of interpreter but it works differently. It scans the entire program and lists all errors at a time. Until or unless programmer rectifies all errors, program is not translated into machine code. On successful removal of all errors, object code is created. (UPBoardSolutions.com) This object code is executed to obtain the desired result. The original program before the compilation process is called a source program.
Some compiler based languages are. ‘C\ C++, JAVA, COBOL, PASCAL, FORTRAN etc.

UP Board Solutions

Fourth Generation Languages (4 GLs): These are a group of languages that made problem solving further easier than what was available in high level languages. High level languages are procedure-oriented languages, le., they focus more on the way of solving a problem. 4 GLs are a category of languages that focus more on the objective of the given problem than on the ways and (UPBoardSolutions.com) means to solve it. These languages were designed in view of managing databases (Database is a collection of similar types of records).

UP Board Solutions for Class 10 Computer Science

UP Board Solutions for Class 10 Computer Science Chapter 11 File Operation

UP Board Solutions for Class 10 Computer Science Chapter 11 File Operation

File Operation Long Answer Type Questions (8 Marks)

Question 1.
What are the data files? Write about their different types. (UP 2011, 12)
Or
Write a short note on ‘Sequential files’. (UP 2007, 15)
Or
Write short notes on ‘Random files’ and their application. (UP 2008, 09)
Or
Explain the features of Sequential file. (UP 2016)
Answer:
Data File: Data file offers a convenient method of (UPBoardSolutions.com) storing data sets, since data files can be easily read and updated by program file (‘C’ program). Example of Data file is an employee file, which is a collection of related records.
UP Board Solutions for Class 10 Computer Science Chapter 11 File Operation
Data files can be categorized in many ways. But we will categorize them only on the basis of mode of accessing. According to this condition, there are following two types of data files:

  1. Sequential data files
  2. Random data files.

UP Board Solutions

1. Sequential Data Files: The main advantage of this type of file is that records (data) are stored sequentially, one after another, on the storage media which may be a magnetic tape or a disk. These individual data items may (UPBoardSolutions.com) be different records or single entities and may comprise numerics or strings or both. If a particular data is of string type, then it must be enclosed within quotation mark.

The main disadvantage of handling the sequential file is that any particular record can be accessed sequentially. For example, if the sixtieth record from the beginning of a sequential file is to accessed, then it has to pass over the preceding fifty-nine records. Thus, it becomes more time-consuming. But if we compare it with a random data file, it is easy to create and handle.

2. Random Data Files: The basic advantage of these files is that any particular record can be accessed directly. For example, if we want to access the sixtieth record, then it can be accessed directly without passing any preceding record. It can be stored on disks only. Thus, this method is quite faster as compared to sequential data files.
For this purpose, we use function fseek. This function sets the file position indicator associated with the stream according to the values of the offset and origin. The value of origin may be one of the following:

  • 0 – the beginning of a file
  • 1 – current position
  • 2 – end of the file.

Question 2.
Discuss different file operations of ‘C’.
Answer:
File Operation: Following are the compulsory steps to operate files:

  1. Create file.
  2. Merging file i.e., combine records of two or more files into one.
  3. Adding records.
  4. Deleting records.
  5. Update records.
  6. Generate reports.

UP Board Solutions

The ‘C’ language supports different level of file processing according to the environment used.
UP Board Solutions for Class 10 Computer Science Chapter 11 File Operation
The general functions which are supported by ‘C’ in the file processing are:

  • Input functions
  • Output functions

Input functions:
-getc()
-fgetc()
-fscanf()
-fread()

Output functions:
-putc()
-fputc()
-fprintf()
-fwrite()

fopen( ) is the main function to start the above given functions. To open a file, to create a file, to restart with existing file etc., are the main functions which are performed by it.
Syntax:
file pointer = fopen(filename, mode);
i.e., FILE *fp;
fp = fopen(TRY.C”, “r”);
fp is a pointer variable, which contains the address of the structure FILE which has been defined in the header file “stdio.h”.
fopen() will open a file TRY.C’ in ‘read* mode, which tells the (UPBoardSolutions.com) C compiler that we would be reading the contents of the file, “r” is a string and not a character. Hence, fopen() performs three important tasks when you open the file in “r” mode:

UP Board Solutions

  • It searches on the disk the file to be opened.
  • If the file is present, it loads that file from the disk into memory.
    If the file is absent, fopen() returns a NULL. This function opens one file at a time.
  • It sets up a character pointer which points to the first character of the memory where the file has been modified.

Question 3.
Write about different modes in which a file can be opened.
Answer:
File Opening Modes: The tasks performed by fopen() when a file is opened in each of these modes are also mentioned.
Character Used
for Mode → Meaning
w → Create for write
r → Open for reading
a → Open for append/create a new file
w+ → Create for read/write
r+ → Open for read/write
a+ → Open for read/write/create new file.

Question 4.
WAP to copy the contents of one file to another?
Answer:
Program:

UP Board Solutions

#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fsrc, *ftgt;
char ch;
clrscr();
fsrc = fopen(“tiyl.c”, “r”);
if (fs = = NULL)
{
puts (“Cannot open source file”);
exit();
}
ftgt = fopen(“tiy2.c”, “w”);
if (ft = = NULL)
{
puts (“Cannot open target file”);
fclose(fs);
exit();
} .
while(1)
{ . ch = fgetc(fsrc);
if (ch = = EOF)
break;
else
fputc(ch, ftgt);
}
fclose(fsrc);
fclose(ftgt);
}

Question 5.
Explain fread () and fwrite () functions.
Answer:
fread( ): This function reads a specified number of equal-sized (UPBoardSolutions.com) data items from an input stream into a block, fread returns the number of items (not bytes) actually read on success.
Syntax:
fread (& name_of_structure, size_of_(structure name), l, file pointer);
e.g.,

struct employee
{
char nm[20]; /* 20 bytes */
int age; /* 2 bytes */
};
struct employee Emp;
fread (&Emp, size of (Emp), 1, fp);

Here, the fread function can read 22 bytes of information from the file pointed by file pointer fp.
fwrite( ): This function appends a specified number of equal-sized data items to an output file.
Syntax:
fwrite (& struct—name, size of (struct), 1, fp);
e.g.,

UP Board Solutions

street address
{
char city [30]; /* 30 bytes */
long in pin; /* 2 bytes */
char country [20]; /* 20 bytes */
};
struct address add;
FILE *fp;
fwrite (& add, size of (add), 1, fp);

Question 6.
Describe the main features of printf and getchar function. (UP 2014)
Answer:
printf ( ) → This function writes formatted data to screen. This function allows to supply the input in a fixed format and to obtain the output in the specified form. The printf () function interprets the contents (UPBoardSolutions.com) of the format string.
Syntax:
Printf (“formatted string”, variables); if needed
Example 1.
Printf (“Average = % d percentage = % of’, avg. per);
Here the %d and %f are conversion characters.
They tell printf () to print the value of avg as an integer and per as afloat.

getchar ( ): Using this function any single ASCII character can be inputted in any char type of a variable. This function is available in stdio.h header file so it must be included in the program, in the beginning, using # include declarative.
For example,

UP Board Solutions

#include<stdio.h>
#include<conio.h>
void main ()
{
char x;
x = getchar();
cout << “you entered” << x;
}

File Operation Short Answer Type Questions (4 Marks)

Question 1.
What is stdin and what is stdout?
Answer:
In ‘C’ language, whatever values are given or displayed on a monitor, it can be file handling first stored in a buffer area. The two buffer areas used for this are:

  • stdin: It stands for keyboard buffer as it stores the information sent by the keyboard.
  • stdout: It stands for standard output buffer, le., monitor of the computer.

UP Board Solutions

Question 2.
Differentiate fprintf() and fscanf(). (UP 2016)
Answer:
fprintf( ): This function sends formatted output to a stream. It accepts a series of arguments, apply to each argument a format specifier contained in the format string * format. This function applies the first format specifier to the first argument, the second specifier to the second argument… till the end of the format.

fscanf(): This function is similar to scanf() function. It scans a series of input fields one character at a time. Store the formatted input at an address passed as an argument following * format. This function might stop scanning (UPBoardSolutions.com) a particular field before it reaches the normal end-of-field (while space) character, or it might terminate entirely.

Question 3.
What is reading files? (UP 2008)
Answer:
Reading from files: To read from a file, ‘C’ provides the following functions:
To read data from file, it should exist.
fscanf (): This function is used to read data from a file. It is very similar to scanf () function. It scans a series of input fields (one at a time).
Syntax:
fscanf () file * stream, “format specifiers”, “Variables”).

UP Board Solutions

Question 4.
What is the closing of the file?
Answer:
Closing Files: During a write to a file, the data written is not put on the disk immediately. It is stored in a buffer. When the buffer is full, all its contents are actually written to the disk. The process of emptying the buffer (UPBoardSolutions.com) by writing its contents to disk is called flushing the buffer. Losing the file flushes the buffer and releases the space taken by the FILE structure which is returned by fopen. For this fclose () function is used.
Syntax:
fclose (File * stream (s);

File Operation Very Short Answer Type Questions (2 Marks)

Question 1.
In which type of file, accessing a particular record is faster?
Answer:
Random data file.

UP Board Solutions

Question 2.
Which statement is used to close a file?
Answer:
fclose() statement.

Question 3.
When data is to be written on a file, in which mode it should be opened? (UP 2016)
Answer:
‘w’ mode (for writing).

Question 4.
Which statement is used to read the data from a file?
Answer:
fread() statement is used to read the data from a file.

Question 5.
What do you know about ffiush() statement?
Answer:
If the given stream has buffered output, fflush writes the output for (UPBoardSolutions.com) a stream to the associated file.

UP Board Solutions

Question 6.
Which is function prints error message corresponding to the last Library routine that produced the error?
Answer:
perror ().

Question 7.
Which file pointer position of seeking function seeks from the beginning?
Answer:
SEEK SET.

File Operation Objective Type Questions (1 Marks)

There are four alternative answers for each part of the questions. Select the correct one and write in your answer book:

Question 1.
The last location of a file is:
(a) EOF
(b) END
(c) LAST
(d) CLOSE.
Answer:
(a) EOF

Question 2.
Which function is used to close a file? (UP 2015)
(a) CLOSE
(b) END
(c) EOF
(d) None of these.
Answer:
(b) END

UP Board Solutions

Question 3.
Which function is used to read a line from file:
(a) gets ()
(b) fgets ()
(c) readline ()
(d) gets ().
Answer:
(b) fgets ()

Question 4.
Which function sets the file pointer associated with a stream to a new position:
(a) fseek ()
(b) perror
(c) rename
(d) rewind.
Answer:
(a) fseek ()

UP Board Solutions for Class 10 Computer Science

UP Board Solutions for Class 10 Computer Science Chapter 10 String Data Manipulation

UP Board Solutions for Class 10 Computer Science Chapter 10 String Data Manipulation

String Data Manipulation Long Answer Type Questions (8 Marks)

Question 1.
What do you know about string function? Explain three-string functions with suitable examples.
Or
What is a string? Explain two string functions of your choice. (UP 2007, 08, 11, 12, 13)
Answer:
String Functions. String functions are those functions which (UPBoardSolutions.com) handle string data. ‘C’ language uses a large set of useful string handling library functions. Three string functions are:

1. STRCPY( ): This function copies the contents of one string into another. The base addresses of the source and target strings should be supplied to this function.
Example:

UP Board Solutions

void main()
{
char src[ ] = “Rajeev”;
char tgt[20];
strcpy (tgt, src);
printf (“Source string = %s”, src);
printf (“Target string = %s”, tgt);
}
Output:
Source string = Rajeev
Target string = Rajeev

2. STRLWR(): This function converts upper case (A to Z) string to all lower case (a to z).
Example:

void main()
{
char STR[ ] = “RAJEEV”;
printf (“Upper case = %s”, STR);
strlwr(STR);
printf(“lower case = %s”, STR);
}
Output:
Upper case = RAJEEV
Lower case = rajeev

3. STRUPR( ): This function converts lower case (a to z) string to upper case (A to Z) string:
Example:

UP Board Solutions

void main()
{
char str[ ] = “rajeev”;
prinft (“lower case = %S”, str);
strupr (str);
printf (“upper case = %S”, str);
}

Output:
Lower case = rajeev
Upper case = RAJEEV

Question 2.
Explain GETS() and PUTS() function with example.
Answer:
GETS( ): In ‘C’ scanf( ) is not capable of receiving a multiword string, therefore, names such as “Rajeev Sharma” would be unacceptable. The function collects a string of characters terminated by a new line, the (UPBoardSolutions.com) standard input.
PUTS(): The function puts() can display only one string at a time. Puts copies the null-terminated string to the standard output. Also on display a string, unlike printf(), puts() places the cursor on the next line.
Example:

void main()
{
char name [20];
printf (“enter your name");
gets (name);
puts (“Good Morning !”);
puts (name);
}

Output:
Enter your name, Rajeev Sharma
Good Morning
Rajeev Sharma.

UP Board Solutions

Question 3.
What is concatenation? Explain with example.
Or
Explain the mechanism of Concatenation of a new word in a string. (UP 2017)
Answer:
Concatenation: Concatenation means joining of two different strings to form one string. In ‘C’, streat function is used to do concatenation.
STRCAT(): This function appends or concatenates the source string (UPBoardSolutions.com) at the end of the target string. For example, “Rajeev” and “Sharma” on concatenation would result in a string “Rajeev Sharma”. The length of the resulting string is strlen(dest) + strlen(src).
Example:

void main()
{
char src[ ] = “Rajeev”;
char tgt[ ] = “Sharma”;
strcat (tgt, src);
printf (“\n source string = % s”, src);
printf (“\n target string = % s”, tgt);
}

Output:
source string = Rajeev
target string = Sharma Rajeev.

Question 4.
WAP to check for palindrome.
Answer:
Program:

UP Board Solutions

#include<stdio.h>
#include<conio.h>
void main()
{
char str[20);
char temp[20];
puts (“Enter any word”);
gets (str);
strcpy (temp, str);
strrev (str);
if (strcmp (str, temp) == 0)
{
printf (“it is a palindrome”);
}
else
{
printf (“it is not a palindrome”);
}
}

Question 5.
WAP to change a string from lower case to upper case.
Answer:
Program:

#include<stdio.h>
#include<conio.h>
#include void main()
{
char str [20];
puts (“enter a string in lower case”);
gets (str);
strupr (str);
printf (“upper case = %S”, str);
}

String Data Manipulation Short Answer Type Questions (4 Marks)

UP Board Solutions

Question 1.
What is strlen in ‘C’ language? (UP 2011)
Answer:
STRLEN( ): This function calculates the length of a string. It returns (UPBoardSolutions.com) the number of characters in a string, not counting the terminating null character. Its syntax is illustrated in the following program:

void main()
{
char N[ ] = “This is a book”;
int len;
len = strlen(N);
printf (“The length of the string is %d”, len);
}

Question 2.
What are the strings? (UP 2008, 18)
Answer:
Strings: Like a group of integers can be stored in an integer array, similarly a group of characters can be stored in a character array. Strings are single-dimensional arrays of type char. In ‘C’, a string is terminated by null character or ‘\0’. String constants are written in double-quotes.
For Example: **char name [ ] = {‘I’, ‘N’, ‘D’, ‘T’, ‘A’ , ‘\0’};
Each character in the array occupies one byte of memory and the last character is always ‘\0’.’\0′ is called null character. Note that ‘\0’ and ‘0’ are not the same. ASCII value of ‘\0’ is 0, whereas the ASCII value of ‘O’ is 48. Many string functions such as string length, string compare, string copy, string concatenate etc. are most commonly used functions.

UP Board Solutions

Question 3.
What is the purpose of strcmp function?
Answer:
Strcmp function. This function compares two strings to find out whether they are the same or different. The string comparison starts with the first character in each string and continues with subsequent characters until the (UPBoardSolutions.com) corresponding characters differ or until the end of the strings is reached. If the two strings are identical, strcmp () returns a value zero. If they are not, it returns the numeric difference between the ASCII values of the non-matching characters.
Example:

void main ()
{
char str 1 [ ] = “Rajeev”;
char str 2 [ ] = “Sharma”;
int i, j, k;
i = strcmp(str l, “Rajeev”);
j = strcmp (str l, str 2);
k = strcmp (str l, “Rajeev Sharma”);
printf (“\n % d %d % d”, i, j, k);
}

Output:
0 – 1 – 32

String Data Manipulation Very Short Answer Type Questions (2 Marks)

Question 1.
Which function is used to find the length of a string?
Answer:
strlen() function.

Question 2.
What is the name of the function which is used to copy a string into another?
Answer:
strcpy () function.

Question 3.
In ‘C’ language a string is terminated with what?
Answer:
In ‘C’ language a string is terminated by (UPBoardSolutions.com) null character or ‘10’.

UP Board Solutions

Question 4.
What is the ASCII value of ‘10’ and ‘0’?
Answer:
ASCII value of ‘10’ is 0. ASCII value of ‘0’ is 48.

Question 5.
The process of appending one string at the end of smother string is known as ………..
Answer:
Concatenation.

Question 6.
Function to check the time of the day. (UP 2012)
Answer:
time ( ).

String Data Manipulation Objective Type Questions (1 Mark)

There are four alternative answers for each part of the questions. Select the correct one and write in your answer book:

Question 1.
A variable name must start with:
(a) An alphabet
(b) A number
(c) $ symbol
(d) # sign
Answer:
(a) An alphabet

Question 2.
% is used for:
(a) String data type
(b) Character data type
(c) Numeric data type
(d) Float data type.
Answer:
(a) String data type

UP Board Solutions

Question 3.
Which header file is used for sesmf () and print ()?
(a) stdio.h
(b) conio.h
(d) math.h
(d) Both (a) and (b).
Answer:
(b) conio.h

Question 4.
Which of the following is not a looping statement?
(a) for
(b) if
(c) while
(d) do-while.
Answer:
(b) if

UP Board Solutions for Class 10 Computer Science