Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discovering Computers

Similar presentations


Presentation on theme: "Discovering Computers"— Presentation transcript:

1 Discovering Computers
CHAPTER 13 COMPUTER PROGRAMMING & SOFTWARE DEVELOPMENT

2 Chapter 13 Objectives Differentiate between machine , assembly languages, high-level languages Describe various ways to develop Web pages including HTML, scripting languages, XHTML, XML, WML, and Web page authoring software Identify and discuss the purpose of procedural programming languages Identify the uses of popular multimedia authoring programs Discuss the advantages and uses of visual programming languages List the 6 steps in the program development cycle Identify and discuss the characteristics of object-oriented programming languages Differentiate between structured design and object-oriented design Identify the uses of various nonprocedural languages and tools Explain the basic control structures used in designing solutions to programming problems

3 Dilbert Cartoon: Singularity

4 Computer Programs & Programming Languages
What is a computer program ? Set of instructions that directs computer to perform an array of tasks. Programming language: Provides the syntax, rules and coding needed to write the instructions in a computer program.

5 Computer Programs & Programming Languages
What are low-level languages and high-level languages? Low-level language High-level language Machine-dependent runs only on one type of computer Often machine-independent can run on many different types of computers Machine and assembly languages are low-level

6 Low-Level Languages: Machine
What is machine language? Only language computer directly recognizes Uses a series of binary digits (1s and 0s) with a combination of numbers and letters that represent binary digits

7 Low-Level Languages: Assembly
What is assembly language? Instructions made up of symbolic instruction codes, meaningful abbreviations and codes Source program contains code to be converted to machine language

8 High Level Languages Procedural Languages:
BASIC, BASICA, GWBASIC, QBASIC COBOL FORTRAN PASCAL Object Oriented Languages JAVA  Object Oriented C  Object Oriented SMALLTALK  Object Oriented Alice (game programming)  Object Oriented (based on Java) VISUAL BASIC .NET  Object Based

9 The Program Development Cycle: 6 Steps
What is the program development cycle? Steps programmers use to build computer programs Programming team—Group of programmers working on program The Program Development Cycle is Step 4 in the System Development Life Cycle (SDLC)

10 Step 1 — Analyze Requirements
What is involved in analyzing the requirements? Review requirements Meet with systems analyst and users Identify input, output, processing, and data components IPO chart IPO chart—Identifies program’s inputs, outputs, and processing steps

11 Step 2 — Design the Solution
What is involved in designing the solution? Object-oriented design Devise solution algorithm, step-by-step procedure to solve problem Two approaches Structured design, sometimes called top-down design Programmer begins with general design and moves toward detailed design

12 Step 2 — Design the Solution
What is a hierarchy chart? Shows program modules graphically & relationships Also called a Structure Chart or VTOC: Visual Table of Contents

13 Step 2 — Design the Solution
What is object-oriented design (OOD) ? Programmer packages data and methods (procedures) into a single unit, called an object Objects are grouped into classes A Class Diagram graphically represents the hierarchical relationships of classes  

14 Unified Modeling Language (UML)
Class Name Data Attributes Constructors & Methods

15 Rectangle class UML Rectangle --length: double --width: double +Rectangle ( ) // a constructor +Rectangle (length: double, width: double) + setLength(double length): void + getLength( ): double + setWidth(width:double): void + getWidth( ): double + findArea( ): double + findPerimeter ( ): double + findDiagonal ( ): double

16 Step 3 — Validate the Design
Check program design for accuracy Programmer checks logic for correctness and attempts to uncover logic errors What is involved in validating the design? Desk check programmers use test data to step through logic Logic error design flaw that causes inaccurate results Structured walkthrough programmer explains logic of algorithm while programming team steps through program logic Test data sample data that mimics real data that program will process p

17 Step 4 — Implement the Design
What is implementation? (Coding,testing,debugging) Writing the code that translates the design into a program Syntax—rules that specify how to write instructions Comments—program documentation Extreme Programming (XP)—coding and testing as soon as requirements are defined !!!

18 Step 5 — Test the Solution
What is involved in testing the solution? Ensure program runs correctly and is error free Debugging—locating and correcting syntax and logic errors, or bugs Test copy of program, called beta, sometimes used to find bugs Alpha & Beta testing: What is the difference ?

19 Step 6 — Document the Solution
What is involved in documenting the solution? Programmers should perform two activities: Review program code—remove dead code: program instructions that the program never executes (runs) Review documentation

20 In the Computer Age … Some kids may have Delete Key
used a computer or cell phone before writing with a pencil ! Delete Key Cursor Computer Nerd

21 What is an Algorithm ? Algorithm: a step-by-step procedure to solve a problem. The problem to be solved does NOT have to pertain to a computer program. A procedure to change a flat tire on a car is an algorithm. (Set the parking brake first, loosen lug bolts…) So is assembling a bicycle or making a cake. Another example: Building a house.

22 Structured Walkthrough
What is a structured walkthrough? A more formal technique for checking the solution algorithm The programmer explains the logic of the algorithm while members of the programming team step through the program logic Purpose is to identify errors in the program logic and check for possible improvements in program design Detecting errors and making improvements early reduces the overall time and cost of program development

23 Coding Computer Programs
What is involved in coding programs? Two steps: 1. Translating the solution algorithm into a programming language 2. Entering the programming language code into the computer Each of the many programming languages has a very specific syntax Syntax The set of grammar and rules that specifies how to write instructions for a solution algorithm Next p.15.13

24 Examples of Syntax Differences
In the COBOL language: COMPUTE REG-PAY = HOURS * WAGE. regPay = hours * wage; // In the “C” Language /* A series of comments */ REM COMPUTE PAY in the BASIC language GROSSPAY = HOURS * WAGE a REM statement is a REMark; It is not executed.

25 COBOL is NOT dead (yet) ! COBOL  COmmon Business Oriented Language Factoid: According to the Micro Focus company, COBOL programs today process 75% of the world’s business data and around 90% of all financial transactions. Object COBOL for UNIX:

26 Documenting Computer Programs
How are programs documented? A programmer should take time to document the program code thoroughly Comments or remarks are included in a program as documentation Global comments explain the program’s purpose and identify the program name, its author, and the date written Internal comments explain the purpose of the code statements within the program global comments internal comments

27 Payroll Program Calculations (Example)
Read hours; float regularRate = 20.00; float overtimePayRate=30.00; float fedTaxRate = .28; float stTaxRate = .0575; float ovRate = 1.5; if (hours > 80 ) // Biweekly payroll: compute overtime pay regularPay = 80 * regularRate; // Compute regular pay for 80 hours overtimePay = (hours – 80) * ovRate * overtimePayRate; else // This means: hours <= 80 regularPay = hours * regularRate; // Compute regular pay (<= 80 hours) overtimePay = 0; grossPay = regularPay + overtimePay; fedTax = grossPay * fedTaxRate; stateTax = grossPay * stTaxRate; deductions = fedTax + stateTax; netPay = grossPay – deductions; print Name, SSN, regularPay, overtimePay, grossPay, netPay,deductions

