Get the free Programming Fundamentals PDF right now! It comes straight from the official NCERT Book for Class 11 Informatics Practices. Updated for the 2026-27 session, you can read or download this full book easily.
NCERT Book Class 11 Informatics Practices - Programming Fundamentals PDF
Study this fun chapter from CBSE Book Class 11 Informatics Practices Programming Fundamentals to learn new things in Class 11 Informatics Practices. Need help with answers? Check the NCERT Solutions for Class 11 Informatics Practices to solve every question at the end of the chapter.
NCERT Class 11 Informatics Practices Programming Fundamentals PDF
Programming Fundamentals
Variables
After observing the above form, it is clear that we are accepting the number of apples, bananas and oranges in three separate text fields and calculating the total number of fruits by simply adding the three values on the click of a button. The total number of fruits is then displayed in a separate text field.
Now imagine a situation where we have to calculate the total of 20 such fruits. Our one line of code will become very cumbersome and difficult to understand. To avoid such cumbersome code we need to use some containers, which can store the values entered by the user in the different text fields. These values need to be stored only till we add them up. So we need to modify the code given above. To test the same we first need to design the form and then associate code with the click of the button.
Let us first talk about the design of the form. Add a new JFrame form. Go to the Properties tab in the Palette Window and change the title property of the Form as shown in the Figure 5.3.
Now add the following components on the form: three editable text fields to accept the number of apples, bananas and oranges two buttons - one to calculate & display the total number of fruits and one to exit from the application one non-editable text field to display the total number of fruits appropriate labels to direct the user Change the properties of the components as learnt in the previous chapter so that the form looks exactly like the one displayed in Figure 5.1. The next step is to associate code with the button with display text "Number ofFruits".Double click on the button in the design window to reach the point in the source window where the code needs to be written. Rewrite the code given in Figure 5.2 using the concept of containers as shown in Figure 5.4.
How many containers did we use to solve the above problem? We used four containers. Three of them were used to store the number of individual fruits and the fourth one was used to store the total number of fruits. These four containers need to be identified using separate names. In the beginning of the program, the containers were empty but during the execution, we changed their initial values and allocated different values to them. Such containers are called variables. From the above exercise we infer that these containers/variables have four special characteristics:
1. They have a name.
2. They are capable of storing values.
3. They provide temporary storage.
4. They are capable of changing their values during program execution.
Thus, variables are named temporary storage areas capable of storing values, which can change during the execution of the program. Remember, variables are declared within the code that uses them. In the above code the values are entered by the user in the three textFields and then these values are assigned (stored) to the variables Apples, Bananas and Oranges after converting the values to type Integer using the ParseInt() method. The statement used to assign the values is:
Apples=Integer.ParseInt(jTextField1.getText());
In this case the value entered in jTextField1 is assigned to variable Apples. Similarly, values entered in jTextField2 is stored in the variables called Bananas and value entered in jTextField3 is stored in the variables called Oranges. The sum total is stored in the variable Fruits using the statement:
Fruits = Apples + Bananas + Oranges;
Again observe the code given in Figure 5.4 closely and try to find out one extra characteristic about the variables. Note that they all have been used to store numbers without decimals. What if we change the application above to find the total marks obtained by a student? In that case the variables will store numbers with decimals. Whatif we change the above application to accept the first name, middle name and last name of the user and want to display the full name in the fourth text field? In that case the variables will have to store groups of characters. What do we learn from this? We learn a new characteristic of these variables - each variable can store a specific type of data. The type of data that a variable is capable of storing guides us about how to handle that particular variable and also informs us about what can be done with these variables. So each variable has a specific data type, which determines the kind of value they can store, and also specifies what can be done with these variables. Each programming language has a set of data types that can be used according to the need of the programmer. Now that we are clear about the facts why we need variables and the use of data types, let us try and understand the different data types available in java. In the above example all four variables- Apples, Bananas, Oranges and Fruits are integer type variables as they are storing numbers without decimals. In the code given in Figure 5.4 can you point out the keyword, which identifies these variables as integer numbers?
Data Types
The keyword used to identify the variables as integers is int. These are variables without decimals. Similarly we have data types for handling other varieties of data. The different types of data that we enter need different type of handling. These different types of data can be manipulated through specific data types.
Please refer to the link below - CBSE Class 11 Informatics Practices Programming Fundamentals
Programming Fundamentals Digital Textbook & Resources for Class 11 Informatics Practices
Class 11 Informatics Practices Programming Fundamentals Official E-Book
Obtain the official NCERT Textbook for Class 11 Informatics Practices Programming Fundamentals, structured for active learning sessions. Subject teachers and academic experts consistently advise using the Programming Fundamentals e-textbook because all terminal tests for Class 11 follow its prescribed curriculum closely. Retrieve your complete chapter resource securely in PDF format from this page.
Digital E-Book Collection for Class 11 Informatics Practices
We have provided the complete collection of NCERT books in English Medium for all subjects in Class 11. These digital textbooks are very important for students who have English as their medium of studying. Each chapter, including Programming Fundamentals, contains detailed explanations and a detailed list of questions at the end of the chapter. Simply click the links above to get your free Informatics Practices textbook PDF and start studying today.
Maximize Conceptual Clarity with NCERT E-Books
Designed to deliver fundamental clarity, the Class 11 Informatics Practices Programming Fundamentals textbook is a vital academic asset. Elevate your study routine by reviewing our comprehensive NCERT Solutions and revision notes available online.
FAQs
You can download the latest, teacher-verified PDF for CBSE Book Class 11 Informatics Practices Programming Fundamentals for free on StudiesToday.com. These digital editions are updated as per 2026-27 session and are optimized for mobile reading.
Yes, our collection of Class 11 Informatics Practices NCERT books follow the 2026 rationalization guidelines. All deleted chapters have been removed and has latest content for you to study.
Downloading chapter-wise PDFs for Class 11 Informatics Practices allows for faster access, saves storage space, and makes it easier to focus in 2026 on specific topics during revision.
NCERT books are the main source for NCERT exams. By reading CBSE Book Class 11 Informatics Practices Programming Fundamentals line-by-line and practicing its questions, students build strong understanding to get full marks in Informatics Practices.