1 / 48

Coding Basics and Software Engineering Overview

Explore the world of coding, computer components, programming languages, and software. Learn about different types of coding languages, computer components, software categories, and programming language families. Understand the program development cycle, storage capacities, and the significance of variables in programming. Dive into machine, assembly, and high-level languages, their characteristics, and the compilation and interpretation processes. Enhance your knowledge of coding with practical examples and insights.

stevend
Download Presentation

Coding Basics and Software Engineering Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Coding Basics Software Engineering

  2. Basic Questions • What is coding? • What is it used for? • How does it impact DISH? • What types of coding exist?

  3. Goals • Understand the different types of coding languages. • Understand the basic procedures in a program as input, processing and output. • Understand the importance of variables. • Understand a basic map of the program development cycle.

  4. Computer Components • CPU Central Processing Unit • RAM (Random Access Memory) • Mass storage devices • Input devices • Output Devices

  5. Storage Capacities • bit – smallest capacity • byte = 8 bits • storage for one character • 1 kilobyte (KB) = 1024 bytes • 1 megabyte (MB) = 1024 KB • 1 gigabyte (GB) = 1024 MB • 1 terabyte (TB) = 1024 GB

  6. Software Software is comprised of instructions that get a computer to perform a task. • Application Software • Word Processors • Database s/w • Spreadsheets • Painting programs • Web browsers, email programs • System Software • Operating Systems • Windows • Macintosh OS • Unix • Linux • Android • iOS • Drivers

  7. Programming Languages • Coding languages allow developers to code software. • The three major families of languages are: • Machine languages • Assembly languages • High-Level languages

  8. Machine Languages • Comprised of 1s and 0s • The “native” language of a computer • Difficult to program – one misplaced 1 or 0 will cause the program to fail. • Example of code:1110100010101 111010101110 10111010110100 10100011110111

  9. Assembly Languages • Are a step towards easier programming. • Are comprised of a set of elemental commands which are tied to a specific processor. • Assembly language code needs to be translated to machine language before the computer processes it. • Example:ADD 1001010, 1011010

  10. High-Level Languages • Represent a giant leap towards easier programming. • The syntax of HL languages is similar to English. • Historically, we divide HL languages into two groups: • Procedural languages • Object-Oriented languages (OOP)

  11. Procedural Languages • Early high-level languages are typically procedural languages. Used today in specialized areas. • Procedural languages are characterized by sequential sets of linear commands. The focus of such languages is on structure. • Examples include C, COBOL, Fortran, Perl, HTML, SQL

  12. Object-Oriented Languages • Most object-oriented languages are high-level languages. • The focus of OOP languages is not on structure, but on modeling data. • Programmers code using “blueprints” of data models called classes. • Examples of OOP languages include C++, JavaScript, Visual Basic.NET and Java.

  13. Compiling • Regardless of the HL Language, all HL programs need to be translated to machine code so that a computer can process the program. • Some programs are translated using a compiler. • When programs are compiled, they are translated all at once. • Compiled programs typically execute more quickly than interpreted programs, but have a slower translation speed.

  14. Interpreting • Some programs are translated using an interpreter. • Such programs are translated line-by-line instead of all at once (like compiled programs). • Interpreted programs generally translate quicker than compiled programs, but have a slower execution speed.

  15. Variables • A variable is a storage location which is given a symbolic name and assigned a value. • Variables should be given descriptive names.

  16. Array • An array is a variable that is an arrangement of objects, usually in rows and columns. • An array is usually indexed.

  17. Coding Example • Simple programming problem: Convert a price from British pounds into Dollars. • Pseudocode Input the price of the item, PoundPrice, in pounds Compute the price of the item in dollars: Set DollarPrice = 1.28 * PoundPrice Write DollarPrice

  18. Coding Example • Translating to Basic: INPUT PoundPrice LET DollarPrice = 1.28 * PoundPrice PRINT DollarPrice END

  19. Input & Variables • Input operations get data into the programs • A user is prompted to enter data: Write “Enter the price in pounds” Input PoundPrice • Computer programs store data in named sections of memory called variables. In the example above, the variable is named PoundPrice. The value of a variable can, and often does, change throughout a program.

  20. Data Processing and Output Set DollarPrice = 1.28 * PoundPrice • The above statement is a processing statement. Take the value in the variable PoundPrice, multiply by 1.28, and set the variable DollarPrice to the result of the multiplication. Write DollarPrice • Output the value in DollarPrice to the monitor.

  21. Assignment Operations Set counter = counter + 1 • Assignment statements change the value in a variable Take the value of counter, add 1, and store the result back in the same variable.

  22. Arithmetic Operations

  23. Data Hierarchy • Parenthesis • Exponentiation • Multiplication/Division • Addition/Subtraction

  24. Hierarchy of Operations Example 3 * (6 + 2) / 12 – (7 – 5) ^ 2 * 3 ( ) first = 3 * 8 / 12 – 2 ^ 2 * 3 ^ next = 3 * 8 / 12 – 4 * 3 Mult/Div (L to R) = 24 / 12 – 4 * 3 Mult/Div (L to R) = 2 – 12 Add/Subtr = -10

  25. Data Output • Send information from the program to the screen, or printer, or disk file. Write DollarPrice • The computer displays the value of the variable DollarPrice to the screen and the cursor goes to the next line.

  26. Data Output Write “The price in Dollars is”, DollarPrice • The output looks like this: The price in Dollars is 128 • The text inside the “ ” is output to the user “as is,” and it is the value in the variable that is output.

  27. Coding as Problem Solving • Problem solving principles: • Completely understand the problem • Devise a plan to solve it • Carry out the plan • Review the results An example of programming as problem solving, Brewster’s Thousands follows … • Developing a Program: • Analyze the problem • Design the program • Code the program • Test the program

  28. 1) Analyze the Problem • Brewster’s Thousands • The problem: Brewster wants to invest money at a local bank. There are many options such as interest rates, terms of deposit, compounding frequencies. He needs a program to compute, for any given initial investment, the final maturity (value) of the deposit. • What are the inputs? (given data) • What are the outputs? (required data) • How will we calculate the required outputs from the given inputs?

  29. 2) Design the Program • Create an outline of the program • An algorithm – a step by step procedure that will provide the required results from the given inputs. • Algorithm Examples: Instructions on how to make a cake, use the bank’s ATM, etc.

  30. 3) Code the Program • Once the design is completed, write the program code. • Code is written in some programming language such as BASIC, Pascal, C++, Java, etc.To prepare, we write code in pseudo-code, developing the skills to be used when studying the specific languages.

  31. 4) Testing the program • Locate any errors (bugs) • Testing is done throughout the development cycle • Walkthrough, or codereview is performed to locate errors in the code. • Pretend you are the computer and execute your own code. • Ultimate test is to run the program to see if the outputs are correct for the given inputs.

  32. Modular Programming • Determine the major tasks that the program must accomplish. Each of these tasks will be a module. • Some modules will be complex themselves, and they will be broken into sub-modules, and those sub-modules may also be broken into even smaller modules. • This is called top-down design

  33. Mapping Modules

  34. Code Modules • A module is an independent, self-contained section of code that performs a single task. • The main module is the module that drives the application. It “controls” all other modules. Typically, the main module calls other modules in order to have them perform certain tasks.

  35. Program Control & Modules • When the main module calls another module, program control transfers to the called module. • Program control cedes back to the main module when the called module finishes.

  36. Example of Modularization Main module Display program title and brief description of program Call Input Data Module Call Perform Calculations module Call Output Results Module End Program Input Data module Prompt for Principal, PercentageRate, Term, Frequency Input Principal, PercentageRate, Term, Frequency End module Perform Calculations module Set Rate = PercentageRate / 100 Set FinalValue = Principal * (1 + Rate / Frequency) ^ (Frequency * Term) End module Output Results Module Write Principal, PercentageRate, Term, Frequency Write FinalValue End module

  37. Coding • Coding is done in a specific programming language. • Coding before finishing a solid algorithm is a lot like putting the cart before the horse and usually spells disaster. • Time well-spent in the design phase will head off problems in coding!

  38. Documentation • Internal Documentation • Comments explain to the reader the logic and decision processes of the programmer. Comments are ignored by an interpreter or compiler. • Types of comments include code comments, documentation comments & module comments. • External Documentation • External documentation includes a user’s guide and, typically, a more technical system administrator’s guide.

  39. Testing • Creating a testing document. • Two types of testing: • Testing for errors • Quality/Usability testing • Two phases of testing: • Alpha testing (Internal testing) • Beta testing (Testing at the customer site w/ live data)

  40. Types of Errors • Syntax – wrong grammar, i.e., breaking the rules of how to write the language • Forgetting punctuation, misspelling keyword • The program will not run at all with syntax errors • Logic - the program runs, but does not produce the expected results. • Using an incorrect formula, incorrect sequence of statements, etc.

  41. Structured Programming • A method for designing and coding programs in a systematic, organized manner. • It combines the principles of top-down design, modularity and the use of the three accepted control structures of sequence, repetition and selection.

  42. Control Structures • Sequence–in sequential order. • The simplest of control structures – start at the beginning and continue in sequential order. • Selection – selectively execute statements • Called a branch, it requires a condition to determine when to execute statements.

  43. Control Structures • Repetition – repeat statements more than once • Called a loop, it needs a stop condition, I.e, the program will continue to loop until some condition is met.

  44. Event-Driven Programming • In an event-driven program, the flow of control is based on the user’s clicking on menus and buttons, etc. These user actions are called events. • Event-driven programming still uses the basic principles of structured programming – program modules, control structures, good programming style, and program testing.

  45. Summary • What are the different types of coding languages? • What are the basic procedures in a program as input, processing and output? • What are the importance of variables? • What are the basics of the program development cycle?

  46. Questions?

  47. Online Introduction • Hour of Code • Coding introduction for all school age children • Varity of languages and difficulty https://hourofcode.com/us/learn • Select 9+ grade for choices today • Select ‘Code the News’

  48. Questions?

More Related