Programming Software: Tutorial

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Bottom-up programing approach:

A bottom-up approach is almost the opposite of a top-down approach. In this approach, individual independent parts are pieced together to give a more complex system. You begin by specifying individual base elements. Then, you link these elements to solve the main complex problem.

Advantages

-In open-source software, there is unlimited access to the source code and the right to modify and enhance it. This option enables users to port the code to new hardware. It also enables them to add or remove functionality and modify the program to meet their needs. -The ability to redistribute code enhancements and modifications freely is part of most open-source licenses. This particular advantage differentiates it from "nearly free" software licenses. -The right to use the software in any way is another advantage of this system. When combined with redistribution rights, it allows a program to spread rapidly across a large user base. It also attracts a wider variety of developers to work on the software. Moreover, it helps build a market for program customization.

Disadvantages

-Open-source software is often the result of a hobby project. Developers working on small budgets in their spare time usually create this kind of project. As a result, it usually comes without any warranties and can be unreliable. -Any number of individuals can make changes to the open-source software. These individuals can then redistribute it without any restrictions, which may leave the software open to misuse. -In the case of software problems, there is often no technical support available. The only help you usually receive is by looking for solutions on blogs and websites and by interacting with other users on online forums. -Open-source software is often developed and distributed in a haphazard manner. Regular bug fixes or updates may not be available. There is also the risk of a developer abandoning an open-source project at some stage of its development.

Match the generations of programming languages with the way they represent instructions in program code. Pairs 1. Use mnemonic codes to represent instructions 2. Use zeros and ones to represent instructions 3. Use English words to represent instructions 4. Use artificial intelligence to create program code 5. Use a visual environment to create programs

1. second generation 2. first generation 3. third generation 4. fifth generation 5. fourth generation

Evolution of programming Languages

A computer is a device that accepts input, processes it, and produces output. You can feed instructions into a computer using a programming language. These languages tell the computing system how to convert the given input into the required output. Programmers developed programming languages in phases that are called generations. These categories were based on the usability (or simplicity) of the language. Although you can group different programming languages into a single generation, every language has its own characteristics. Each language has its own syntax (or rules) that programmers must follow while writing the program. In addition, programmers must use predetermined program structures and apply programming principles of the language in use.

Numbers:

A computer represents a positive number using a sequence of 1s and 0s. A single bit can represent one of two pieces of information (0 or 1). A string of bits can represent larger pieces of information. For example, a string of two bits can store four unique values or pieces of information (00, 0, 10, or 11). A byte is a string of eight bits. It can represent up to 2^8 or 256 pieces of information. One word can require two, four, or eight bytes.

Structured programming approach:

A structured approach to programming makes use of blocks, subroutines, and loops to give a program structure. Earlier programs were rather unstructured in their approach. They utilized statements to move control haphazardly around the program. The development of structured programming established proper standards of control. It also introduced sequence, selection, and repetition that would then become a staple in programming.

Top-down programming approach:

A top-down approach refers to the breaking down (or decomposition) of a program into smaller parts. Each part is called a subprogram and is independent of the other parts. You can also further divide the subparts into smaller parts until just the base elements are left. You can visualize a top-down approach in the hierarchy of a department of a company. A project can be broken down into smaller and smaller parts at each subsequent level. You finally execute the project at the base.

GNU General Public License:

Also called an open-source license, this license allows you to distribute open-source software and other products. These products include intellectual property, such as art or music. This license states the conditions under which the software source code is available to the public. It also states the terms under which developers can edit, redistribute, and modify the code. Open-source licensed software is usually available free of charge for non-commercial use. However, the end user may have to follow certain rules regarding the attribution of authorship.

Approaches to programming

As programming languages developed, different approaches (or styles) of programming were also developed. This was because organizations needed efficient ways to develop programs. Standardizing programming and the programming process was a major development. Since then, programmers have developed different approaches based on parameters such as program complexity, integration features, and more. Let's learn about a few commonly used approaches.

Software Licenses

Companies do not sell computer software to a buyer. Instead, they license it for use by one or more individuals or organizations. A software license is a legal agreement. It states the terms and conditions of use of the software by the end user. It defines the rights and privileges of the software producer and end user with regard to the alteration and redistribution of the software. Some licenses depend on the number of computers the end user will install the software on. Other licenses take into account the total number of users using the software. Let's look at the different types of software licenses.

Computer Languages

