Tuesday, 14 February 2017

Python Programming Unit-1

I. COMPUTER FUNDAMENTALS: CHARACTERISTICS OF COMPUTER 1. High speed: Computers have the ability to perform routine tasks at a greater speed than human beings. They can perform millions of calculations in seconds.
 2. Accuracy: The computer accepts large amount of data and performs specified calculations and produces accurate results. Some people comment that computers also make mistakes. But it is not. It is the mistake on the part of human beings. The mistake might have happened because of wrong input or wrong program given by the human beings.

 3. Storage: Computers can store large amount of information. Any item of data or any instruction stored in the memory can be retrieved by the computer at lightning speeds
.
 4. Automation: Computers are capable of executing the programs without the need of human intervention, the computer execute programs one by one automatically.

 5. Diligence: Computers can perform the same task repeatedly & with the same accuracy without getting tired. A computer will work with same tempo from beginning to end.

 6. Cost effectiveness: Computers reduce the amount of paper work and human effort, thereby reducing costs.


REGISTER: Register is used to quickly accept, store, and transfer data and instructions that are being used immediately by the CPU. There are various types of Registers those are used for various purposes. • AC Or Accumulator, • Data Register Or DR, • AR Or Address Register, • Program Counter (PC), • Memory Data Register (MDR) , • Index Register, • Memory Buffer Register.

 Accumulator: 
This register is used for storing results those are produced by the system. When CPU will generate some results after the processing then all the results will be stored in to AC Register.
Data Register: This register is used in micro computers to temporarily store data being transmitted to or from peripheral device.
Address Register: This register holds the memory address of data and instructions. This is used for access data and instructions from memory during execution phase of an instructions.
 Program Counter: It is commonly called the instruction pointer in inter X86 microprocessor. It keeps track of the next memory address of the instruction that is to be executed once the execution of current instruction is completed.
Memory Data Register: MDR is the register of a computer’s control unit that contains the data to be stored in computer storage (RAM).It acts like a buffer and holds anything that is copied from the memory ready for the processor to use it.
 Index Register: (Base Register) A hardware element which holds a number that can be added to the address portion of computer instruction to form an effective address.
Memory Buffer Register: This is register holds the contents of data and instructions read from memory or written in memory.
 II. PLANNING THE COMPUTER PROGRAM:

 PROBLEM SOLVING

Solving problems is the core of computer science. Programmers must first understand how a human solves a problem, then understand how to translate this "algorithm" into something a computer can do, and finally how to "write" the specific syntax (required by a computer) to get the job done. It is sometimes the case that a machine will solve a problem in a completely different way than a human. Computer Programmers are problem solvers. In order to solve a problem on a computer you must: 1. Know how to represent the information (data) describing the problem. 2. Determine the steps to transform the information from one representation into another.

 PROBLEM DEFINITION: Design a program that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who live in Texas
. Program design:
Program design is both a verb and a noun. It is the process that organizations use to develop a program. Ideally, the process is collaborat ive, iterative, and tentative—stakeholders work together to repeat, review, and refine a program until they believe it will consistently achieve its purpose. A program design is also the plan of action that results from that process. Ideally, the plan is developed to the point that others can implement the program in the same way and consistently achieve its purpose.

 DEBUGGING: In computers, debugging is the process of locating and fixing or bypassing bugs (errors) in computer program code .To debug a program or hardware device is to start with a problem, isolate the source of the problem, and then fix it. A user of a program that does not know how to fix the problem may learn enough about the problem to be able to avoid it until it is permanently fixed. Debugging is a necessary process in almost any new software or hardware development process, whether a commercial product or an enterprise or personal application program

TYPES OF ERROS: Types of program errors We distinguish between the following types of errors:
 1. Syntax errors: errors due to the fact that the syntax of the language is not respected.
 2. Semantic errors: errors due to an improper use of program statements
 3. Logical errors: errors due to the fact that the specification is not respected. From the point of view of when errors are detected, we distinguish:
 1. Compile time errors: syntax errors and static semantic errors indicated by the compiler