28 Assembly Language Instructions
In a High-Level Language statement: In COBOL: MOVE ZEROS TO OVERTIME-PAY. overtimePay = 0; // Set overtimePay to zero in C++ Equivalent Assembly Language statements: LR R1, // Load Register R1 with zero SR R1, overtimePay // Store zero from R1 into // memory variable overtimePay

29 Testing: Removing Syntax & Logic Errors
What is involved in testing programs? Goal is to ensure the program runs correctly and is error free. 3 types of errors: Syntax errors Logic errors Runtime errors Logic errors (Semantic errors) Flaw in the design that generates inaccurate results Systems analyst develops test data including both valid and invalid input data Syntax errors Occur when the code violates the syntax, or grammar, of the programming language Usually discovered the first time a program code is executed on the computer

30 Examples of Logic (Semantic) Errors
F = (9./5.) * C + 32; // Compute Fahrenheit temp Suppose C = 40; // Celsius temperature is 40 Fahrenheit = ; Fahrenheit = 104; // So 40 deg C is F C = (2./9.) * (F – 32); // Logic error in formula ! It runs, but it produces the wrong number for Celsius temp It should be: C = (5./9.) * ( F -32);

31 Testing Programs and Run time Errors
What is a run time error? A program failure occurring while a program is being executed (run). Programmers use test data (good, bad, none) to deliberately cause a run time error in order to test the program. Examples of run time errors: Input file not found Division by zero Array Index out of bounds Buffer overflow General Protection Fault (GPF) (Memory overrun)

32 Dividing a Number by Zero
(Divisor approaches zero  0 ) (Then, invert and multiply) Example: x = a / 1/b = ab G = x 10 ** 320 (G is a very large number) If it is too large, it will overflow its data register. Infinity symbol 

33 Debugging Computer Programs
What is debugging? The process of locating and correcting the syntax and logic errors in a program Errors themselves are the bugs The first bug was said to be a moth lodged in a computer's electronic relay components during the development of the COBOL language (1959)

34 Dr. Grace Hopper: COBOL Inventor

35 Debug Utilities What is a debug utility (debugger)?
Computer software: called a debugger Available with most compilers Allows you to identify syntax errors and to find logic errors Programmer can examine program values while the program runs in slow motion Millennium Bug Also called the Y2K bug Took effect when the computer date rolled over to January 1, 2000 Non Y2K compliant computers read the date as 01/01/00 Next p.15.14

36 Y2K Computation (Example of error)
currentYear = 00; // Using a 2-digit value for year yearOfBirth = 1990; Age = currentYear – yearOfBirth; Age = 0 – 1990 Age = // Ridiculous value for Age ! currentYear = 2012; // Correct 4-digit year Age = 2012 – 1990 Age = // Correct age

37 Speaking of Dates… The Mayan calendar predicts that the world will end on December 21, 2012 ! Apolcalypse ! So why are we working so hard ?

38 Year 2038 Unix Y2K Bug http://en.wikipedia.org/wiki/Year_2038_problem
The year 2038 problem (also known as the Unix Millennium Bug, Y2K38, Y2.038K, or S2G by analogy to the Y2K problem) may cause some computer software to fail at some point near the year 2038. The problem affects all software and systems that both store system time as a signed 32-bit integer, and interpret this number as the number of seconds since 00:00:00 UTC on Thursday, 1 January 1970. Times beyond this moment will "wrap around" and be stored internally as a negative number, which these systems will interpret as a date in 1901 rather than 2038.

39 Y2K Problem Examples Visit: http://en.wikipedia.org/wiki/Y2K
In the C programming language, the standard library function to get the current year originally did have the problem that it returned only the year number within the 20th century, and for compatibility's sake still returns the year as year minus 1900. Many programmers in C, and in Perl and Java, two programming languages widely used in Web development that use the C functions, incorrectly treated this value as the last two digits of the year. On the Web this was a mostly harmless bug, but it did cause many dynamically generated webpages to display January 1, 2000, as "1/1/19100", "1/1/100", or variations of that depending on the format.

40 Division Computation (Example of error)
int num1 = 167; int num2 = 0; int result; if (num2 != 0) result = num1 / num2; else // Divide num1 by num2 num2 = 1; print (“Error:Attempt to Divide by zero”); // Causes program to crash // Cannot divide by zero

41 Designing Computer Programs
What is top-down design? Breaks down the original set of program specifications into smaller, more manageable sections These sections are called modules Identify the the major functions of a program, called the main module Decompose (break down) the main routine into smaller sections called subroutines Analyze each subroutine to determine if it can be decomposed further Continue decomposing subroutines until each one performs a single function A section of a program that performs a single function is a module

42 Structured Computer Program Design
What is structured design? Sequence control structure A technique that builds all program logic from a combination of three basic control structures Sequence,Selection,Looping A control structure is a design that determines the logical order of program instructions Each module typically contains more than one control structure Selection control structure Repetition control structure Next p.15.6

43 Sequence Control Structure
What is a sequence control structure? Shows one or more actions following each other in order. Actions: Inputs Processes Outputs Next p.15.7 Fig. 15-5

44 Selection Control Structure (IF-THEN-ELSE)
What is a Selection Control Structure? Tells the program which action to take, based on a certain condition Two common types of selection control structures if-then-else control structure case control structure Next p.15.7

45 Selection Control Structure (IF-THEN-ELSE)
What is an IF-THEN-ELSE control structure? Allows a program to evaluate the condition and yields one of two possibilities: true or false If the result of the condition is true, the program performs one action If the result is false, the program performs a different (or possibly no) action Next p.15.7 Fig. 15-6

46 Selection Control Structure (IF-THEN-ELSE)
A = // Assign 12 to integer variable A B = // Assign 65 to integer variable B IF ( A > B ) // The true condition, if A greater than B PRINT “The Internet is a great source of info!” PRINT “Have a nice day !” ELSE // The false condition: means A <= B PRINT “This is the false condition” PRINT “Please study for the final exam !”

47 Infinite Loops boolean loopSwitch = true; // 1 bit is set
int count = 5; while (loopSwitch) // Loop if loopSwitch is true { System.out.println(“Count is: “ + count); count = count – 1; // Subtract 1 from counter if (count = = 0) // When count reaches 0, stop loop loopSwitch = false; // Causes loop to end }

48 NESTED IF STRUCTURE (pseudocode)
IF (SCORE >= 90) // Nested IF “ladder” GRADE = ‘A’; // Assign letter grade of ‘A’ ELSE IF (SCORE >= 80) GRADE = ‘B’; IF (SCORE >= 70) GRADE = ‘C’; IF(SCORE >= 60) GRADE = ‘D’; ELSE // Note: SCORE is <= 59 GRADE = ‘F’;

49 CASE ENTRY STRUCTURE(pseudocode)
INPUT SCORE SCORE = (int) SCORE / 10; // Make score between ( 0 <= SCORE <= 10) SWITCH (SCORE) // Case Entry is more efficient than a Nested-IF ladder BEGIN SWITCH BEGIN CASE CASE 10: GRADE = ‘A’; BREAK; CASE 9: GRADE = ‘A’; CASE 8: GRADE = ‘B’; CASE 7: GRADE = ‘C’; CASE 6: GRADE = ‘D’; DEFAULT: GRADE = ‘F’; END CASE END SWITCH PRINT GRADE // Next statement after the END SWITCH