Computers receive instructions from programmers in the form of programming language. These instructions tell the computing system what to do to provide the desired output. The two broad categories of computer languages are low-level languages and high-level languages.

Designing the program and user interface (UI):

Designing the program involves deciding the steps of the program with the help of algorithms and flowcharts. Algorithms help programmers work out the underlying logic of a problem before coding can commence. An algorithm is a set of steps used to solve a problem. The algorithm to display even numbers from a list of 10 given numbers is shown on the right. Algorithms use simple instructions. You should always begin and end an algorithm with a Start and Stop. You also need to number each individual step. You can later translate algorithms into pseudocode. Pseudocode is actually the same program written in a natural language, like English, that humans can read and understand. Flowcharts, like algorithms, are design tools used to visualize a program before developers build it. A flowchart shows the flow of control between the different parts of a program. You can create flowcharts using the following elements. -The start and end of a flowchart is symbolized using ovals or rounded rectangles with "Start" or "End" written in them. -Procedural steps appear within rectangular boxes. -Subroutines appear in rectangles with double vertical edges. -Input and output statements are within parallelograms. -Decision statements appear in a rhombus, with different arrows for each decision. -Arrows show the flow of control.

Documenting and maintaining the program:

Documentation refers to all process documentation completed during the different phases of the life cycle. It also includes documentation related to the finished program. Types of documents include the design handbook, user manual, and documents to state attributes and characteristics of program. They also include documents of code and algorithms used in software development and documents to state how to market the software product. Maintenance encompasses the tasks of enhancing and optimizing a program product while eliminating errors and outdated components. Careful planning in the maintenance phase is important, just as it is with all other parts of the life cycle. Maintenance is required in order to modify the program to accommodate additional user requirements. It is also required to make configuration changes and keep the program running at optimal levels. In many cases, the requirements may change after using a program. This is because explicitly defining all the requirements ahead of time is difficult. Therefore, maintenance could mean a return to the analysis and design phases in order to define new requirements or design/redesign particular components of the program. Programmers then proceed through the PDLC again in order to code, test, and integrate the new components or modules.

Fourth-generation languages:

Fourth-generation languages evolved during the 1970s through the 1990s. Although they are conceptually similar to third-generation languages, fourth-generation languages provide programmers with a visual environment to create programs. Programmers can drag and place visual entities, such as buttons, labels, and text boxes, to create an application. Programmers can assign actions to the elements, such as opening a hyperlink. Visual Basic .NET, Microsoft FrontPage, and JavaScript are all examples of fourth-generation languages.

High-level languages

High-level languages use symbols and words instead of the numbers and cryptic abbreviations found in machine languages. The commands derive from the English language. Therefore, it is easier for people to write and understand this form of source code. Each instruction written in a high-level language compiles or converts into machine language instructions. Most computer programming occurs in high-level languages. Let's learn about some high-level programming languages.

Graphics:

Images and other graphics (icons, toolbars, and so on) that we see on a computer screen consist of pixels. Pixels are tiny dots of color that form the entire image or graphic. The computer arranges pixels in columns and rows on the screen. For example, a resolution of 800 x 600 means the screen will display a grid of 800 pixels by 600 pixels.

Object-oriented programming (OOP) approach:

In this programming model, the computer program divides into objects when you feed it into the system. Systems that use this language contain objects relating to a particular system. For example, an online shopping system will have objects such as products, customers, and so on. Some programming languages that use the OOP model are C++, C#, Java, Python, Ruby, and PHP.

Low-level Languages

Low-level languages encode instructions using a sequence of 1s and 0s. 0 represents the absence of an electric pulse, and 1 represents the presence of an electric pulse. Different combinations of 1s and 0s represent different instructions or commands. Low-level languages consume very little memory. Therefore, low-level language programs can run much faster than high-level language programs. You can subdivide low-level languages into two types: machine language and assembly language.

Assembly language:

Machine language commands are cryptic and difficult to write. In contrast, assembly language uses short abbreviations to represent machine code. The language derives these abbreviations from words in the English language. These abbreviations can be from three to five letters long. For example, ADD stands for addition and SUB for subtraction. To develop software using assembly language, the programmer uses a text editor to create the source code. The source code is a file that uses appropriate commands and syntax to describe all the instructions. The computer then converts this file into machine code with the help of an assembler. An assembler is a program that translates assembly commands into machine code. Motorola MC6800 and Symbolic Optimal Assembly Program (SOAP) are examples of assembly languages.

