Posts

Showing posts from June, 2020

Unit 5

Unit V Object Oriented Programming (08 Hrs) Programming Paradigms-monolithic, procedural, structured and object oriented, Features of Object oriented programming-classes, objects, methods and message passing, inheritance, polymorphism, containership, reusability, delegation, data abstraction and encapsulation. Classes and Objects: classes and objects, class method and self object, class variables and object variables, public and private members, class methods.

Unit 6

Unit VI File Handling and Dictionaries  Files: Introduction, File path, Types of files, Opening and Closing files, Reading and Writing files. Dictionary method. Dictionaries- creating, assessing, adding and updating values.

Unit 4

Unit IV Strings Strings and Operations- concatenation, appending, multiplication and slicing. Strings are immutable, strings formatting operator, built in string methods and functions. Slice operation, ord() and chr() functions, in and not in operators, comparing strings, Iterating strings, the string module

Unit 3

Unit III Functions and Modules  Need for functions, Function: definition, call, variable scope and lifetime, the return statement. Defining functions, Lambda or anonymous function, documentation string, good programming practices. Introduction to modules, Introduction to packages in Python, Introduction to standard library modules

Unit 2

Unit II  Decision Control Statements  Decision Control Statements: Decision control statements, Selection/conditional branching Statements: if, if-else, nested if, if-elif-else statements. Basic loop Structures/Iterative statements: while loop, for loop, selecting appropriate loop. Nested loops, The break, continue, pass, else statement used with loops. Other data types- Tuples, Lists and Dictionary.

Basics of Python Programming

Image
Features of Python Python provides number of features as follows, Easy to Learn and Use -  Python is easy to learn and use. It is user and developer - friendly programming language. Expressive Language -  Python language is understandable and readable. Interpreted Language -  Python is an interpreted language. Due to interpreter code is executed line by line at a time. Cross-platform Language - Python work with different platforms, we can say that Python is a platform independent / portable programming language. Free and Open Source -  Python language distribution is freely available it means that the source-code freely available for further development. Object-Oriented Language -  Python is object oriented language and all concept related to object orientated  supported by python. Large Standard Library -  IPython having large number of library and it provides rich functions and packages for application development in easy way. GUI Programming Suppor...

Lab Assignment (Programming and Problem Solving) SPPU BE First Year.

Assignment No: 1 To calculate salary of an employee given his basic pay (take as input from user). Calculate gross salary of employee. Let HRA be 10 % of basic pay and TA be 5% of basic pay. Let employee pay professional tax as 2% of total salary. Calculate net salary payable after deductions. Download Source Code Assignment No: 2 To accept an object mass in kilograms and velocity in meters per second and display its momentum. Momentum is calculated as e=mc2 where m is the mass of the object and c is its velocity. Download Source Code Assignment No: 3 To accept N numbers from user. Compute and display maximum in list, minimum in list, sum and average of numbers. Download Source Code Assignment No: 4 To accept student’s five courses marks and compute his/her result. Student is passing if he/she scores marks equal to and above 40 in each course. If student scores aggregate greater than 75%, then the grade is distinction. If aggregate is 60>= and <75 then the  grade if first div...

Examples of Flowchart and Pseudo Code

Image
Example 1 : Flow chart for finding the sum of and product of two numbers. Declare Integer a Declare Integer b Declare Integer sum Declare Integer product Display "Enter any two numbers :" Input a Input b Set sum = a + b Set product = a * b Display "Sum and Product of given two number is :" Display sum Display product Example 2 : Flow chart for convert temperature in farenheit to celcius. Declare Real farenheit Declare Real celcius Display "Enter the temperature value in farenheit :" Input farenheit Set celcius = 5 / 9 * (farenheit - 32) Display "Given temperature in celcius is :" Display celcius (Note : All flowcharts prepared using Flowgorithm (Download the flowgorithm from link :  http://www.flowgorithm.org/ )  Next Topic : Basics of Python Programming

Program Design Tools

Image
Introduction to Algorithm The term "algorithm" is used for describing the sequence of actions leading to the solution of the given problem. The field of mathematics known as the theory of algorithms is dedicated to the study of the properties, methods of recording, the creation of new algorithms and the application of different algorithms. Basic requirements to the algorithms used in computer science are the following: Discreteness: the algorithm should lead to the solution of the assigned problem,  introducing the solution of the problem as a sequence of actions. Finiteness: the number of steps of the algorithm must be finite. Efficiency: the algorithm must be such that a solution could be found in a finite and  reasonable time. Certainty (or precision): algorithm's steps have to allow unambiguous  interpretation. Each algorithm has to be devised for a certain performer. In order that the performer could solve the problem according to the gi...

Problem solving with computers.

Problem solving with computers. Results means the outcome or the completed computer-assisted answer. Program means the set of instructions that make up the solution after they have been coded into a particular computer language. Computers are built to deal with algorithmic solutions, which are often difficult or very time consuming for humans. People are better than computers at developing heuristic solutions. Solving a complicated calculus problem or alphabetizing 10,000 names is an easy task for the computer, but the problem of how to throw a ball or how to speak English is not. The difficulty lies in the programming. How can problems such as how to throw a ball or speak English be solved in a set of steps that the computer can understand? The field of computers that deals with heuristic types of problems is called artificial  intelligence.  Artificial intelligence enables a computer to do things like build its own knowledge bank and speak in a human language. ...

Problem Solving in Everyday Life

People make decisions every day to solve problems that affect their lives. The problems may be as unimportant as what to watch on television or as important as choosing a new profession. If a bad decision is made, time and resources are wasted, so it’s important that people know how to make decisions well. There are six steps to follow to ensure the best decision. These six steps in problem solving include the following. Identify the problem Understand the problem Identify the alternative ways to solve a problem Select the best way to solve a problem from the list of alternative solutions List instructions that enable you to solve the problem using the selected solution. Evaluate the solution. Explanation to each step: A. Identify the problem: This is the first step towards solving a given problem. One must properly comprehend what exactly the challenge is.    Example : Add two numbers and store the results in another number. B. Understa...