2. Runtime errors: dynamic semantic errors, and logical errors, that cannot be detected by the compiler (debugging).
 DOCUMENTATION: In computer hardware and software product development, documentation is the information that describes the product to its users. It consists of the product technical manuals and online information. The term is also sometimes used to mean the source information about the product contained in design documents, detailed code comments, white papers, and blackboard session notes.
 Comments: There are two types of comments statements. They are
 1. Single line comment
 2. Multi line comment
 Single line comment: In Python, we use the hash (#) symbol to start writing a comment. It extends up to the New line character. Ex: # this is single line comment
 Multiline comment: Another way of doing this is to use triple quotes, either ''' or """. These triple quotes are generally used for multi-line strings. Ex: ‘’’ this is multi line comments We are learning python…. Thank you….’’’

 III. TECHNIQUES OF PROBLEM SOLVING:

 ALGORITHM
 1. A sequential (step by step) solution of any program that written in human language, called algorithm.
2. Algorithm is first step of the solution process, after the analysis of problem, programmer writes the algorithm of that problem.
 Q. Write algorithm and flowchart to input temperature, if temperature is less than 32 then print "below freezing" otherwise print "above freezing"?

ALGORITHM: step 1 : start
step 2 : input number is temp



step 3 : if (temp<32)
                        {
                          Printf(“below freezing”);
                        Else
                          Printf(“above freezing”);
                        }
step 5 : stop

FLOW CHART

 Flow chart is a graphical or symbolic representation of a process. Each step in the process is represented by a different symbol and contains a short description of the process step. The flow chart symbols are linked together with arrows showing the process flow direction.
Common Flowchart Symbols
Different flow chart symbols have different meanings. The most common flow chart symbols are:
·         Terminator: An oval flow chart shape indicating the start or end of the process.
·         Process: A rectangular flow chart shape indicating a normal process flow step.
·         Decision: A diamond flow chart shape indication a branch in the process flow.
·         Connector: A small, labeled, circular flow chart shape used to indicate a jump in the process flow. (Shown as the circle with the letter “A”, below.)
·         Data: A parallelogram that indicates data input or output (I/O) for a process.




Decision tables are compact (beautifully) and precise (frankly) ways of modeling complicated logic, such as that which you might use in a computer program. They do this by mapping the different states of a program to an action that a program should perform. Decision tables take on the following format:
The four quadrants
Conditions stub
Condition entries
Actions stub
Action entries
The limited-entry decision table is the simplest to describe. The condition alternatives are simple Boolean values, and the action entries are check-marks, representing which of the actions in a given column are to be performed.
Example: Decision Tables
A  computer game example, for a football simulation the following rules are set up.
Rules
Conditions
90 minutes
Y
Y
Y
Team A Winning
Y
Team B Winning
Y
Y
Draw
Y
Actions
Game Over
X
X
Team A Wins
X
Team B Wins
X
Extra Time
X
Keep Playing
X
X
What happens when:
1.    90 minutes up
2.    the game is a draw
Answer: Keep Playing and give them some extra time





STRUCTURED PROGRAMMING CONCEPTS:


Procedural Programming Languages: These languages code programs in such a way that the program executes statement by statement, reading and modifying a shared memory.
Examples: Pascal, FORTRAN, COBOL
The structured programming concept was formalized in the year 1966 by Corrado Böhm and Giuseppe Jacopini.
Structured programming (sometimes known as modular programming) is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify.
Structured programming is not only limited to the top down approach. It employs methods using:-
1.   Top down analysis for problem solving: It focuses on dividing the problem into sub parts and hence simplifies the problem solving.
2.   Modularization for program structure and organization: It organizes large instructions by breaking them into separate and smaller section of modules, sub routines and subprograms.
3.   Structured code for the individual modules: Control structures are used to determine the exact order in which the set of instructions are to be executed. Therefore, a structured code does not involve GOTO statement as it represents no certain order of execution.
Example ALGOL, Pascal, Pl/I, C , Ada


42 comments:

  1. Replies
    1. Great post thanks. This is very informative. computer tutorial.
      try this one also. https://redcomputerscience.blogspot.com

      I learned a lot of useful and insightful information thanks.
      try this one also. https://redcomputerscience.blogspot.com

      Thank you very much for this post. computer tutorial.
      try this one also. https://redcomputerscience.blogspot.com

      Delete
  2. Thanks for this programming. You also talk about different decision table. I have read this program very carefully. Please click here to know about Computer Science Personal Statement information. I am waiting for next post.

    ReplyDelete
  3. Specially I wanna thanks to you because of the article you wrote its really too good. I read here lot of article but you are the boss who write a super article about Programming.

    ReplyDelete
  4. We wanna because of a person due to the post a person authored it's truly as well great. We study right here large amount of post however, you would be the employer that create an excellent post regarding Encoding.
    You may check it at http://www.writemywaiver.com/.

    ReplyDelete
  5. Wonderful blog post, Every one of the people inside the created countries by exploitation the data and furthermore the aptitudes they require and the best way in that during which http://www.medicalfellowship.net/rules-not-to-follow-in-preparing-your-facs-personal-statement/ site the assets which they require are frequently used in the best way that offers the best outcome

    ReplyDelete
  6. Replies
    1. Great post thanks. This is very informative. computer tutorial.
      try this one also. https://redcomputerscience.blogspot.com

      I learned a lot of useful and insightful information thanks.
      try this one also. https://redcomputerscience.blogspot.com

      Thank you very much for this post. computer tutorial.
      try this one also. https://redcomputerscience.blogspot.com

      Delete
  7. Computer science education is top level higher education system for science students. Here you have talking about python programming. This is wonderful explanation about the specific programming. Every computer science student should helpful by read this post. Also check our personal statement writing services at http://www.personalstatementwriters.com/low-gpa-not-a-problem-for-successful-admission-essay

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. This source of yours helped me to learn some computer basics and some fundamentals. I think you should look here to find more about computer.

    ReplyDelete
  13. It's not easy to manage to repeat whole meaning of the information without changing of an essay. I have faced lots of problem to make it plagiarism free when faculty gives a thesis paper. After seeing this, it feels me vivid to easy my work done. This website is full of data with this subject line to know more.

    ReplyDelete
  14. I have summarized a journal article that my faculty asked in last semester. Then I searched to get appropriate rules but that site didn't give proper rules and regulation. Then I found this and obtained highest marks. This is really lucky for me to get valid rules. more help you have to go to this site and accomplish your needs.

    ReplyDelete
  15. Thank you so much for sharing the link to i tunes, it is very helpful, I am glad one of the writing services http://www.appscomparator.com/ directed me here and made my life easier.

    ReplyDelete
  16. Wow, what a great blog for python programming unit 1. This is such an amazing blog and informative one too. It will be great if you share this on http://www.insidetheapp.com/1-tap-cleaner-app-review/ website as well.

    ReplyDelete
  17. A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  18. A Computer Science portal for geeks. It contains well written, well thought and well
    explained computer science and programming articles, quizzes and practice/competitive
    programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  19. A Computer Science portal for geeks. It contains well written, well thought and well
    explained computer science and programming articles, quizzes and practice/competitive
    programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  20. A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  21. A Computer Science portal for geeks. It contains well written, well thought and well
    explained computer science and programming articles, quizzes and practice/competitive
    programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  22. A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  23. A Computer Science portal for geeks. It contains well written, well thought and well
    explained computer science and programming articles, quizzes and practice/competitive
    programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  24. A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  25. A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  26. A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  27. A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  28. A Computer Science portal for geeks. It contains well written, well thought and well
    explained computer science and programming articles, quizzes and practice/competitive
    programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  29. A Computer Science portal for geeks. It contains well written, well thought and well
    explained computer science and programming articles, quizzes and practice/competitive
    programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  30. A Computer Science portal for geeks. It contains well written, well thought and well
    explained computer science and programming articles, quizzes and practice/competitive
    programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  31. A Computer Science portal for geeks. It contains well written, well thought and well
    explained computer science and programming articles, quizzes and practice/competitive
    programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  32. A Computer Science portal for geeks. It contains well written, well thought and well
    explained computer science and programming articles, quizzes and practice/competitive
    programming/company interview Questions.
    website: geeksforgeeks.org

    ReplyDelete
  33. Nice Post.Here is a blog for student....What we do after Computer Science Course.

    ReplyDelete
  34. Computer science is the study of processes that interact with data and that can be represented as data in the form of programs. It enables the use of algorithms to manipulate, store, and communicate digital information. A computer scientist studies the theory of computation and the design of software systems.
    UGC approved computer science journals
    Its fields can be divided into theoretical and practical disciplines. Computational complexity theory is highly abstract, while computer graphics emphasizes real-world applications. Programming language theory considers approaches to the description of computational processes, while software engineering involves the use of programming languages and complex systems. Human–computer interaction considers the challenges in making computers useful, usable, and accessible.

    ReplyDelete
  35. Great post thanks. This is very informative. computer tutorial.
    try this one also. https://redcomputerscience.blogspot.com

    I learned a lot of useful and insightful information thanks.
    try this one also. https://redcomputerscience.blogspot.com

    Thank you very much for this post. computer tutorial.
    try this one also. https://redcomputerscience.blogspot.com

    ReplyDelete
  36. Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines, such as algorithms, theory of computation, and information theory, to practical disciplines including the design and implementation of hardware and software List of best computer science journals.

    ReplyDelete
  37. We have recently blessed with a newborn baby in our family and got osite for best research paper writing service was worried about its health. While using the laptop I came across this website and glad to see their precise articles targeting the mothers. They deserve a big appreciation for this work.

    ReplyDelete
  38. Wow! I’m headed with the site https://www.copy-print.es/27720-2/ for exclusive qualities of acquiring the “Could-based solutions” because I was facing the same problem but didn’t get any relevant solution. But after reading this article I truly got my solution. So thanks a lot for presenting this informative article because it really means to me.

    ReplyDelete
  39. Thanks for sharing such a informatic blog If you are searching for best Python assignment help in Australia then Online Assignment Expert is the best choice for you. We provide top quality writing services at affordable rates. We have expert writers who provide you top rated services.
    Python assignment help

    ReplyDelete