Machine language:

Machine language was the first type of programming language to be developed. It is the only "language" that a computer understands. This language uses commands that consist of the binary numbers 0 and 1. A computer's memory and processing switches use this language. Therefore, programmers use it to encode most software commands that directly affect computer hardware. Humans cannot easily read machine language.

Modular programming approach:

Modular programming involves breaking the main program down into smaller parts called modules. Each module is an independent set of instructions that performs a particular task. This set of instructions allows programmers to construct each module separately. It also allows you to test and reuse each module.

Perpetual license:

Most individuals who obtain software for personal use receive this type of license. A perpetual license does not have an expiration date and extends for an indefinite period after purchase. However, there may be a time limit on the updates and technical support provided by the software owner.

Compression:

Nowadays, files contain so much information that it has become difficult to store the data. This is particularly applicable to graphic files. Each pixel consists of a number of bits, and graphic files are made of many such pixels. Therefore, a graphic file requires the most storage space. Files containing software applications also consume extra storage space. This results in an increased cost to store data and transmit it over large networks. Hence, there is a need to compress these files to maximize memory usage and make them easier to handle. Compression involves making a file shorter by removing repeated bit patterns. Examples of compression programs include JPEG, which you use for image compression, and ZIP, which you use to compress files and folders.

1. Which language will a developer use when creating web pages?

PHP

fifth-generation languages:

Programmers developed fifth-generation languages in the 1980s. These new-age languages use artificial intelligence to create program code. Examples of fifth-generation languages include Prolog, OPS5, and Mercury.

Program Development Life Cycle:

Programmers follow an organized plan to develop a program. This plan is called the program development lifecycle (PDLC). The following phases are involved in PDLC: - Gathering and analyzing program requirements - Designing the program and user interface (UI) - Coding the program - Testing and debugging the program - Documenting and maintaining the program

Testing and debugging the program:

Testing is an important phase of the program development life cycle. Testing uncovers errors or defects in the system. A defect arises due to errors in coding or in the logic used in coding. Incorrect calculations in a billing system at the supermarket or a failure to fetch data from a database are some examples of software defects. Testing of compiled programs and subsequent debugging is necessary to remove all sources of errors from the program. A debugger is a program (sometimes part of the compiler) that allows the programmer to run the coded program in steps. A debugger also checks different variables and parameters at different points. This process allows the programmer to narrow down on specific areas of faults. After the programmer evaluates the code, the testing team identifies any additional hidden bugs or sources of error in the program. This refining process helps modify and tweak a compiled program.

Gathering and analyzing program requirements:

The analysis phase mainly consists of requirements gathering, analysis, and project planning. After gathering the requirements, the programmers analyze them to come up with a defining diagram. This diagram lists and defines all the components. It also shows the inputs, processing, and outputs of each component.

First-generation languages:

The earliest programming languages belonged to the first generation (during the 1940s). These languages consisted of simple binary code that was computer readable. However, these languages were difficult for humans to read. This is because even simple instructions were made up of long strings of zeros (0s) and one (1s). These early languages were known as machine languages. The UNIVAC and ENIAC computers are examples of first-generation computing devices.

Second-generation languages:

The second generation (in the early 1950s) saw the development of assembly languages. These languages used mnemonic codes and made programming languages easier to use. However, assembly languages did not resolve the dependency that the machines had on their processors. In subsequent generations, programmers developed languages that used English-like words, were easier to use, and reduced machine dependency. Examples of second-generation computers are IBM 7094 series, IBM 1400 series, and CDC 164.

Third-generation languages:

Third-generation languages evolved during the late 1950s and early 1960s. These languages used familiar English words to write instructions. In addition, languages used mathematical symbols such as "+" and "-" to denote addition and subtraction operations. BASIC, C, and Java(though programmers developed Java in the 90s) are examples of third-generation languages. Businesses used COBOL, a high-level language, for record keeping. Mathematical applications use FORTRAN.

Proprietary license:

This is the most common type of license for commercial software. It states that the software producer licenses the end user to make one or two copies of the purchased software. However, the end user cannot claim ownership of those copies. Ownership rights remain with the software producer. In addition, the end user may install the software only after accepting all the terms and conditions of the license.

Non-perpetual license:

