Gambas is a free programming language derived from Basic. It distributes under the GNU GPL license. It allows creating forms with command buttons, text boxes, and many other controls and linking them to databases. Gambas is a simple programming language for free platforms (such as GNU/Linux and BSD). This example allows us to perform a subtraction. It takes numbers as input, performs the subtraction, and prints the result.
The document contains code for several programs:
1. A billing program that allows adding items to a grid and calculates totals.
2. A calculator program with buttons for numbers and operations.
3. A program that calculates percentages of different products in a total.
4. A program that draws circles in an area and changes the radius on button clicks.
5. A screensaver program that draws random shapes on a timer in an area.
6. A digital clock program.
The document contains descriptions of 20 coding exercises in Spanish that demonstrate basic programming concepts like variables, conditionals, loops, functions, objects, and graphical user interfaces using the Gambas programming language. The exercises cover topics such as: printing text, mathematical operations, finding the maximum of 3 numbers, validating ID numbers, calculating factorials, Fibonacci sequences, creating classes for vehicles and living things, building a basic calculator app, and drawing shapes.
The document contains examples of exercises using the GAMBAS programming language. The exercises cover basic concepts like printing text, performing mathematical operations, using functions, objects and graphical user interfaces. Some examples include: printing "Hello World", adding two numbers, finding the maximum of three numbers, calculating a checksum for an ID number, creating and using objects like vehicles and living beings, developing a graphical calculator application and creating a screensaver program.
The document contains examples of programming exercises in Visual Basic. It includes 10 exercises demonstrating basic concepts like printing text, performing mathematical operations, working with variables and conditional statements. It also includes 8 exercises showing the use of functions, objects, and graphical user interface elements like buttons and text boxes.
This document contains 10 programming exercises in GAMBAS, a BASIC-like programming language. The exercises cover basic concepts like variables, input/output, conditional statements, loops, functions, and objects. They include calculating sums and finding the maximum of 3 numbers, validating ID numbers, Fibonacci series, and simple graphical programs for a calculator and digital clock. The final exercises demonstrate creating objects for superheroes and living beings, as well as graphical programs for a bouncing circle, coloring application, and screensaver.
The document contains 19 coding exercises in Visual Basic using GAMBAS. The exercises cover basic concepts like printing text, performing mathematical operations, using conditional statements, creating functions, working with objects and classes, building graphical user interfaces, and creating simple games and applications like a calculator. Overall, the exercises demonstrate fundamental programming techniques in a step-by-step manner to teach Visual Basic syntax and programming logic.
This document contains code for several different programs written in Gambas including:
1. A billing program that allows a user to add items, quantities, and prices to a grid and calculates subtotals.
2. A basic calculator program that includes number buttons, arithmetic operators, and functions like square root.
3. A program that calculates the percentages of different products in a total.
4. A program that draws circles on a form and allows changing the radius size.
5. A screen saver program that draws random shapes on a form with changing colors.
This document contains 10 programming exercises in GAMBAS, a BASIC-like programming language. The exercises cover topics such as: basic math operations like addition and finding the maximum of 3 numbers; validating identification numbers; calculating factorials and Fibonacci sequences; using objects and classes; and creating basic graphical user interfaces. The exercises were completed by students Angela Solorzano and Raquel Zambrano at the Laica Eloy Alfaro University of Manabi, Ecuador.
The document contains code for several programs:
1. A billing program that allows adding items to a grid and calculates totals.
2. A calculator program with buttons for numbers and operations.
3. A program that calculates percentages of different products in a total.
4. A program that draws circles in an area and changes the radius on button clicks.
5. A screensaver program that draws random shapes on a timer in an area.
6. A digital clock program.
The document contains descriptions of 20 coding exercises in Spanish that demonstrate basic programming concepts like variables, conditionals, loops, functions, objects, and graphical user interfaces using the Gambas programming language. The exercises cover topics such as: printing text, mathematical operations, finding the maximum of 3 numbers, validating ID numbers, calculating factorials, Fibonacci sequences, creating classes for vehicles and living things, building a basic calculator app, and drawing shapes.
The document contains examples of exercises using the GAMBAS programming language. The exercises cover basic concepts like printing text, performing mathematical operations, using functions, objects and graphical user interfaces. Some examples include: printing "Hello World", adding two numbers, finding the maximum of three numbers, calculating a checksum for an ID number, creating and using objects like vehicles and living beings, developing a graphical calculator application and creating a screensaver program.
The document contains examples of programming exercises in Visual Basic. It includes 10 exercises demonstrating basic concepts like printing text, performing mathematical operations, working with variables and conditional statements. It also includes 8 exercises showing the use of functions, objects, and graphical user interface elements like buttons and text boxes.
This document contains 10 programming exercises in GAMBAS, a BASIC-like programming language. The exercises cover basic concepts like variables, input/output, conditional statements, loops, functions, and objects. They include calculating sums and finding the maximum of 3 numbers, validating ID numbers, Fibonacci series, and simple graphical programs for a calculator and digital clock. The final exercises demonstrate creating objects for superheroes and living beings, as well as graphical programs for a bouncing circle, coloring application, and screensaver.
The document contains 19 coding exercises in Visual Basic using GAMBAS. The exercises cover basic concepts like printing text, performing mathematical operations, using conditional statements, creating functions, working with objects and classes, building graphical user interfaces, and creating simple games and applications like a calculator. Overall, the exercises demonstrate fundamental programming techniques in a step-by-step manner to teach Visual Basic syntax and programming logic.
This document contains code for several different programs written in Gambas including:
1. A billing program that allows a user to add items, quantities, and prices to a grid and calculates subtotals.
2. A basic calculator program that includes number buttons, arithmetic operators, and functions like square root.
3. A program that calculates the percentages of different products in a total.
4. A program that draws circles on a form and allows changing the radius size.
5. A screen saver program that draws random shapes on a form with changing colors.
This document contains 10 programming exercises in GAMBAS, a BASIC-like programming language. The exercises cover topics such as: basic math operations like addition and finding the maximum of 3 numbers; validating identification numbers; calculating factorials and Fibonacci sequences; using objects and classes; and creating basic graphical user interfaces. The exercises were completed by students Angela Solorzano and Raquel Zambrano at the Laica Eloy Alfaro University of Manabi, Ecuador.
This document contains 10 programming exercises in Gambas, a visual programming language. It includes exercises to calculate sums, find the largest of three numbers, validate ID numbers, calculate factorials, and export percentages. It also includes graphical user interface examples like a calculator application, clock, and random number guessing game. The exercises demonstrate basic programming concepts like variables, conditional statements, loops, and functions.
This document contains 10 programming exercises in Gambas, a visual programming language. The exercises cover basic concepts like variables, conditionals, loops, functions, objects, and graphical user interfaces. They include calculating sums, finding the largest of 3 numbers, validating ID numbers, calculating factorials, and creating a simple calculator application. The exercises demonstrate how to perform common programming tasks in Gambas.
This book is an example of programming code for making a shop order form in Microsoft Visual Basic (VB). If you need the compiled program, please PM me. Thank you.
This document contains summaries of multiple coding exercises completed by students Glenda Hurtado and David Saldaña at the Colegio Nacional Técnico "Arturo Borja". It includes exercises on basic math operations, functions, Fibonacci sequences, games, calculators, and trigonometric functions implemented in code. The exercises demonstrate skills in programming logic, variables, conditional statements, loops, and other basic programming concepts.
This document provides an overview of Eclipse Draw2D, which allows for graphical creation, editing, and manipulation. It describes key Draw2D components like LightweightSystem, EventDispatcher, and UpdateManager. It also covers common figure types, painting figures, different layout options, and how to connect figures using anchors, routers, and locators. The document concludes with instructions for practicing with Draw2D.
This document contains code snippets and descriptions for various programming tasks and examples in Gambas, including:
1) A timer program that counts seconds, minutes, and hours
2) A program to find the largest of three numbers
3) A program to calculate a verification digit for an ID number
4) Programs demonstrating functions, objects, graphics, and other programming concepts.
5) The document is authored by Kenny Loor and contains code examples in Spanish with comments and descriptions.
The Ring programming language version 1.5.3 book - Part 46 of 184Mahmoud Samir Fayed
This document provides examples for using the RingZip library to work with zip files in Ring programs. It shows how to create zip files, add and extract files, and get metadata. It also provides reference documentation for the Zip and ZipEntry classes, describing their methods.
The Ring programming language version 1.3 book - Part 36 of 88Mahmoud Samir Fayed
The document provides examples for using the RingZip library to work with zip files in Ring programs. Example 1 shows how to create a zip file and add an entry with a file. Example 2 demonstrates adding multiple files to a zip. Example 3 extracts all files from a zip to a folder. Example 4 gets the file count in a zip. Example 5 lists all file names in a zip. The document also provides references for the Zip and ZipEntry classes and their methods.
This document discusses writeable common table expressions (CTEs) in PostgreSQL. It provides examples of how writeable CTEs can be used for partition management, query clustering, and transaction management. The document also briefly describes the process of adding support for writeable CTEs to PostgreSQL, including reworking the planner and executor to handle modified tables.
The document discusses programming code for buttons used to interact with a DataGridView in a Windows Forms application. It includes code for buttons to fill the DataGridView with sample data, clear the DataGridView, save new rows to the DataGridView, and select a row to populate textboxes. The code samples show how to add, clear, and retrieve data from the DataGridView through different button click events.
The document contains code snippets for calculating the area of different shapes like triangles and circles. It also includes code to calculate the sum of the first 50 natural numbers, simple rule of three calculations, displaying age based on input and calculating the sum of the first 100 odd numbers. The code uses Visual Basic syntax with keywords like Private Sub, End Sub, Val, If/Then statements.
This document contains the code for a basic calculator application. It includes:
- Private variables to store the current calculation result, saved number, operation, display string, and key indexes.
- Form loading code to center the form on screen.
- Key press and click event handlers to detect button clicks or key presses and perform the corresponding calculation operation.
- A Select Case structure to evaluate the operation and update the calculation result, saved number, and display string accordingly.
- Logic to handle decimal points, multiple operations, and error checking for invalid inputs like division by zero.
The code allows for basic arithmetic calculations like addition, subtraction, multiplication, and division to be performed by clicking buttons
This document provides an introduction to the Elixir programming language. It discusses what Elixir is, how to get started with installation and configuration of Elixir and Erlang, basic and compound data types in Elixir, functions and modules, and higher-order functions and comprehensions. Key topics covered include installing Elixir using ASDF, basic data types like integers, floats, atoms, and more, functions and anonymous functions, modules, and Enum functions like map, reduce, and comprehensions.
The document contains descriptions of creative challenges and solutions for advertising campaigns. Some of the challenges addressed include creating a print ad to promote an agency's creative potential, creating outdoor ads for a money transfer company and beer brand, and making Christmas cards for various clients. The proposed solutions generally involve playful, self-aware approaches that communicate the brands' messages in indirect, memorable ways.
This document discusses five things entrepreneurs must understand to successfully build a self-managing company. It begins by describing three types of entrepreneurs: survival entrepreneurs who have replaced working for others with self-employment; lifestyle entrepreneurs focused on achieving a certain lifestyle; and achievement entrepreneurs who see growth as fun. It emphasizes that achievement entrepreneurs are best positioned to create self-managing companies. It then discusses the importance of experience, a clear vision, focusing on strengths through delegation, and a willingness to learn from mistakes. The overall message is that successfully building a self-managing company requires the right mindset and a gradual process of increasing freedom and responsibility.
Storage Systems for High Scalable Systems Presentationandyman3000
Haytham ElFadeel presented on the limitations of traditional database systems and introduced key-value storage systems as a next generation storage solution. Traditional databases are complex, have poor performance, and do not scale well. In contrast, key-value storage systems have a simple data model of key-value pairs, are designed from the start to scale horizontally across many machines, and can provide much better performance. Examples of popular key-value storage systems discussed included Amazon Dynamo, Facebook Cassandra, Redis, and MongoDB.
The document provides information about an individual seeking a new sales or management position. Their background includes over 8 years of experience in sales management for a storage shed company, where they successfully implemented email marketing and auto-dialing programs. They also have experience managing CRM systems and as a sales manager for various technology companies. They are looking for a new opportunity to utilize their skills in sales, project management, customer service and business development.
This document provides room overviews for various corporate events that could take place at different locations within the MGM Grand facility in Las Vegas, including conference centers, ballrooms, arenas, and outdoor pool areas. Contact information is provided for the director of events, Lenny Talarico, to discuss planning corporate functions at MGM Grand.
This document contains 10 programming exercises in Gambas, a visual programming language. It includes exercises to calculate sums, find the largest of three numbers, validate ID numbers, calculate factorials, and export percentages. It also includes graphical user interface examples like a calculator application, clock, and random number guessing game. The exercises demonstrate basic programming concepts like variables, conditional statements, loops, and functions.
This document contains 10 programming exercises in Gambas, a visual programming language. The exercises cover basic concepts like variables, conditionals, loops, functions, objects, and graphical user interfaces. They include calculating sums, finding the largest of 3 numbers, validating ID numbers, calculating factorials, and creating a simple calculator application. The exercises demonstrate how to perform common programming tasks in Gambas.
This book is an example of programming code for making a shop order form in Microsoft Visual Basic (VB). If you need the compiled program, please PM me. Thank you.
This document contains summaries of multiple coding exercises completed by students Glenda Hurtado and David Saldaña at the Colegio Nacional Técnico "Arturo Borja". It includes exercises on basic math operations, functions, Fibonacci sequences, games, calculators, and trigonometric functions implemented in code. The exercises demonstrate skills in programming logic, variables, conditional statements, loops, and other basic programming concepts.
This document provides an overview of Eclipse Draw2D, which allows for graphical creation, editing, and manipulation. It describes key Draw2D components like LightweightSystem, EventDispatcher, and UpdateManager. It also covers common figure types, painting figures, different layout options, and how to connect figures using anchors, routers, and locators. The document concludes with instructions for practicing with Draw2D.
This document contains code snippets and descriptions for various programming tasks and examples in Gambas, including:
1) A timer program that counts seconds, minutes, and hours
2) A program to find the largest of three numbers
3) A program to calculate a verification digit for an ID number
4) Programs demonstrating functions, objects, graphics, and other programming concepts.
5) The document is authored by Kenny Loor and contains code examples in Spanish with comments and descriptions.
The Ring programming language version 1.5.3 book - Part 46 of 184Mahmoud Samir Fayed
This document provides examples for using the RingZip library to work with zip files in Ring programs. It shows how to create zip files, add and extract files, and get metadata. It also provides reference documentation for the Zip and ZipEntry classes, describing their methods.
The Ring programming language version 1.3 book - Part 36 of 88Mahmoud Samir Fayed
The document provides examples for using the RingZip library to work with zip files in Ring programs. Example 1 shows how to create a zip file and add an entry with a file. Example 2 demonstrates adding multiple files to a zip. Example 3 extracts all files from a zip to a folder. Example 4 gets the file count in a zip. Example 5 lists all file names in a zip. The document also provides references for the Zip and ZipEntry classes and their methods.
This document discusses writeable common table expressions (CTEs) in PostgreSQL. It provides examples of how writeable CTEs can be used for partition management, query clustering, and transaction management. The document also briefly describes the process of adding support for writeable CTEs to PostgreSQL, including reworking the planner and executor to handle modified tables.
The document discusses programming code for buttons used to interact with a DataGridView in a Windows Forms application. It includes code for buttons to fill the DataGridView with sample data, clear the DataGridView, save new rows to the DataGridView, and select a row to populate textboxes. The code samples show how to add, clear, and retrieve data from the DataGridView through different button click events.
The document contains code snippets for calculating the area of different shapes like triangles and circles. It also includes code to calculate the sum of the first 50 natural numbers, simple rule of three calculations, displaying age based on input and calculating the sum of the first 100 odd numbers. The code uses Visual Basic syntax with keywords like Private Sub, End Sub, Val, If/Then statements.
This document contains the code for a basic calculator application. It includes:
- Private variables to store the current calculation result, saved number, operation, display string, and key indexes.
- Form loading code to center the form on screen.
- Key press and click event handlers to detect button clicks or key presses and perform the corresponding calculation operation.
- A Select Case structure to evaluate the operation and update the calculation result, saved number, and display string accordingly.
- Logic to handle decimal points, multiple operations, and error checking for invalid inputs like division by zero.
The code allows for basic arithmetic calculations like addition, subtraction, multiplication, and division to be performed by clicking buttons
This document provides an introduction to the Elixir programming language. It discusses what Elixir is, how to get started with installation and configuration of Elixir and Erlang, basic and compound data types in Elixir, functions and modules, and higher-order functions and comprehensions. Key topics covered include installing Elixir using ASDF, basic data types like integers, floats, atoms, and more, functions and anonymous functions, modules, and Enum functions like map, reduce, and comprehensions.
The document contains descriptions of creative challenges and solutions for advertising campaigns. Some of the challenges addressed include creating a print ad to promote an agency's creative potential, creating outdoor ads for a money transfer company and beer brand, and making Christmas cards for various clients. The proposed solutions generally involve playful, self-aware approaches that communicate the brands' messages in indirect, memorable ways.
This document discusses five things entrepreneurs must understand to successfully build a self-managing company. It begins by describing three types of entrepreneurs: survival entrepreneurs who have replaced working for others with self-employment; lifestyle entrepreneurs focused on achieving a certain lifestyle; and achievement entrepreneurs who see growth as fun. It emphasizes that achievement entrepreneurs are best positioned to create self-managing companies. It then discusses the importance of experience, a clear vision, focusing on strengths through delegation, and a willingness to learn from mistakes. The overall message is that successfully building a self-managing company requires the right mindset and a gradual process of increasing freedom and responsibility.
Storage Systems for High Scalable Systems Presentationandyman3000
Haytham ElFadeel presented on the limitations of traditional database systems and introduced key-value storage systems as a next generation storage solution. Traditional databases are complex, have poor performance, and do not scale well. In contrast, key-value storage systems have a simple data model of key-value pairs, are designed from the start to scale horizontally across many machines, and can provide much better performance. Examples of popular key-value storage systems discussed included Amazon Dynamo, Facebook Cassandra, Redis, and MongoDB.
The document provides information about an individual seeking a new sales or management position. Their background includes over 8 years of experience in sales management for a storage shed company, where they successfully implemented email marketing and auto-dialing programs. They also have experience managing CRM systems and as a sales manager for various technology companies. They are looking for a new opportunity to utilize their skills in sales, project management, customer service and business development.
This document provides room overviews for various corporate events that could take place at different locations within the MGM Grand facility in Las Vegas, including conference centers, ballrooms, arenas, and outdoor pool areas. Contact information is provided for the director of events, Lenny Talarico, to discuss planning corporate functions at MGM Grand.
Drummond Public Relations is a Houston-based firm that specializes in combining traditional PR with online marketing. The document defines and compares PR, advertising, and marketing, noting that PR involves establishing favorable relationships with the public through unpaid announcements, advertising uses paid announcements, and marketing supports PR and advertising efforts. It then describes how DPR uses press releases to garner media coverage for clients and provides potential benefits of PR for businesses, products, and events.
Dokumen ini berisi jawaban untuk soal-soal matematika kertas 1 seri 1 yang disediakan oleh Program Gempur 5A untuk latihan UPSR. Terdapat serangkaian jawaban A, B, C, atau D untuk setiap soal tanpa penjelasan.
The document provides guidance on how to write an effective press release, including choosing a clear key idea, answering the basic journalistic questions of who, what, when, where and why or how, and properly formatting and distributing the release to local, regional or national media outlets in print, television or radio formats. It also offers tips for following up with media and determining appropriate topics that could be covered in a press release, such as a unique story, new product, event, office change or new hires.
The document discusses various types of database testing including data integrity testing, stored procedure testing, data type testing, data size testing, event driven testing, and input item verification. Data integrity testing ensures that changes to data, like updates, deletions, and insertions, properly update related entities. Stored procedure testing involves testing individual functions and validating modularity. Data type testing checks that data types match between developers and database administrators. Data size testing verifies performance with large amounts of data bypassing front-end validation. Event driven testing checks triggers and scheduled actions. And input item verification tests for proper data validation of user inputs.
The document discusses how people often complain about their circumstances but should consider how much worse others have it. It repeats the phrase "MUHAMMAD ATHAR JAMIL (PAKISTAN)" several times, suggesting it was written by Muhammad Athar Jamil and encourages the reader to be grateful for what they have by thinking of those less fortunate.
27&28 January 2010: Amsterdam, The Netherlands
Enterprise Social 2.0: Rip or ROI? This senior executive event will bring together decision makers from the Top Fortune companies to discuss innovative strategies on how to maximise business performance through social media engagement. The event will include keynote speeches, best-practice presentations as well as interactive discussion sessions.
The document discusses how journalism ethics have changed over time as new media has emerged. It notes that while objectivity is currently the norm, standards were more flexible in the past. It raises questions about how internet media may further impact journalism business and ethics, and how these changes should influence how journalism is taught. The document advocates preserving the best of traditional journalism training while adapting instruction to new media skills and embracing citizen journalism.
The document contains descriptions of 20 coding exercises in Spanish that demonstrate basic programming concepts like variables, conditionals, loops, functions, objects, and graphical user interfaces. The exercises cover topics such as: printing text, basic math operations, finding the maximum of 3 numbers, validating ID numbers, calculating factorials, Fibonacci sequences, creating and using classes, building a timer, random number games, and drawing shapes.
This document contains 10 programming exercises in Gambas, a visual programming language. The exercises cover basic concepts like variables, conditional statements, functions, objects and graphical user interfaces. Sample code is provided for tasks like calculating sums, finding the largest of three numbers, validating ID numbers, and creating a simple calculator application with buttons and a display screen. The exercises were created for a university-level programming course.
The document contains 18 programming exercises in Spanish with descriptions and code snippets. The exercises cover topics like:
1. Basic programming concepts like "Hello World" and variables.
2. Math operations like addition, finding the maximum of 3 numbers.
3. Functions, objects, and graphical user interfaces.
4. Exercises get more advanced covering things like Fibonacci series, vehicles as objects, and a basic calculator application.
This document contains code snippets and descriptions in Spanish related to programming in Gambas. It includes examples of creating a timer, finding the largest of three numbers, calculating export percentages, Fibonacci series, object-oriented programming with classes like Superhero and Vehicle, and basic graphical drawing. The document was created by Kenny Loor on November 12, 2009 and contains code examples for learning and practicing programming concepts in Gambas.
The document describes a calculator program created in GAMBAS. It defines variables to store numbers and operations, and includes subroutines for each button that appends numbers or performs calculations on the numbers stored in the variables when the equal button is pressed. The subroutines also convert numbers between binary, octal, and hexadecimal representations.
The document describes the code for a calculator program written in GAMBAS. It defines public variables to store operation numbers and values. It includes subroutines for each button click that append numbers or operate on values. The main operation subroutine uses a switch statement to perform calculations like addition, subtraction, multiplication, division, etc. based on the operation number stored. Additional subroutines convert values to binary, octal and hexadecimal formats.
The document describes the code for a calculator program written in GAMBAS. It defines public variables to store calculator operations and values. It includes subroutines for each button click that append numbers or operate on values. The main operation subroutine uses a switch statement to perform the calculation based on the operation selected and stores the result.
The document contains 20 Python programs with summaries and outputs. The programs cover topics like palindrome strings, removing odd numbers from lists, finding sums of list elements ending in 3, creating tuples from user input, stack operations, MySQL connectivity, binary file handling and more.
The document contains code for multiple programs including a screen protector program, calculator program, identification card validation program, lottery game program, and invoice program. The code defines variables and subroutines to handle events like button clicks and draws graphics.
The document contains code for multiple programs including a screen protector program, calculator program, identification card validation program, lottery game program, and invoice program. The code defines variables and subroutines to handle events like button clicks and draws graphics.
The document contains code for multiple programs including a screen protector program, calculator program, identification card validation program, lottery game program, and invoice program. The code defines variables and subroutines to handle events like button clicks and draws graphics.
The document discusses algorithms and flowcharts, explaining that an algorithm is a sequence of steps to solve a problem and a flowchart uses graphical representations to show the logic and sequence of operations in an algorithm. It provides examples of writing pseudocode algorithms for different problems and drawing corresponding flowcharts to visually depict the logic and flow of the algorithms.
The document discusses algorithms, flowcharts, and decision structures. It provides examples of writing pseudocode and algorithms to solve problems. It also explains how to represent algorithms visually using flowcharts. Key points include:
- An algorithm is a sequence of steps to solve a problem using a programming language.
- Pseudocode is an informal language similar to English used to develop algorithms.
- Flowcharts use symbols to represent program logic and the flow of data through a process.
- Decision structures like if-then-else statements allow programs to perform different actions based on conditional tests.
- Nested if statements allow multiple conditions to be checked sequentially.
The document discusses algorithms and flowcharts. It provides examples of writing pseudocode to represent algorithms, then refining the pseudocode into more detailed algorithms. It also explains how to represent algorithms visually using flowcharts. Various examples are given of writing algorithms and drawing corresponding flowcharts to solve problems like calculating student grades, converting between units of measurement, and finding the largest of three numbers. Decision structures like if-then-else statements and nested ifs are also covered.
The document summarizes key concepts in ABAP Chapter 2 including:
1) Report statements are used to define reports and control page formatting. Common statements include REPORT, TOP-OF-PAGE, and END-OF-PAGE.
2) WRITE, SKIP, and ULINE statements are used to create and format lists. The list buffer stores output until the end of processing.
3) Flow control statements like IF, CASE, DO, and WHILE control program flow. Logical and arithmetic expressions are used in conditions.
4) Character manipulation functions allow working with strings, dates, and other data types. Built-in functions provide useful calculations.
5) Event-driven programming uses events like TOP-
The document discusses algorithms and flowcharts, explaining that an algorithm is a sequence of steps to solve a problem and a flowchart uses symbols to represent the logic and flow of an algorithm. It provides examples of writing pseudocode algorithms for different problems and drawing corresponding flowcharts, including using decision structures like if-then-else and handling multiple conditions with nested if statements.
This document discusses algorithms, flowcharts, pseudocode, and decision structures. It begins by defining algorithms and their purpose in problem solving. It then explains flowchart symbols and how to represent algorithms visually using flowcharts. Several examples are provided of writing pseudocode, detailed algorithms, and corresponding flowcharts to solve problems. The document also covers decision structures like if-then-else statements and relational operators. It provides examples of algorithms using nested if statements. Finally, it presents an example of determining an employee bonus based on overtime worked and absences.
1. Gambas
Es un lenguaje de programacion libre derivado de Basic.Se
distribuye con licencia GNU GPL. Cabe destacar que presenta
ciertas similitudes con javas ya que en la ejecución de cualquier
aplicación, se requiere un conjunto de librerías interprete
previamente instaladas.
Permite crear formularios con botones de comandos, cuadros de
texto y muchos otros controles y enlazarlos a base de datos.
Lenguaje de programacion sencillo para plataformas libres (como
GNU/Linux y BSD).
Este ejemplo nos permite realizar una resta.
PUBLIC SUB Main()
DIM a AS Integer
DIM b, r AS Integer
a = 50
b = 20
r = a - b
PRINT "la resta es"
PRINT "r"
END
Este programa nos permite encontrar el total de quintales.
EL Ecuador exporta café, cacao y maiz.
PUBLIC SUB Main()
DIM A, c, fe, m, s, p1, p2, p3 AS Integer
PRINT "ingrese una cantidad"
INPUT A
INPUT c, fe, m
PRINT "lo que ingreso es.....", A
PRINT "ingrese la cantidad de cacao"
INPUT c
PRINT "ingrese la cantidad de café"
INPUT fe
PRINT "ingrese la cantidad de maiz"
INPUT m
s = c + fe + m
p1 = (c * 100) / s
p2 = (fe * 100) / s
p3 = (m * 100) / s
PRINT "el total de importaciones es"
PRINT "el quintal de cacao es", & srt(s) & "entre p1 y p3"
PRINT "el quintal de café es"
PRINT "el quintal de maiz es"
END
2. Este programa nos permite conoser que número es Mayor, Menor, y
Medio
PUBLIC SUB Main()
DIM a, b, c AS Integer
PRINT "Ingrese primer valor A:"
INPUT a
PRINT "Ingrese segundo valor B:"
INPUT b
PRINT "Ingrese tercer valor C:"
INPUT c
IF ((a > b) AND (a > c)) THEN
PRINT "Mayor", a
IF (b > c) THEN
PRINT "Medio", b
PRINT "Menor", c
ELSE
PRINT "Medio", c
PRINT "Menor", b
ENDIF
ENDIF
IF ((b > c) AND (b > a)) THEN
PRINT "Mayor", b
IF (a > c) THEN
PRINT "Medio", a
PRINT "Menor", c
ELSE
PRINT "Medio", c
PRINT "Menor", a
ENDIF
ENDIF
IF ((c > b) AND (c > a)) THEN
PRINT "Mayor", c
IF (b > a) THEN
PRINT "Medio", b
PRINT "Menor", a
ELSE
PRINT "Medio", a
PRINT "Menor", b
ENDIF
ENDIF
END
3. Este ejercicio nos permite ingresar los datos de un estudiante con
mucha facilidad.
PRIVATE Promedio AS String
PRIVATE FechaMatricula AS Date
PRIVATE Nombre AS String
PRIVATE Apellido AS String
PRIVATE Nota1 AS Single
PRIVATE nota2 AS Single
PRIVATE nota3 AS Single
PUBLIC SUB notaUno(numero AS Integer)
Nota1 = numero
END
PUBLIC SUB notaDos(numero AS Integer)
nota2 = numero
END
PUBLIC SUB notaTres(numero AS Integer)
nota3 = numero
END
PUBLIC FUNCTION PromedioFinal() AS Single
RETURN (nota1 + nota2 + nota3) / 3
END
PUBLIC FUNCTION fechama(fecha AS Date) AS Date
FechaMatricula = fecha
RETURN FechaMatricula
END
PUBLIC SUB PoneNombre(cadena AS String)
Nombre = cadena
END
PUBLIC SUB PoneApellido(cadena AS String)
Apellido = cadena
END
PUBLIC FUNCTION NombreCompleto() AS String
RETURN Nombre & "" & Apellido
END
4. LA CALCULADORA
Este es un programa que nos permite realizar las funciones de
una calculadora.
Gambas class file
PUBLIC ban AS Integer
PUBLIC aux1 AS Integer
PUBLIC aux2 AS Integer
PUBLIC SUB _new()
END
PUBLIC SUB button1_Click()
visor.Text = visor.Text & "1"
END
PUBLIC SUB Button4_Click()
visor.Text = visor.Text & "4"
END
5. PUBLIC SUB Button2_Click()
visor.Text = visor.Text & "2"
END
PUBLIC SUB Button3_Click()
visor.Text = visor.Text & "3"
END
PUBLIC SUB Button5_Click()
visor.Text = visor.Text & "5"
END
PUBLIC SUB Button6_Click()
visor.Text = visor.Text & "6"
END
PUBLIC SUB Button7_Click()
visor.Text = visor.Text & "7"
END
PUBLIC SUB Button8_Click()
visor.Text = visor.Text & "8"
END
PUBLIC SUB Button9_Click()
visor.Text = visor.Text & "9"
END
PUBLIC SUB Button10_Click()
visor.Text = visor.Text & "0"
6. END
PUBLIC SUB Button11_Click()
visor.Text = visor.Text & "."
END
PUBLIC SUB Button17_Click()
visor.Clear
END
PUBLIC SUB Button18_Click()
ME.Close
END
PUBLIC SUB Button13_Click()
ban = 1
IF visor.Text <> 0 THEN
aux1 = visor.Text
ELSE
aux1 = 0
ENDIF
visor.Clear
END
PUBLIC SUB Button14_Click()
ban = 2
IF visor.Text <> 0 THEN
aux1 = visor.Text
ELSE
aux1 = 0
ENDIF
visor.Clear
END
7. PUBLIC SUB Button15_Click()
ban = 3
IF visor.Text <> 0 THEN
aux1 = visor.Text
ELSE
aux1 = 0
ENDIF
visor.Clear
END
PUBLIC SUB Button16_Click()
ban = 4
IF visor.Text <> 0 THEN
aux1 = visor.Text
ELSE
aux1 = 0
ENDIF
visor.Clear
END
PUBLIC SUB Button20_Click()
IF visor.Text <> 0 THEN
aux2 = visor.Text
ELSE
aux2 = 0
ENDIF
visor.Text = operaciones(ban, aux1, aux2)
END
PUBLIC FUNCTION operaciones(opera AS Integer, v1 AS Integer, v2 AS
Integer) AS Integer
DIM respuesta AS Integer
SELECT CASE opera
CASE 1
respuesta = v1 + v2
CASE 2
respuesta = v1 - v2
CASE 3
respuesta = v1 * v2
CASE 4
8. respuesta = v1 / v2
END SELECT
RETURN respuesta
END
PUBLIC SUB Button31_Click()
DIM n, i, x1, x2 AS Integer
DIM cadena, cadena2 AS String
n = visor.Text
WHILE n > 0
x1 = (Int(n / 2))
x2 = n MOD 2
cadena = cadena & Str(x2)
n = x1
WEND
FOR i = Len(cadena) TO 1 STEP -1
cadena2 = cadena2 & Mid(cadena, i, 1)
NEXT
visor.Text = cadena2
Messsage("el resultado es.....", "aceptar")
END
PUBLIC SUB Button32_Click()
DIM n, x1, x2, j AS Integer
DIM cadena, cadena2 AS String
n = visor.text
WHILE n > 0
x1 = (Int(n / 8))
x2 = n MOD 8
cadena = cadena & Str(x2)
n = x1
WEND
FOR j = Len(cadena) TO 1 STEP -1
cadena2 = cadena2 & Mid(cadena, j, 1)
NEXT
visor.text = cadena2
END
9. PUBLIC SUB Button23_Click()
visor.text = Sin(visor.text)
END
PUBLIC SUB Button24_Click()
visor.text = Cos(visor.text)
END
PUBLIC SUB Button25_Click()
visor.text = Tan(visor.text)
END
PUBLIC SUB Button12_Click()
visor.text = visor.text * visor.text
END
PUBLIC SUB Button19_Click()
visor.text = visor.text * visor.text * visor.text
END
PUBLIC SUB Button33_Click()
DIM n, i, x1, x2 AS Integer
DIM cadena, cadena2 AS String
n = visor.Text
WHILE n > 0
x1 = (Int(n / 16))
x2 = n MOD 16
IF x2 < 10 THEN
cadena = cadena & Str(x2)
ELSE IF x2 = 10 THEN
cadena = cadena & "A"
ELSE IF X2 = 11 THEN
10. cadena = cadena & "B"
ELSE IF x2 = 12 THEN
cadena = cadena & "C"
ELSE IF X2 = 13 THEN
cadena = cadena & "D"
ELSE IF x2 = 14 THEN
cadena = cadena & "E"
ELSE IF X2 = 15 THEN
cadena = cadena & "F"
ENDIF
n = x1
WEND
FOR i = Len(cadena) TO 1 STEP -1
cadena2 = cadena2 & Mid(cadena, i, 1)
NEXT
visor.Text = cadena2
END
PUBLIC SUB Button21_Click()
END
PUBLIC SUB Button27_Click()
END
PUBLIC SUB Button28_Click()
END
11. Este ejemplo nos permite hacer el ingreso de productos como a su
vez nos permite visualizar el estandar de productos existentes en
nuestra base de datos.
Gambas class file
PUBLIC con AS Integer
PUBLIC fil AS Integer
PUBLIC col AS Integer
PUBLIC SUB Form_Open()
modulo.conectar
modulo.rs = modulo.cn.Exec("select * from producto")
mostrar()
END
PUBLIC SUB Button5_Click()
ME.Close
END
'guarda
PUBLIC SUB Button9_Click()
TRY modulo.cn.Exec("insert into producto values('" &
Trim(UCase(TextBox8.Text)) & "','" & Trim(UCase(TextBox7.Text)) &
"','" & (TextBox6.Text) & "','" & (ValueBox1.Text) & "');")
IF ERROR THEN
12. Message.Error("Imposible insertar el registro")
ELSE
Message.Info("Registro insertado")
END IF
modulo.rs = modulo.cn.Exec("Select * from producto")
mostrar()
desabilitar()
END
PUBLIC SUB desabilitar()
TextBox8.Enabled = FALSE
TextBox7.Enabled = FALSE
TextBox6.Enabled = FALSE
ValueBox1.Enabled = FALSE
END
PUBLIC SUB mostrar()
modulo.rs.MoveFirst
IF modulo.rs.Count > 0 THEN
Grid1.Columns.Count = 4
Grid1.Rows.Count = modulo.rs.Count + 1
Grid1.Columns[0].Width = 60
Grid1.Columns[1].Width = 180
Grid1.Columns[2].Width = 80
Grid1.Columns[3].Width = 80
Grid1[0, 0].Text = "Codigo"
Grid1[0, 1].Text = "Nombre"
Grid1[0, 2].Text = "Cantidad"
Grid1[0, 3].Text = "Precio Unitario"
fil = 1
modulo.rs.MoveFirst
'con = Modulo.rs.Count
DO WHILE modulo.rs.Available
Grid1[fil, 0].Text = modulo.rs["codigo"]
Grid1[fil, 1].Text = modulo.rs["nombre"]
Grid1[fil, 2].Text = modulo.rs["precio"]
Grid1[fil, 3].Text = modulo.rs["cantidad"]
fil = fil + 1
modulo.rs.MoveNext()
LOOP
ENDIF
END
13. PUBLIC SUB Button10_Click()
SELECT Message.Question("Desea eliminar un Producto", "Si", "No")
CASE 1
TRY modulo.cn.Exec("Delete from producto where codigo='" &
Trim(UCase(TextBox8.Text)) & "'")
IF ERROR THEN
Message.Error("Imposible borrar el registro")
ELSE
modulo.rs = modulo.cn.Exec("select * from producto")
mostrar()
END IF
CASE 2
Message.Info("Registro no eliminado")
CASE 3
END SELECT
'limpiar()
END
PUBLIC SUB Button11_Click()
TRY Modulo.cn.Exec("update producto set nombre='" &
Trim(UCase(TextBox7.Text)) & "',precio='" &
Trim(UCase(TextBox6.Text)) & "',cantidad='" &
Trim(UCase(ValueBox1.Text)) & "' where=textbox8.text ")
IF ERROR THEN
Message.Error("Imposible actualizar el registro")
ELSE
Message.Info("Registro actualizado")
END IF
mostrar
'LIMPIAR
END
PUBLIC SUB Button8_Click()
TextBox8.Clear
14. TextBox7.Clear
TextBox6.Clear
TextBox6.Text = 0
ValueBox1.Clear
abilitar()
END
PUBLIC SUB abilitar()
TextBox8.Enabled = TRUE
TextBox7.Enabled = TRUE
TextBox6.Enabled = TRUE
ValueBox1.Enabled = TRUE
END
PUBLIC SUB Grid1_Click()
IF Grid1.Current = NULL THEN RETURN
SELECT Message.Question("Desea eliminar un producto", "Si", "No",
"Ayuda")
CASE 1
TRY modulo.cn.Exec("Delete from producto where codigo='" &
Trim(UCase(Grid1.Current.Text)) & "'")
IF ERROR THEN
Message.Error("Imposible borrar el registro")
ELSE
modulo.rs = modulo.cn.Exec("select * from producto")
mostrar()
END IF
CASE 2
Message.Info("Registro no eliminado")
END SELECT
END
PUBLIC SUB Button7_Click()
DIM ban AS Integer
Modulo.rs = Modulo.cn.Exec("select * from producto")
DO WHILE Modulo.rs.Available
IF modulo.rs["codigo"] = Trim(UCase(TextBox8.Text)) THEN
Modulo.rs = Modulo.cn.Exec("select * from producto where codigo =
'" & Trim(UCase(TextBox8.Text)) & "'")
TextBox7.Text = Modulo.rs["nombre"]
15. TextBox6.Text = Modulo.rs["precio"]
ValueBox1.Value = Modulo.rs["cantidad"]
ban = 1
ENDIF
MODULO.rs.MoveNext()
LOOP
IF ban = 0 THEN
Message.Error("Registro Invalido")
'limpiar()
END IF
END
PUBLIC SUB Button1_Click()
ME.Close
END
PUBLIC SUB TextBox7_KeyPress()
IF Key.code = 65293 THEN
IF TextBox7.Text = "" THEN
Message.Info("iNGRESE NOMBRE DE PRODUCTO0...")
TextBox7.Select
ELSE
TextBox6.SetFocus
ENDIF
ENDIF
END
PUBLIC SUB TextBox6_KeyPress()
IF Key.code = 65293 THEN
IF TextBox6.Text = "" THEN
Message.Info("PRECIO DEL PRODUCTO0...")
TextBox6.Select
ELSE
ValueBox1.SetFocus
ENDIF
ENDIF
END
PUBLIC SUB ValueBox1_KeyPress()
16. IF Key.code = 65293 THEN
IF ValueBox1 = "" THEN
Message.Info("INGRESE CANTIDAD DEL PRODUCTO0...")
ValueBox1.Select
ELSE
TextBox8.SetFocus
ENDIF
ENDIF
END