50 The CASE Control Structure
What is a case control structure? A condition can yield one of four or more possibilities; the last condition is usually the default or error condition. CASE runs faster than a nested IF Next p.15.7 Fig. 15-7

51 Repetition Control Structure (Looping)
What is a repetition control structure? Also called the iteration control structure or a loop Used when a program performs one or more actions repeatedly as long as a certain condition is met Two forms:  Do While control structure Do Until control structure Next p.15.8

52 Do While Control Structure (Looping)
What is a Do While control structure? Repeats one or more times as long as a condition is true Tests a condition at the beginning of the loop If the result is true, the program executes the action(s) inside the loop Program loops back and tests the condition again Looping continues until the condition becomes false Next p.15.8 Fig. 15-8

53 DO WHILE LOOP: EXAMPLE 3000-READ-A-RECORD // Read a record from input file FLAG = // Set loop control flag to zero DO WHILE (FLAG = = 0) // Loop as long as FLAG is zero 2000-COMPUTE-PAY 2500-PRINT-PAY-RECORD 3000-READ-A-RECORD // Read next record in file IF END-OF-FILE // If End-Of-File (EOF) is detected FLAG = 1 ELSE NULL ENDIF END DO WHILE

54 DO WHILE LOOPS Given the following pseudocode, what are the values of COUNTER and SUM when they are printed by the PRINT statement? Use the Gauss formula: Sum = N*(N+1)/2 COUNTER = 0 SUM = 0 DO WHILE (COUNTER < 11) COUNTER = COUNTER + 1 SUM = SUM + COUNTER END DO PRINT COUNTER, SUM COUNTER = ____ SUM = ______

55 Do Until Control Structure (Looping)
What is a Do Until control structure? Tests the condition at the the end of the loop The action(s) will always execute at least once Continues looping until the condition is true, and then stops Next p.15.8 Fig. 15-9

56 DO UNTIL LOOP FLAG = 0 3000-READ-A-RECORD // Read first record from input file DO // Start of DO UNTIL loop 2000-COMPUTE-PAY // Invoke COMPUTE-PAY module 2500-PRINT-PAY-RECORD 3000-READ-A-RECORD // Read next record from file IF END-OF-FILE FLAG = 1 ELSE NULL ENDIF UNTIL (FLAG = = 1) // If FLAG is 1, exit the DO-UNTIL Loop END DO // End of DO UNTIL loop

57 COUNT CONTROLLED LOOPS
SUM = // SUM is an Accumulator FOR I = 1 TO 10 SUM = SUM + I // … + 10 NEXT I SUM = // Without a loop, the statements would have to be written I = // many times, making the program very long… SUM = SUM + I // SUM = 0 + 1 I = 2 SUM = SUM + I // = 3 (SUM) // Handy formula for this series: SUM = N (N + 1) /2 SUM = 10 ( ) /2 = 10 (11)/2 = 5 * 11 = 55 PRINT SUM // 55 is the printed SUM

58 Program Design Guidelines
What are the guidelines of a proper program? Dead code Any code, or program instruction, that a program never executes The program, each of its modules, and each of its control structures must have: No dead code No infinite loops Single entry point; Single exit point Infinite loop A set of instructions that repeats continuously Entry point The location where a program, a module, or a control structure begins Next Exit point The location where it ends p.15.8

59 Program Design Guidelines
How are entry and exit points are shown? Program modules often have control structures nested inside one another Each control structure should have one entry point and one exit point Next p.15.9 Fig

60 Solution Algorithms for Computer Programs
What is a solution algorithm? (3 common tools) Also called program logic. A graphical or written description of the step-by-step procedures in a module. To help develop a solution algorithm, programmers use design tools. Program flowchart Nassi-Schneiderman charts Pseudocode Next p.15.9

61 Flowcharting Computer Programs
What is a Program Flowchart? Graphically shows the logic in a solution algorithm Follows a set of standards published by the American National Standards Institute (ANSI) in the early 1960s Next p.15.9 Fig

62 Flowcharting Computer Programs
How is a program flowchart drawn? Most symbols connect with solid lines showing the direction of the program Dotted lines connect comment symbols A comment symbol or annotation symbol Explains or clarifies logic Next p Fig

63 Flowcharting Computer Programs: Software
What is flowcharting software? (Visio, SmartDraw) Used to develop flowcharts Makes it easy to modify and update flowcharts Next p Fig

64 Nassi-Schneiderman (N-S) Charts
What is a Nassi-Schneiderman (N-S) chart? Graphically shows the logic in a solution algorithm Sometimes called structured flowcharts: Process, Do-While loop, IF, Case Next p Fig

65 Pseudocode for Computer Program Design
What is pseudocode? Uses a condensed form of English to convey the logic of a computer program Also uses indentation to identify the three basic control structures Often called “A combination of English and your favorite programming language” Next p Fig

66 Procedural Languages (3GL)
What is a procedural language? (3GL) Programmer assigns name to sequence of instructions that tells computer what to accomplish and how to do it Uses a series of English-like words to write instructions Often called third-generation language (3GL) Examples: BASIC, COBOL, and C p Next

67 Procedural Languages: Compilers
What is a compiler? Program that converts entire source program into machine language (0’s, 1’s) before executing it p Fig. 13-4 Next

68 Procedural Languages: Interpreters
What is an interpreter? Program that translates and executes one program code statement at a time Does not produce an EXE object program (binary code) file which is executable p Fig. 13-5 Next

69 Procedural Languages: BASICA, QBASIC
What is BASIC? (BASICA, GWBASIC, QBASIC) Designed for use as simple, interactive problem-solving language Beginner’s All-purpose Symbolic Instruction Code p Fig. 13-6 Next

70 Procedural Languages: COBOL
What is COBOL? (Developed in 1959) Designed for business applications English-like statements make code easy to read, write, and maintain COmmon Business-Oriented Language p Fig. 13-7 Next

71 Procedural Languages: C
What is C? (Developed in early 1970’s by AT&T) Powerful language originally designed to write system software. Executes extremely fast as does C++ Requires professional programming skills p Fig. 13-8 Next

72 Object-Oriented Programming Languages
What is an object-oriented programming (OOP) language? Used to implement object-oriented design Major benefit is ability to reuse existing objects Event-driven—checks for and responds to set of events C++ and Java are complete object-oriented languages Object is item that contains data and procedures that act on data Event is action to which program responds p Next

73 Object-Oriented Programming Languages
What is C++? Includes all elements of C, plus additional features for working with object-oriented concepts Used to develop database and Web applications Java: based on C++ p Fig. 13-9 Next