This license follows the subscription model. It allows the end user to use the computer software only for a specific period. The period may be one or two years. After this period, the software will not function unless the user renews the subscription. A software copyright is a subset of a copyright law meant specifically for machine-readable software produced by software developers. The government created this law to prevent the unauthorized use of computer software. The software copyright law protects software companies from the illegal redistribution and usage of their software.

License with maintenance:

This license permits end users to use the software, its updates, and a new version of the program for a period of one to two years or until the license expires. The user will need to purchase the new version of the software after the license expires.

Site license:

This type of license permits the use of a software application on a computer located at a specific site, such as a university or business organization. Numerous site licenses for particular software allow the end user to install it on a number of computers, but only at specific client sites. Some site licenses allow you to use software only on computers that belong to a legalized body, such as a university or corporation.

Text:

To store text on a computer or another digital device, each letter of the alphabet receives a specific numeric value code that the computer can recognize. The American Standard Code for Information Interchange (ASCII) is the most commonly used code for text representation. It defines 128 letters and symbols. For example, ASCII represents the letter "A" with the number 65 and "B" with 66 for device storage and processing.

Lisp:

derives its name from the phrase "list processing." Developers originally created this programming language to express mathematical notation on computers. It gained widespread popularity and began to see extensive use in artificial intelligence research. As one of the oldest programming languages, Lisp receives credit for many programming innovations. These innovations include tree data structures, recursion, automatic storage management, and more. Lisp source code consists of lists, and users can manipulate functions within the program. This feature is one of the important advantages of this language.

Coding the program:

involves the creation of the program. Programmers use documents and designs to guide them in delivering efficient code. Coding refers to translating the software design into machine-readable form. Programmers pick the correct programming language based on the requirements. Programmers normally run and create programs on applications called compilers or interpreters. A compiler is a computer program that converts the source code of a program from a high-level language to machine code. Then, the compiler creates an object code file and ultimately an executable file. An error report generates after the program compiles the code. If a developer makes changes to resolve errors in the code, the compiler will recompile the altered source code. Each programming language requires its own compiler. For example, the C++ source code requires a C++ compiler to translate code written in that language. An interpreter executes source code in a line-by-line fashion. It does not create an executable file. However, it translates and executes one line of the source code and then moves to the next line. If an error occurs in any line of the program, the interpreter stops execution at that point. Interpreters translate code faster than compilers. However, an interpreted code runs more slowly than the compiled code. This is because interpreters do not save the translated code to a file. They must translate and re-execute it each time the system calls for it.

PHP:

is a general-purpose programming language. It is relatively easy to learn and is the most important language for aspiring web developers to know. Developers can embed PHP in HTML pages. Therefore, browsers can execute the code, making it easier for users to work with the language.

Java:

is an OOP language developed for application programming. It is highly portable. Java programs can run on many different platforms without having to recompile separately for each platform. Developers use Java to create games, mobile applications, web applications, and enterprise software.

Python:

is another high-level OOP language that enables programmers to write source code that is shorter and more readable than code in other major programming languages. Automatic memory management and a large standard library are its most significant features. Developers often use Python as a scripting language. They also use Python to develop web and desktop applications.

Data Representation

is the method by which a computer stores data. This process occurs internally and is not visible to the user. The computer may store different types of data. However, it will always represent data in the form of machine code, that is, in 0s and 1s. Let's learn about some different types of data representation.

Open-source Software

refers to a computer source code that is publicly available. Traditionally, companies and individuals distributed only the final, compiled executables of their software programs. They treated the source code as a trade secret and actively prevented its distribution. The open-source software movement requires program source code to be freely available to whoever wants to use it. Depending on the open-source license used, individuals and other companies are free to modify the code or use parts of it for other purposes. Such modifications may change the way the software works, improve its functionality, or fix parts of the program that contain errors. Code sharing also eases the process of writing new programs. This is because programmers can reuse previously created and tested source code. Developers usually run larger open-source projects in a collaborative manner. Any individual has the right to view, copy, or change the software. Examples of open-source software include Firefox, Thunderbird, MySQL, OpenOffice, PHP, Blender, and Drupal CMS.


Set pelajaran terkait

Health and Life (chapters 8 & 9)

View Set

Ch 7 CMA Exam Review - Nutrition

View Set

Urinalysis & Other Body Fluids (Review)

View Set

6.EE.2c Evaluate expressions given a value for the variable

View Set

Principles of Computer Programming Vocabulary

View Set