74 C++ Programming Language
/ Demonstrates the declaration of a class and the // definition of class methods C++ Program: CAR.CPP #include <iostream.h> // For cout function #include <stdio.h> // For the gets() function #include <conio.h> #include <ctype.h> class Car // Declare the class { public: // Begin public section void Start(); // Accessor function void Accelerate(); // Accessor function void Brake(); // Accessor function void HonkHorn(); // Accessor function void SetYear (int year); // Accessor function int GetYear(); // Accessor function void SetCylinders (int cyl); // Accessor function int GetCylinders(); // Accessor function void SetSpeed (float speed); // Accessor function float GetSpeed(); // Accessor function private: // Begin private section int Year; // Member variable int Cylinders; // Member variable int Speed; // Member variable }; // End of class car

75 Object-Oriented Programming Languages
What is Java? (1995) Developed by Sun Microsystems. Java programs are compiled into Bytecode. Similar to C++ but uses just-in-time (JIT) compiler to convert source code into machine code. p Fig Next

76 Java GUI Calculator

77 Java Anagram Program / Exercise8_12Healy.java Patrick Healy ITP120 Java I Chapter 8 import javax.swing.JOptionPane; // Exercise 8.12 // Try: lemon, melon listen, silent, please, asleep garden, ranged // lingo, login ladies, ideals RESORT, ROSTER public class Exercise8_12Healy { public static void main (String[] args) { while (true) // Infinite while loop { String output = "Angrams are words that have the same letters,\nbut are spelled differently\n Example: ROSTER & RESORT"; JOptionPane.showMessageDialog(null, output); String wordQuit = JOptionPane.showInputDialog("Press [Enter] to continue; Type Exit to Exit"); if (wordQuit.equals("exit") || wordQuit.equals("Exit")) break; String word1 = JOptionPane.showInputDialog("Anagrams: Enter word 1: "); String word2 = JOptionPane.showInputDialog("Anagrams: Enter word 2: "); outputAnagram (word1, word2); // Determine if words are anagrams } // End of infinite while loop } // End of main method

78 Java Anagram Program public static void outputAnagram( String w1, String w2) { String word1 = w1.toUpperCase(); String word2 = w2.toUpperCase(); String output = "The words " + word1 + " and " + word2 + " are" + (isAnagram(word1, word2) ? "" : " NOT") + " anagrams."; JOptionPane.showMessageDialog(null, output, "Exercise 8_12 Output", JOptionPane.INFORMATION_MESSAGE); } public static boolean isAnagram (String w1, String w2) { char[] chars1 = w1.toCharArray(); // Convert to arrays char[] chars2 = w2.toCharArray(); java.util.Arrays.sort(chars1); // Sort the arrays java.util.Arrays.sort(chars2); String s1 = String.valueOf(chars1); // Convert to strings String s2 = String.valueOf(chars2); Boolean result = s1.equals(s2); return result; } // End of method } // End of class Exercise8_12Healy

79 Java Sudoku Puzzle

80 Java Game Links Text Twist Game (in Java): Java Sudoku Puzzle (runs as an applet on a Web page)

81 Java Applets Example <html> <head> <title> House Class Applet Demo </title> </head> <body> <applet code = "HouseApplet.class" width = 600 height = 500 > </applet> </body> </html>

82 Java Applets Minimum of three (3) files are needed:
HouseApplet.java (Java source code) HouseApplet.class (bytecode file) HouseApplet.html (HTML file which refers to HouseApplet.class)

83 Unified Modeling Language (UML)
Class Name: Rectangle  length: double // Data Attributes  width: double + Rectangle ( ) // Default Constructor + Rectangle (double l, double w ) // Constructor w/params + setLength( double l): void // Methods + getLength( ): double + setWidth( double w): void + getWidth( ): double + findArea ( ): double + findDiagonal ( ): double + findPerimeter ( ): double

84 Object Oriented Design
public class RectangleR // Goes with driver program TestRect1.java { private double width; private double height; private static String color; public RectangleR( ) // Default constructor { height = 1.0; width = 1.0; } public RectangleR(double w, double h, String c) width = w; height = h; color = c; }

85 Object Oriented Design
public double getWidth() { return width; } public void setWidth(double w) { this.width = w; } public double getHeight() { return height; } public void setHeight(double h) { this.height = h; } public String getColor() { return color; } public void setColor(String c) { this.color = c; } public double findDiag { return Math.sqrt(height*height + width * width); } public double findArea() { return height*width; } } // End class RectangleR

86 Object Oriented Design
// Test Class (Driver Program) for the class RectangleR TestRect1.java public class TestRect1 { public static void main(String [] args) { RectangleR myRectangle1 = new RectangleR (3.0, 5.0, "Red"); RectangleR myRectangle2 = new RectangleR (6.0, 10.0, "Yellow");

87 Object Oriented Design
System.out.println ("The width of Rectangle 1 is " + myRectangle1.getWidth()); System.out.println ("The heigth of Rectangle 1 is " + myRectangle1.getHeight()); System.out.println ("The color of Rectangle 1 is " + myRectangle1.getColor()); System.out.println ("The area of Rectangle 1 is " + myRectangle1.findArea()); System.out.println(“The diagonal length is: “ + myRectangle1.findDiag() ); System.out.println ("The width of Rectangle 2 is " + myRectangle2.getWidth()); System.out.println ("The heigth of Rectangle 2 is " + myRectangle2.getHeight()); System.out.println ("The color of Rectangle 2 is " + myRectangle2.getColor()); System.out.println ("The area of Rectangle 2 is " + myRectangle2.findArea()); } // End of main method } // End of class TestRect1

88 Example of Java program: OOP
Defining the circle class: public class Circle { double radius = 1.0d; // Default radius of circle is 1 unit double findArea( ) return Math.PI * radius * radius; } double findPerimeter( ) // Computes circumference of circle return 2 * Math.PI * radius; } // End of class Circle

89 Example of a Java program: OOP
public class TestCircle // A test class program to test Circle class { public static void main(String[ ] args) Circle circle1 = new Circle(5); // circle1 has radius 5 Circle circle2 = new Circle(12); // circle2 has radius 12 Circle circle3 = new Circle(45); // circle3 has radius 45 // Print the radii of the various circles System.out.println(“The radius of circle1 is “ + circle1.radius ); System.out.println(“The radius of circle2 is “ + circle2.radius ); System.out.println(“The radius of circle3 is “ + circle3.radius ); } // End of main method } // End of class TestCircle

90 Nonprocedural Languages: 4GLs: SQL
What is a fourth-generation language (4GL)? A Nonprocedural language that allows users to access data in a database A popular 4GL is SQL, query language that allows users to manage data in a relational DBMS p Fig Next

91 Object-Oriented Programming Languages
What is a Visual Programming Language? (a 5GL) Provides visual or graphical interface for creating source code Visual programming environment (VPE) allows developers to drag and drop objects to build programs Sometimes called Fifth generation language Examples: Visual Basic .NET Visual C++ Visual J# Programmer writes and implements program in segments Often used in a RAD (rapid application development) environment p Next

92 Object-Oriented Programming Languages
What is Visual Studio 2010? Suite of visual programming languages and RAD tools .NET is set of technologies that allows program to run on Internet Visual Basic is used to build complex object-based programs Step 1. The programmer designs the user interface. Step 2. The programmer assigns properties to each object on the form. Step 3. The programmer writes code to define the action of each command button. Step 4. The programmer tests the application. p Next

93 Object-Oriented Programming Languages and Program Development Tools
The Microsoft .NET Framework allows almost any type of program to run on the Internet or an internal business network, as well as computers and mobile devices Features include: CLR (Common Language Runtime) Classes Discovering Computers 2012: Chapter 13 Page 670

94 Object-Based Programming Languages
Visual Basic 2010 (sometimes called VB .NET) is a visual programming languages that easily allows programmers to develop complex task-oriented object-based programs. VB 2010 is based on the Visual Basic programming language developed by Microsoft in the early 1990’s. VB is a good language for beginning programmers although it is really not that easy!

95 Object-Oriented Programming Languages
Also, in the Visual Studio .NET suite are the Visual C and Visual C# 2010 (pronounced Visual C sharp) programming languages. Very powerful ! Programmers can develop software for nearly every computer platform ! Visual C# 2010 is a visual programming language built on the .NET platform that takes the complexity out of C++ for easier, rapid software development

96 Object-Oriented Programming Languages
Visual C# 2010 (C# means “C – sharp”) is a visual programming language that combines the features of C++ with an easier development environment. This language is supposed to take the complexity out of Visual C an still provide an object-oriented language.

97 More on C# (C-Sharp) C# (pronounced "see sharp" or "C Sharp") is one of many .NET programming languages. It is object-oriented and allows you to build reusable components for a wide variety of application types.  Microsoft introduced C# on June 26th, 2000 and it became a v1.0 product on Feb 13th 2002. C# is an evolution of the C and C++ family of languages. However, it borrows features from other programming languages, such as Delphi and Java. If you look at the most basic syntax of both C# and Java, the code looks very similar, but then again, the code looks a lot like C++ too, which is intentional. C# tutorials:

98 Object-Oriented Programming Languages
Delphi (from Borland Software) Powerful visual programming tool Ideal for large-scale enterprise and Web applications p Fig Next

99 Object-Oriented Programming Languages
Delphi Delphi can be used to develop programs quickly for Windows, Linux, and .NET platforms in a RAD environment Delphi has more functionality and features than Visual Basic .NET but is more difficult to learn and use. p Fig Next

100 Object-Oriented Programming Languages
What is PowerBuilder? (from Sybase Corp.) Another powerful visual programming tool Best suited for Web-based and large-scale object-oriented applications A widely used RAD programming tool p Fig Next

101 Web Page Development HTML
What is HTML (Hypertext Markup Language)? A special language used to create Web pages p Fig Next

102 Web Page Development HTML
You usually view a Web page written with HTML in a Web browser such as Microsoft Internet Explorer or FireFox or Safari (Apple) or Chrome (Google), Opera HTML is a language used for the placement of text, graphics, video, and audio on a Web page. HTML is really NOT a programming language. p Fig Next

103 Web Page Development HTML
A Web page is a file that contains both text and HTML tags. Examples of tags: <html> <head> <title> ITE100 Web Page example </title> </head> <body> ( Most of the HTML code goes here ) </body> </html>

104 Web Page Development HTML Example
<HEAD> <TITLE> ITE 100 Sample Web Page</TITLE> </HEAD> <BODY> <CENTER> <IMG SRC = “bigwood.gif” HEIGHT = 75 WIDTH = 170> </CENTER> <P><ADDRESS> Nova Community College <BR> Neabsco Mills Road </BR> <BR> Woodbridge, Virginia 22191</BR> </ADDRESS> </BODY> </HTML> p Fig Next

105 HTML 5 Drag & Drop feature
W3 Schools Link

106 A Basic Web Page http://www.nvcc.edu/home/phealy/ElmerFuddHomePage.htm
<html> <head> <title>My Test Page at Woodbridge Campus</title> </head> <body> <center> <img src =“ElmerFudd.jpg”> alt=“Elmer Fudd Photo” /> </center> <p> <h2><center>Woodbridge Campus</center></h2> <h2><center><b>Web page developed by Elmer P. Fudd.</b><center></h2> </p> The NOVA Woodbridge Campus is located in Northern Virginia. </body> </html> Tutorial 1 New Perspectives on HTML and XHTML, Comprehensive

107 Programming Languages: Ajax
What is Ajax? Stands for: Asynchronous JavaScript And XML Method of creating interactive Web applications designed to provide immediate response ! Combines JavaScript, HTML or XHTML, and XML The Google Maps Web site uses Ajax Web browsers that support Ajax are Internet Explorer, Firefox, Opera, Netscape Navigator, Safari (for Apple) p. 683 Next

108 Ajax: Example from W3Schools

109 Microsoft Visual Basic
Page 677 Figure 13-16 Discovering Computers 2011: Living in a Digital World Chapter 13

110 Microsoft Visual Basic Example Code

111 VBScript Language VBScript (short for Visual Basic Scripting Edition) is an Active Scripting language developed by Microsoft. The language's syntax reflects its pedigree as a limited variation of Microsoft's Visual Basic programming language. VBScript is installed as default in every desktop release of the Windows Operating System (OS) since Windows 98, and may or may not be included with Windows CE depending on the configuration and purpose of the device it is running on. It initially gained support from Windows administrators seeking an automation tool more powerful than the batch language first developed in the late 1970s. A VBScript script must be executed within a host environment, of which there are several provided on a standard install of Microsoft Windows (Windows Script Host, Windows Internet Explorer). Additionally, The VBScript hosting environment is embeddable in other programs, through technologies such as the Microsoft Script control (msscript.ocx).

112 Rexx Language easy to learn and easy to read. Both commercial and
REXX (REstructured eXtended eXecutor) is an interpreted computer programming language which was developed at IBM. It is a structured high-level programming language which was designed to be both easy to learn and easy to read. Both commercial and open source interpreters for REXX are available on a wide range of computing platforms, and compilers are available for IBM mainframes.

113 Ruby on Rails (RoR) RoR provides technologies for developing object- oriented , database-driven Web sites. Rails uses a free object-oriented scripting language called Ruby which is derived from a variety of languages including Ada, Lisp, Perl and Smalltalk. Rails is designed to make Web developers more productive by eliminating time-consuming steps in the Web development process.

114 Ruby on Rails Sample Code
Click on this link to view sample Ruby code

115 Microsoft Silverlight
Silverlight is a Web page authoring program that also enables Web developers to combine interactive content with text, graphics, audio and video. It is based on the .NET framework and it works with a variety of languages including JavaScript, Ruby, C#, and Visual Basic .NET Can run on Windows, Mac OS X, Linux platforms

116 Web Development Software
What is Web page authoring software? Creates sophisticated Web pages without using HTML This software generates the HTMLcode Dreamweaver Flash Microsoft Expression Web Visual Web Studio by Microsoft Expression Web Dreamweaver Flash p. 683

117 Microsoft Expression Web
Microsoft Expression Web, code-named Quartz, is a WYSIWYG HTML editor and general web design program by Microsoft, replacing Microsoft FrontPage. It is part of the Expression Studio suite. Expression Web allows authoring of web pages integrating XML, CSS 4.0, ASP.NET 2.0, XHTML, XSLT and JavaScript into sites. It requires the .NET Framework 2.0 to operate. Its sibling is Microsoft SharePoint Designer. Expression Web can also work with PHP. Expression Web uses its own standards- based rendering engine.

118 Client-side & Server-side Languages
Client-side Languages: (your computer) JavaScript (based on Java) VBScript (Visual Basic Script) Server-side Languages PHP (Personal Hypertext Preprocessor) Usually runs on Apache Web servers ASP (Active Server Page .asp) runs on IIS (Windows) ASP.NET (Similar to PHP) runs on IIS (Windows) JSP (Java Server Page) .jsp ColdFusion (to connect Web pages to a database) Note: IIS means  Internet Information Services (by Microsoft)

119 Server-Side Web Development Languages
Used for Web development: Perl (Practical Extraction & Report Language) ASP (Active Server Pages) .asp JSP (Java Server Pages) jsp PHP (Personal Hypertext Preprocessor) .php

120 The Python Programming Language
Visit: Python is a programming language that lets you work more quickly and integrate your systems more effectively. See almost immediate gains in productivity and lower maintenance costs. Python runs on Windows, Linux/Unix, Mac OS X, and has been ported to the Java and .NET virtual machines.

121 The Python Programming Language
Visit: Example of nested if statement in Python: >>> x = int(raw_input("Please enter an integer: ")) >>> if x < 0: x = 0 print 'Negative changed to zero‘ elif x == 0: print 'Zero' elif x == 1: print 'Single' . else: print 'More'

122 PHP (Personal Hypertext Preprocessor)
PHP is an interpreted SERVER-side scripting language used for creating dynamic Web pages. PHP is used to process data sent from a Web form to a Web server. PHP is embedded in HTML pages but is usually executed on the Web server. The code example on the next slide is a very simple PHP CGI application that creates the message “Hello World, Hello ITE100 Class!” in XHTML (see next slide)  p Fig Next

123 PHP Code Example <?php $enVars =array(“HTTP_USER_AGENT”);
foreach($enVars as $var) { print “ <html> <head> <title>PHP CGI Example</title> </head> </body> <h1>Hello, World! Hello ITE100 Class!</h1> Your user agent is:<strong>${$var}.</strong> </br> </body> </html> “; } ?> p Fig Next

124 Example of an Active Server Page (ASP)
LANGUAGE="VBSCRIPT"%> <% ' Patrick Healy April 15, Apps Dev II ITP295 If Request.Form("Name") <> "" Then Dept = Request.Form("Dept") Name = Request.Form("Name") Home_Phone = Request.Form("Home_Phone") Extension = Request.Form("Extension") %> <HTML> <HEAD> <TITLE>Cyber Company Employee Input Results</TITLE> </HEAD> Comment line

125 Example of an Active Server Page (ASP)
Table definition <BODY> <H2>Confirm Results</H2> <HR> <B>You input the following data:</B><P> <TABLE BORDER="1"> <TR><TD><B>Department</B> <TD><%= Dept%> <TR><TD><B>Name</B> <TD><%= Name%> <TR><TD><B>Home Phone</B> <TD><%= Home_Phone%> <TR><TD><B>Extension</B> <td><%= Extension%> </TABLE> </BODY> </HTML> <% Else %>

126 Example of an Active Server Page (ASP)
<HTML> <HEAD> <TITLE>Add an Employee to Healy Company Database</TITLE> </HEAD> <BODY onLoad="document.empForm.Name.focus()"> <H2>Add an Employee to Healy Company Database</H2> <HR> <TABLE> <FORM NAME="empForm" METHOD="post" ACTION="add1.asp"> <TR><TD ALIGN="right" VALIGN="top"><B>Department:</B> <TD><SELECT NAME="Dept"> <OPTION>Personnel <OPTION>Finance <OPTION>Education <OPTION>Sales <OPTION>Management </SELECT>

127 Example of an Active Server Page (ASP)
<TR><TD ALIGN="right" VALIGN="top"><B>Name:</B><TD><INPUT TYPE="text" NAME="Name"> <TR><TD ALIGN="right" VALIGN="top"><B>Home Phone:</B><TD><INPUT TYPE="text" NAME="Home_Phone"> <TR><TD ALIGN="right" VALIGN="top"><B>Extension:</B><TD><INPUT TYPE="text" NAME="Extension"> <P><P> <TR><TD ALIGN="left" COLSPAN="2"> <INPUT TYPE="submit" NAME="cmdSubmit" VALUE="Submit"> <INPUT TYPE="reset" NAME="cmdReset" VALUE="Reset"> </FORM> </TABLE> </BODY> </HTML> <% End If %>

128 Web Development: Applets, Servlets
How are special effects and interactive elements added to a Web page? Script Interpreted program that runs on client Applet usually runs on client, but is compiled Servlet Applet that runs on server ActiveX control Small program that runs on client Hit Counter tracks number of visitors to a Web site Image map graphic image that points to a URL Processing form collects data from visitors to a Web site p Next

129 Web Development: ActiveXControls
An ActiveX Control is a small program, similar to an applet, that runs on the client computer instead of the server. ActiveX is a set of object-oriented technologies developed by Microsoft that allows components on a network to communicate with one another. Web browsers must support ActiveX in order to run an ActiveX control program.

130 More on ActiveXControls
It is a control using ActiveX technologies. An ActiveX control can be automatically downloaded and executed by a Web browser. ActiveX is not a programming language, but rather a set of rules for how applications should share information. Programmers can develop ActiveX controls in a variety of languages, including C, C++, Visual Basic, and Java.

131 Web Page Development: CGI
What is the common gateway interface (CGI)? Communications standard that defines how Web server communicates with outside sources CGI script—program that manages sending and receiving across CGI Step 1. The programmer stores the CGI program in a special folder on the Web server such as /cgi-bin. Step 2. The Webmaster creates a link between the CGI program and Web page. When a user displays the Web page, the CGI program automatically starts. Step 4. The CGI program receives information from the database, assembles it in an HTML format, and sends it to the user’s Web browser. Step 3. When the user submits a request, it is sent to the CGI program. The CGI program contacts the database and requests information for the user. In this case, it looks for a movie titled The Secret Garden. Database p Next

132 Web Development: XHTML
What is XHTML ? eXtensible HTML is a combination of HTML & XML XHTML (Extensible HTML) enables Web sites to be displayed more easily on microbrowsers (PDAs) Includes features of HTML and XML p Next

133 Web Page Development: XHTML 2.0
Like HTML 5 (latest version of HTML) There are 3 flavors of XHTML: XHMTL Transitional (most popular version) and allows formatting inside the document. XHTML Strict (requires the use of Cascading Style Sheets (CSS) for formatting all elements. XHTML Frameset (required for Web pages that use frames which divide up a Web page window) p Next

134 Web Page Development: XHTML
Next

135 Web Page Development: XHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " <html xmlns=" xml:lang="en"> <head> <meta name="Keywords" content="CIW, Foundations, Example"/> <meta name="Description" content="For the CIW Foundations Course"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <!-- <link rel="stylesheet" type="text/css" href="myform.css" title="stylesheet"/> --> <!-- Patrick Healy, NVCC-Woodbridge --> <title>Basic Web Form for ITE Classes</title> </head> <body> <h1>Basic NVCC XHTML Input Form</h1> <form method="post" action=" p Next

136 Web Page Development: XHTML
<strong>Enter Your Name: <input type = "text" name="Name" size="47"/></strong> <br/> <strong> Enter Your Address: <input type = "text" name=" " size="40"/></strong> <strong>Do you want to be adding to our mailing list?</strong> <input type="radio" name="AddToList" value="yes" checked="checked"/>Yes <input type="radio" name="AddToList" value="no" />No Which campus of NVCC to you regularly visit ? (Check all that apply): </br> <input type="checkbox" name="Alexandria"/> Alexandria <br/> <input type="checkbox" name="Annandale"/> Annandale <br/> <input type="checkbox" name="Loudon"/> Loudon <br/> <input type="checkbox" name="Manassas"/> Manassas <br/> <input type="checkbox" name="Woodbridge"/> Woodbridge <br/> p Next

137 Web Page Development: XHTML
How often do you want to receive an from NOVA? <br/> <select name=" Freq"> <option>Every Day </option> <option> Once a Week </option> <option> Once every two weeks </option> <option> Once a Month </option> <option value="Remove">Never </option> </select> <br/> Where would you like to vacation? (Choose all that apply) <select name="vacation" multiple="multiple" size="4"> <option>Hawaii</option> <option>Virgin Islands</option> <option>Canada</option> <option>France</option> <option>Mexico</option> <input type="submit"/> <input type="reset"/> </form> </body> </hmtl> p Next

138 Web Page Development: XML, WML
What are XML and WML? Server sends entire record to client, enabling client to do much of processing without going back to server XML (Extensible Markup Language) allows developers to create customized tags Uses wireless application protocol (WAP), standard that specifies how wireless devices communicate with Web WML (Wireless Markup Language) allows developers to design pages specifically for microbrowsers p Next

139 XML: eXtensible Markup Language
With XML, the server sends an entire record to the client, enabling the client computer to do much of the processing without going back to the server. XML allows developers to define a single link that points to multiple Web sites. XML separates Web page content from its format, allowing the Web browser to display the contents of a Web page in a form appropriate for the display device. (Smart phone, PDA, Laptop, PC, iPod )

140 XML XML Does not DO Anything !
Perhaps it is hard to understand, but XML does not DO anything. XML was created to structure, store, and transport information. The following example is a note to Tiny from Jane, stored as XML: <note> <to>Tiny</to> <from>Jane</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>

141 XML: eXtensible Markup Language
<?xml version="1.0" encoding="ISO " ?> <!-- Edited with XML Spy v   --> - <note>   <to>Shawn</to>   <from>Caitlyn</from>   <heading>Reminder</heading>   <body>Don't forget me this weekend!</body>   </note> Tutorial 1 New Perspectives on HTML and XHTML, Comprehensive

142 Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can be applied to any kind of XML document. The CSS specifications are maintained by the World Wide Web Consortium (W3C).

143 CSS Example <html> <head> <title> Sunny Acres Farm </title> <style type=“text/css”> h2 h3 {color: yellow; background-color: black } </style> <link href=“farm.css” rel=“stylesheet” type=“text/css”/> </head> <body> ( much more goes here ) </body> </html>

144 Perl: (Practical Extraction & Report Lang)
Perl is a cross-platform programming language that enables users to write custom CGI scripts. Perl is used for Web server processes. An example of Perl follows: #!/usr/bin/perl use CGI qw/:all/; $cgi_object = CGI::new( ); print “Content-type: text/html\n\n”; print”<html>\n<head>\n<title>\nPerl CGI Example\n</title>\n<body>\n<h1>Hello, World!</h1> \nYour user agent is: <b>\n”; print $cgi_object->user_agent( ); print “</b>.</html>\n”

145 Web Page Development: Author Software
What is Web page authoring software? Creates sophisticated Web pages without using HTML Generates HTML Adobe GoLive Adobe LiveMotion Lotus FastSite Adobe Dreamweaver Adobe Fireworks Adobe Flash Microsoft Expression Web and SharePoint Designer p Next

146 Discovering Computers 2012: Chapter 13
Web Page Development Most Web 2.0 sites use APIs (Application Programming Interface) An API enables programmers to interact with an environment such as a Web site or operating system Discovering Computers 2012: Chapter 13 Page 684 Figure 13-21

147 Adobe Dreamweaver http://en.wikipedia.org/wiki/Macromedia_Dreamweaver
Adobe Dreamweaver, or simply Dreamweaver, is a web development tool, originally created by Macromedia. Initial versions of the application served as simple WYSIWYG HTML editors but more recent versions have incorporated notable support for many other web technologies such as CSS, JavaScript, and various server-side scripting frameworks. [1] The software is available for both the Mac and Windows platforms, but can also be run on Unix-like platforms through the use of emulation software such as Wine. Dreamweaver is currently owned by Adobe Systems which purchased Macromedia in 2005.

148 Web Developer Software
Perl Python PHP4, PHP5, PHP6(beta) Adobe Dreamweaver Adobe Flash NetObjects Fusion

149 Perl Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier.[1][2] Since then, it has undergone many changes and revisions and become widely popular amongst programmers. Larry Wall continues to oversee development of the core language, and its upcoming version, Perl 6.

150 Perl Syntax my $a = 5; $a++; # $a is now 6; we added 1 to it.
$a += 10; # Now it's 16; we added 10 to $a $a /= 2; # And divided it by 2, so $a is 8 #!/usr/bin/perl print "Content-type: text/html \n\n"; #HTTP HEADER #CREATE STRINGS WITH ESCAPING CHARACTERS $string = "David paid \$4.34 for Larry\'s shirt."; $ = #PRINT THE STRINGS print "$string<br />"; print "$ <br />"; print '$string and $ ';

151 PHP (Used in Facebook) PHP: Hypertext Preprocessor is a widely used, general-purpose scripting language that was originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document. As a general-purpose programming language, PHP code is processed by an interpreter application in command-line mode performing desired operating system operations and producing program output on its standard output channel. It may also function as a graphical application.

152 PHP Syntax <html> <head> <title>PHP Test</title> </head> <body> <?php echo "Hello World"; /* echo("Hello World"); works as well, although echo isn't a function, but a language construct. In some cases, such as when multiple parameters are passed to echo, parameters cannot be enclosed in parentheses. */ ?> </body> </html>

153 Multimedia Software Development
What is multimedia authoring software? Combines text, graphics, animation, audio, and video into interactive presentation Used for computer-based training (CBT) and Web-based training (WBT) Software includes Toolbook, Authorware, and Director p Fig Next

154 Mobile Phone Software Development Tools
Varies greatly by platform: Java/Eclipse for Android Objective-C/Xcode for iPhone C# VB/Visual Studio for WinPhone C++ Java/Blackberry SDK Each platform has it's own toolchain Software written for one platform does not work on others. Each has it's own GUI/Libs/Processes.

155 Which platform(s) do you target?
The market is fragmented. Build it from scratch for each platform. Different tools, equipment, skills. Different processes, rules, form factors. Expensive. Difficult for small shops. Very difficult for the lone developer/small shop to build and maintain apps across all these devices and form factors.

156 Which platform(s) do you target?
The market is fragmented. Build it from scratch for each platform. Different tools, equipment, skills. Different processes, rules, form factors. Expensive. Difficult for small shops. Very difficult for the lone developer/small shop to build and maintain apps across all these devices and form factors.

157 We chose to build a Native Android App
Seemed like a good idea. Free tools. Developer friends. No onerous market policies. Large market. Technologies we already understood. Tools we already had access to. Bad Move: 9 months to build in Java. First question everyone asked: Do you have an iPhone version? Not enough time to learn/build a version in Objective-C. Then it was: Kindle Fire? Blackberry? WinPhone7?

158 But there are so many mobile devices!
Even big s/w shops can't build for all. Android, iPhone, Blackberry, WinPhone Kindle Fire, iPad, Playbook, and more.

159 There is only one technology stack common to almost all devices.
The external web forces platform vendors to make these technologies available otherwise their platforms won't compete. i.e. Next Generation Web Technologies (and there's little the platform vendors can do about it.)

160 PC Emulator/Game of DOOM in Javascript
Now a very serious development language. Many consider it the “must-know” language. Microsoft making JS/HTML5 first class citizen. Many unbelievable projects in Javascript: PC Emulator/Game of DOOM in Javascript Google Apps Anyone? Calc, Doc, Maps, etc Other languages implemented in Javascript Mention node.js Mention it's gowing use.

161 HTML5 Apps have a serious limitation
Work inside a web browser. Sandboxed. No accessing the phone. No access to local files. Typically served from a web server. Cannot be installed on a phone. Big Problem! HTML5 apps are web-apps not phone-apps. Talk about the problem of getting people to visit website on their phones. Too many steps. Users want convenience of apps.

162 Bridging the Gap between Web and Phone
The browser is just a control. What if an app could load the brower control? Feed it pages? Provide hooks to allow pages to access the phone? Camera, Databases, Contacts, Files, GPS, etc Could a web-app then be packaged like a real app? Talk about embedding MSIE control for example.

163 Multimedia Development: ToolBook
ToolBook, from SumTotal Systems has a GUI and uses an object-oriented approach. Developers can design multimedia applications using basic objects such as buttons, fields, graphics, backgrounds, and pages. In ToolBook, developers can convert a multimedia applications into HTML and Java so it can be distributed over the Internet. ToolBook can be used to create content for distance learning courses. Next

164 Multimedia Program Development
Discovering Computers 2012: Chapter 13 Page 685 Figure 13-22

165 Multimedia Development: Authorware 7
Authorware, from Adobe, is a multimedia authoring program that provides the tools developers need to build interactive multimedia training and educational programs. Authorware offers a powerful authoring environment for developing multimedia magazines, catalogs, and reference titles for CD-ROMs and DVD-ROMs. Users need the Shockwave software plug-in to view certain applications. p Fig Next

166 Multimedia: Adobe Director
Director from Adobe, is a popular multimedia authoring program that provides powerful features for developers who need to build highly interactive multimedia applications and games. Director’s features make it well suited for developing electronic presentations. Users need the Shockwave software plug-in to view certain applications. p Fig Next

167 Other Programming Languages and Development Tools
Classic programming languages include: Ada ALGOL APL BASIC Forth FORTRAN HyperTalk LISP Logo Modula-2 Pascal PILOT PL/1 Prolog RPG Smalltalk Discovering Computers 2012: Chapter 13 Page 675 Figure 13-14

168 Other Programming Languages
LISP: LISt Processing– used for artificial intelligence applications. (began in 1958) Logo: Used to teach children programming and problem-solving. Pascal: used to teach structured programming. Modula-2: A successor to Pascal; used for developing systems software. PL/I: Combination of FORTRAN & COBOL Smalltalk: Object-oriented programming language

169 LISP PROGRAMMING LANGUAGE
John McCarthy LISP (LISt Processor) is generally regarded as the language for AI. LISP was formulated by AI pioneer John McCarthy in the late 1950's. Although LISP doesn't have a built-in inference mechanism, inference processes can be implemented into LISP very easily. LISP's essential data structure is an ordered sequence of elements called a "list." The elements may be irreducible entities called "atoms" (functions, names or numbers) or they can be other lists. Lists are essential for AI work because of their flexibility: a programmer need not specify in advance the number or type of elements in a list. Also, lists can be used to represent an almost limitless array of things, from expert rules to computer programs to thought processes to system components. Originally, LISP was built around a small set of simple list-manipulating functions which were building blocks for defining other, more complex functions. Today LISPs have many functions and features which facilitate development efforts. Among contemporary implementations and dialects, have gained acceptance as a standard. A substantial amount of work has also been done in Scheme, a LISP dialect which has influenced the developers of Common LISP.

170 LISP: LISt Processor Description
This program demonstrates a fairly simple conversion implemented in LISP. Each time the program (CONVERT) is called it asks the user for any Fahrenheit degree, then displays the equivalent Celsius degree for the user. Source Code ;;; This function, given a specific number of degrees in Fahrenheit, ;;; presents the user with equivalent Celsius degree. (defun convert () (format t "Enter Fahrenheit ") (LET (fahr) (SETQ fahr (read fahr)) (APPEND '(celsisus is) (*(- fahr 32)(/ 5 9)) ) )

171 LISP Result

172 Do While Loops Given the following pseudocode, what are the values of COUNT and SUM when they are printed in the PRINT statement? COUNT = 0 SUM = 0 DO WHILE (COUNT < 5) COUNT = COUNT + 1 SUM = SUM + COUNT END DO PRINT COUNT, SUM COUNT = ____ SUM = _______

173 Do Until Loops Given the following pseudocode, what are the values of COUNT and SUM when they are printed in the PRINT statement? COUNT = 0 SUM = 0 DO COUNT = COUNT + 1 SUM = SUM + COUNT UNTIL (COUNT > 7) PRINT COUNT, SUM

174 Nanotech: Future of Computers
According to a recent Computer World magazine article, magnetic disk drives in laptops and other devices will be replaced with nanotechnology in the coming years, which will greatly speed up performance. LiveScience.com also reported in July 2008 that researchers had created the first artificial DNA, which will influence technological advancements, including computers. A security engineer and tech expert who wishes to remain anonymous because of the nature of his job, explains: “With regard to nanotechnology and artificial DNA, computers are going to get smaller and be able to handle more tasks. For example, I see artificial DNA being used with accelerating the use of 'self-healing' servers (servers that can fix themselves when a problem occurs).” “What technology experts want to achieve is what they've wanted to achieve for decades now: computerized devices with more capacious storage and faster processing units. Nanotech and DNA-based computers are just possible means to these ends.”

175 End of Chapter 13 Presentation


Download ppt "Discovering Computers"

Similar presentations


Ads by Google