The document discusses functions in C++. It defines functions as modules that can be called to break programs into smaller pieces, making code easier to design, build, debug and maintain. It provides examples of function definitions and calls. Functions take arguments, make copies of them, perform tasks, and return results. Function prototypes specify argument and return types. Well-designed programs use preexisting and new functions to organize and reuse code.
The document discusses user-defined functions in C++. It explains that functions help divide programs into smaller, more manageable pieces. Functions are defined with a return type, parameter list, and function body. Functions are called by name with arguments in parentheses. Parameters allow functions to access external information. Function prototypes specify the signature of the function. Functions can return values or be defined as void if they do not return anything.
The document discusses user-defined functions in C++. It explains that functions help divide programs into smaller, more manageable pieces. Functions are defined with a return type, parameter list, and function body. Functions can take arguments and return values. Function prototypes specify the function signature. Functions can be called by name and passed arguments. Global variables are accessible everywhere while local variables are only accessible within their function.
The document discusses user-defined functions in C++. It defines functions as modules that help develop and maintain large programs by breaking them into smaller pieces. Functions allow code reusability by defining blocks of code that can be invoked multiple times from different parts of a program. The document provides examples of function definitions, prototypes, calling functions by passing arguments, and defining functions that return values. It also discusses local variables, parameters, and built-in math library functions.
This document discusses functions, arrays, and structures in C++. It covers:
- Declaring and defining functions
- Passing arrays and structures as arguments to functions
- Returning arrays and structures from functions
- Using multidimensional arrays as function parameters
- Examples of functions that read/write arrays and structures
This document discusses arrays and functions. It covers various topics related to arrays including declaring and manipulating multidimensional arrays, array parameters in functions, and converting between array types. It also provides an overview of functions, describing them as subparts of a program for obtaining input, performing calculations, and displaying output. Examples are given throughout to demonstrate array and function concepts.
The document discusses procedural abstraction and predefined functions in computer programming. It provides examples of for loops and nested for loops to iterate through ranges of values. The for loop examples demonstrate how the initialization, boolean expression, and update components work together to execute the loop body. Tracing is used to step through multiple iterations of the for loops.
The document discusses classes and files in C++. It covers:
1) Classes in C++, including declaring classes, private, protected, and public members, and examples of classes.
2) Files in C++, including streams, reading from and writing to files, and the standard input/output streams.
3) Specific file classes in C++ - ifstream for input, ofstream for output, and fstream for both. It also covers opening files using the open() function.
The document discusses user-defined data types in C++ including defined constants (#define), defining own types (typedef), constants (const), enumerations (enum), scope of variables, and structures (struct). The key objectives are to understand how to create user-defined data types.
The document discusses user-defined functions in C++. It explains that functions help divide programs into smaller, more manageable pieces. Functions are defined with a return type, parameter list, and function body. Functions are called by name with arguments in parentheses. Parameters allow functions to access external information. Function prototypes specify the signature of the function. Functions can return values or be defined as void if they do not return anything.
The document discusses user-defined functions in C++. It explains that functions help divide programs into smaller, more manageable pieces. Functions are defined with a return type, parameter list, and function body. Functions can take arguments and return values. Function prototypes specify the function signature. Functions can be called by name and passed arguments. Global variables are accessible everywhere while local variables are only accessible within their function.
The document discusses user-defined functions in C++. It defines functions as modules that help develop and maintain large programs by breaking them into smaller pieces. Functions allow code reusability by defining blocks of code that can be invoked multiple times from different parts of a program. The document provides examples of function definitions, prototypes, calling functions by passing arguments, and defining functions that return values. It also discusses local variables, parameters, and built-in math library functions.
This document discusses functions, arrays, and structures in C++. It covers:
- Declaring and defining functions
- Passing arrays and structures as arguments to functions
- Returning arrays and structures from functions
- Using multidimensional arrays as function parameters
- Examples of functions that read/write arrays and structures
This document discusses arrays and functions. It covers various topics related to arrays including declaring and manipulating multidimensional arrays, array parameters in functions, and converting between array types. It also provides an overview of functions, describing them as subparts of a program for obtaining input, performing calculations, and displaying output. Examples are given throughout to demonstrate array and function concepts.
The document discusses procedural abstraction and predefined functions in computer programming. It provides examples of for loops and nested for loops to iterate through ranges of values. The for loop examples demonstrate how the initialization, boolean expression, and update components work together to execute the loop body. Tracing is used to step through multiple iterations of the for loops.
The document discusses classes and files in C++. It covers:
1) Classes in C++, including declaring classes, private, protected, and public members, and examples of classes.
2) Files in C++, including streams, reading from and writing to files, and the standard input/output streams.
3) Specific file classes in C++ - ifstream for input, ofstream for output, and fstream for both. It also covers opening files using the open() function.
The document discusses user-defined data types in C++ including defined constants (#define), defining own types (typedef), constants (const), enumerations (enum), scope of variables, and structures (struct). The key objectives are to understand how to create user-defined data types.
The document discusses arrays in C++ programming, including how to declare and initialize arrays, access array elements using indexes, and provides examples of programs that read user input into arrays, calculate sums of array elements, and print arrays in reverse order. It also explains common array sorting algorithms like selection and bubble sort and provides examples of their implementation.
The document discusses C++ strings and the string class. It covers string formats, the string class in the C++ standard library, string constructors, assigning and comparing strings, and input/output with strings using the insertion and extraction operators. It also covers using the getline function to read entire lines of input into string variables.
The document discusses arrays in C++. It explains one-dimensional and two-dimensional arrays, how to declare, initialize, and access elements of arrays. Key points include arrays storing a collection of like-typed data, being indexed starting from 0, initializing during declaration, and accessing two-dimensional array elements requiring row and column indices. Examples are provided to demonstrate array concepts.
A class that automates conversion from a C++ recursive function to an iterative function. It allow the recursive function to preserve its structure by reproducing the "call stack" on an std::stack. The examples use combinatorics to illustrate usage.
The document provides information about C++ aptitude and object-oriented programming (OOP) concepts. It contains sample C++ code snippets and questions with explanations to test understanding of topics like classes, inheritance, polymorphism, operator overloading, templates, and more.
This document discusses various Python functions concepts including defining simple functions, functions with arguments, default arguments, lambda functions, generators, and decorators. It provides examples of defining functions that take positional and keyword arguments, using lambda functions, creating generators using yield, and applying decorators to functions. Various introspection methods like type(), dir(), and callable() are also covered.
The document discusses Python functions. Some key points covered include:
- Functions are reusable blocks of code defined using the def keyword that can accept parameters and return values.
- To execute a function, it must be called by name with appropriate arguments.
- Functions can call themselves, which is known as recursion.
- Functions can have default, variable, and keyword parameters to provide flexibility in how they are called.
This document discusses the history and evolution of functional programming in Java, including lambda expressions and streams. It describes how lambda expressions allow passing behaviors as arguments to methods like normal data. This improves API design, opportunities for optimization, and code readability. Streams encourage a lazy, pipelined style and can execute operations in parallel. Functional idioms like immutability and pure functions help enforce correctness and isolation of side effects.
Pointer variables store memory addresses and can be used to indirectly access other variables. Pointers allow values to be passed by reference into functions rather than by value. Arrays can be accessed using pointers by treating the array name as a pointer to its first element. Dynamic memory allocation with new/delete operators allows pointers to reference variables in heap memory.
The document discusses pointers and dynamic memory allocation in C++. It explains that pointers store memory addresses and can be used to indirectly access variables. The new operator allocates dynamic memory from the heap at runtime and returns the memory address, which must be assigned to a pointer. The delete operator deallocates memory previously allocated with new. Dynamic arrays can be created at runtime using new[] and require delete[] to avoid memory leaks. Classes with dynamic memory need constructors to allocate memory and destructors to deallocate it.
The document discusses various Python data structures and modules for working with data structures efficiently. It covers the abc module for defining abstract base classes, the array module for efficient storage of homogeneous data, the bisect module for working with sorted lists, the collections module which provides high-performance container data types like deque and defaultdict, namedtuple for creating tuple subclasses with named fields, heapq for priority queue implementation, and itertools for functions generating efficient iterators.
Introduction to ad-3.4, an automatic differentiation library in Haskellnebuta
Haskellの自動微分ライブラリ Ad-3.4 の紹介(の試み) If you don't see 21 slides in this presentation, try this one (re-uploaded): http://www.slideshare.net/nebuta/130329-ad-by-ekmett
This document discusses functions in C programming. It covers defining and declaring functions, variable scope, parameter passing, inline functions, recursive functions, function arguments, and function applications. It provides examples of function definitions and calls using integers, strings, and arrays. It explains call by value, call by address, and call by reference parameter passing. It also discusses global, private, and static variables and using the scope resolution operator.
The document discusses user defined functions (UDFs) in VBA for Excel. It provides examples of sub procedures, functions, and how to create custom functions. UDFs allow users to define their own functions to perform calculations that may not be covered by existing functions. The examples demonstrate simple UDFs for calculating sums, factorials, and day of the week from a date. It also shows how UDFs can call other UDFs. The document provides guidance on writing UDFs and examples of using UDFs in Excel.
OOP and FP - Become a Better ProgrammerMario Fusco
The story of Simon, an experienced OOP Java developer, exposed to the new lambda features of JDK 8. His friend Mario, a long-bearded FP geek, will try to convince him that FP can help him develop more readable and maintainable code. A journey into the discovery of the main new feature - lambda expressions - of JDK 8
1. The document discusses functions in C++. It defines a function as a subprogram that performs a particular task and can be called by other functions.
2. It provides the basic syntax for a function, including the return type, function name, arguments, and function body.
3. It then gives examples of different types of functions - ones that do not return or accept arguments, ones that return a value, and ones that accept arguments. It also discusses calling functions from main.
The document discusses properties in Python classes. Properties allow accessing attributes through normal attribute syntax, while allowing custom behavior through getter and setter methods. This avoids directly accessing attributes and allows for validation in setters. Properties are defined using the @property and @setter decorators, providing a cleaner syntax than regular getter/setter methods. They behave like regular attributes but allow underlying method calls.
This document summarizes advanced JavaScript concepts including:
- Object-oriented inheritance patterns in JavaScript and trends toward avoiding new and emulating private members. Pseudo-classical inheritance is recommended for better performance.
- Exploiting JavaScript's support for functional programming with higher-order functions to allow functions as arguments and return values for more flexible programming.
- Common issues with asynchronous code in JavaScript and how promises can help address callbacks and synchronization.
- Common pitfalls to avoid with arrays, numbers, and typeof in JavaScript.
The document provides an overview of arrays in C++. It defines an array as a group of variables of the same data type. It explains how to declare, initialize, assign values to, and access elements in an array. Examples are given to demonstrate declaring integer and character arrays, initializing arrays, inputting and outputting array elements using for loops, and using arrays to represent strings by storing characters. The objective is to teach how to declare, initialize, use, insert values to, display values of, and sort arrays.
The document contains information about Tarandeep Kaur, including her name, section, and roll number. It then lists and describes various topics related to functions in C++, including definition of functions, function calling, function prototypes, void functions, local vs global variables, function overloading, and recursion. Examples are provided to illustrate function calling, passing arguments, return values, and differences between call by value and call by reference.
The document is a report on the topic of computer programming and utilization prepared by group C. It discusses functions, including the definition of a function, function examples, benefits of functions, function prototypes, function arguments, and recursion. It provides examples of math library functions, global and local variables, and external variables. It also includes examples of recursive functions to calculate factorials and the Fibonacci series recursively.
The document discusses arrays in C++ programming, including how to declare and initialize arrays, access array elements using indexes, and provides examples of programs that read user input into arrays, calculate sums of array elements, and print arrays in reverse order. It also explains common array sorting algorithms like selection and bubble sort and provides examples of their implementation.
The document discusses C++ strings and the string class. It covers string formats, the string class in the C++ standard library, string constructors, assigning and comparing strings, and input/output with strings using the insertion and extraction operators. It also covers using the getline function to read entire lines of input into string variables.
The document discusses arrays in C++. It explains one-dimensional and two-dimensional arrays, how to declare, initialize, and access elements of arrays. Key points include arrays storing a collection of like-typed data, being indexed starting from 0, initializing during declaration, and accessing two-dimensional array elements requiring row and column indices. Examples are provided to demonstrate array concepts.
A class that automates conversion from a C++ recursive function to an iterative function. It allow the recursive function to preserve its structure by reproducing the "call stack" on an std::stack. The examples use combinatorics to illustrate usage.
The document provides information about C++ aptitude and object-oriented programming (OOP) concepts. It contains sample C++ code snippets and questions with explanations to test understanding of topics like classes, inheritance, polymorphism, operator overloading, templates, and more.
This document discusses various Python functions concepts including defining simple functions, functions with arguments, default arguments, lambda functions, generators, and decorators. It provides examples of defining functions that take positional and keyword arguments, using lambda functions, creating generators using yield, and applying decorators to functions. Various introspection methods like type(), dir(), and callable() are also covered.
The document discusses Python functions. Some key points covered include:
- Functions are reusable blocks of code defined using the def keyword that can accept parameters and return values.
- To execute a function, it must be called by name with appropriate arguments.
- Functions can call themselves, which is known as recursion.
- Functions can have default, variable, and keyword parameters to provide flexibility in how they are called.
This document discusses the history and evolution of functional programming in Java, including lambda expressions and streams. It describes how lambda expressions allow passing behaviors as arguments to methods like normal data. This improves API design, opportunities for optimization, and code readability. Streams encourage a lazy, pipelined style and can execute operations in parallel. Functional idioms like immutability and pure functions help enforce correctness and isolation of side effects.
Pointer variables store memory addresses and can be used to indirectly access other variables. Pointers allow values to be passed by reference into functions rather than by value. Arrays can be accessed using pointers by treating the array name as a pointer to its first element. Dynamic memory allocation with new/delete operators allows pointers to reference variables in heap memory.
The document discusses pointers and dynamic memory allocation in C++. It explains that pointers store memory addresses and can be used to indirectly access variables. The new operator allocates dynamic memory from the heap at runtime and returns the memory address, which must be assigned to a pointer. The delete operator deallocates memory previously allocated with new. Dynamic arrays can be created at runtime using new[] and require delete[] to avoid memory leaks. Classes with dynamic memory need constructors to allocate memory and destructors to deallocate it.
The document discusses various Python data structures and modules for working with data structures efficiently. It covers the abc module for defining abstract base classes, the array module for efficient storage of homogeneous data, the bisect module for working with sorted lists, the collections module which provides high-performance container data types like deque and defaultdict, namedtuple for creating tuple subclasses with named fields, heapq for priority queue implementation, and itertools for functions generating efficient iterators.
Introduction to ad-3.4, an automatic differentiation library in Haskellnebuta
Haskellの自動微分ライブラリ Ad-3.4 の紹介(の試み) If you don't see 21 slides in this presentation, try this one (re-uploaded): http://www.slideshare.net/nebuta/130329-ad-by-ekmett
This document discusses functions in C programming. It covers defining and declaring functions, variable scope, parameter passing, inline functions, recursive functions, function arguments, and function applications. It provides examples of function definitions and calls using integers, strings, and arrays. It explains call by value, call by address, and call by reference parameter passing. It also discusses global, private, and static variables and using the scope resolution operator.
The document discusses user defined functions (UDFs) in VBA for Excel. It provides examples of sub procedures, functions, and how to create custom functions. UDFs allow users to define their own functions to perform calculations that may not be covered by existing functions. The examples demonstrate simple UDFs for calculating sums, factorials, and day of the week from a date. It also shows how UDFs can call other UDFs. The document provides guidance on writing UDFs and examples of using UDFs in Excel.
OOP and FP - Become a Better ProgrammerMario Fusco
The story of Simon, an experienced OOP Java developer, exposed to the new lambda features of JDK 8. His friend Mario, a long-bearded FP geek, will try to convince him that FP can help him develop more readable and maintainable code. A journey into the discovery of the main new feature - lambda expressions - of JDK 8
1. The document discusses functions in C++. It defines a function as a subprogram that performs a particular task and can be called by other functions.
2. It provides the basic syntax for a function, including the return type, function name, arguments, and function body.
3. It then gives examples of different types of functions - ones that do not return or accept arguments, ones that return a value, and ones that accept arguments. It also discusses calling functions from main.
The document discusses properties in Python classes. Properties allow accessing attributes through normal attribute syntax, while allowing custom behavior through getter and setter methods. This avoids directly accessing attributes and allows for validation in setters. Properties are defined using the @property and @setter decorators, providing a cleaner syntax than regular getter/setter methods. They behave like regular attributes but allow underlying method calls.
This document summarizes advanced JavaScript concepts including:
- Object-oriented inheritance patterns in JavaScript and trends toward avoiding new and emulating private members. Pseudo-classical inheritance is recommended for better performance.
- Exploiting JavaScript's support for functional programming with higher-order functions to allow functions as arguments and return values for more flexible programming.
- Common issues with asynchronous code in JavaScript and how promises can help address callbacks and synchronization.
- Common pitfalls to avoid with arrays, numbers, and typeof in JavaScript.
The document provides an overview of arrays in C++. It defines an array as a group of variables of the same data type. It explains how to declare, initialize, assign values to, and access elements in an array. Examples are given to demonstrate declaring integer and character arrays, initializing arrays, inputting and outputting array elements using for loops, and using arrays to represent strings by storing characters. The objective is to teach how to declare, initialize, use, insert values to, display values of, and sort arrays.
The document contains information about Tarandeep Kaur, including her name, section, and roll number. It then lists and describes various topics related to functions in C++, including definition of functions, function calling, function prototypes, void functions, local vs global variables, function overloading, and recursion. Examples are provided to illustrate function calling, passing arguments, return values, and differences between call by value and call by reference.
The document is a report on the topic of computer programming and utilization prepared by group C. It discusses functions, including the definition of a function, function examples, benefits of functions, function prototypes, function arguments, and recursion. It provides examples of math library functions, global and local variables, and external variables. It also includes examples of recursive functions to calculate factorials and the Fibonacci series recursively.
This document discusses first-class functions and lambda calculus. It begins with an overview of Alonzo Church and the origins of lambda calculus. It then covers first-class functions in JavaScript, functions as objects in Java, and first-class functions in Scala. The document also discusses generic higher-order functions and control abstraction.
The document discusses functions in C++. It defines functions as modular pieces that divide programs into more manageable components. It describes function components like modules, functions, classes, and function calls. It provides examples of math library functions and how to define, call, and prototype functions. It also covers function parameters, return types, and scope rules for local variables and storage classes.
This document outlines a chapter about functions in C programming. It discusses how functions allow programs to be modularized by breaking them into smaller pieces called modules. Functions can be user-defined or come from standard libraries. Functions take parameters as input, perform operations, and return output. Functions allow for abstraction, reusability, and avoidance of code repetition. The chapter covers defining functions, function prototypes, parameters, return values, and calling functions. It also provides examples of commonly used math library functions.
Functions are reusable blocks of code that perform a specific task. They help reduce complexity, improve reusability and maintainability of code. There are built-in functions predefined in modules and user-defined functions. Built-in functions include type conversion, math operations etc. User-defined functions are created using the def keyword and defined with a name, parameters and indented block of code. Functions are called by their name with actual parameters. This transfers program control to the function block, executes code, then returns control to calling block.
The document discusses functions in C++. It begins by outlining key topics about functions that will be covered, such as function definitions, standard library functions, and function calls. It then provides details on defining and calling functions, including specifying return types, parameters, function prototypes, scope rules, and passing arguments by value or reference. The document also discusses local and global variables, function errors, and the differences between calling functions by value or reference.
First part of this presentation explains basics and advantages of using functional programming approaches with lambda calculus.
Second part of this presentation explains how can we use lambda calculus in C# 3.0
The document discusses functions in C++. It defines a function as a block of code that performs a specific task. There are two types of functions: built-in functions provided by the language and user-defined functions created by the programmer. The components of a function include the function header, body, parameters, return type, local variables, and return statement. Functions can pass arguments either by value or by reference. The document provides examples of built-in and user-defined functions as well as examples demonstrating call by value and call by reference.
Part 3-functions1-120315220356-phpapp01Abdul Samee
The document provides information about functions in C++. It defines what a function is, how functions are called and defined. It discusses function parameters, return types, and function prototypes. It covers local and global variables, call by value vs call by reference, and recursion. It also discusses function overloading, where multiple functions can have the same name but different parameters.
This document outlines the contents of Chapter 3 - Functions from a C++ textbook. It discusses key concepts about functions including defining and calling functions, function parameters and return values, function prototypes, header files, and random number generation using functions. Example code is provided to demonstrate creating, calling, and using functions to perform tasks like calculating squares, finding maximums, and simulating dice rolls.
User-defined functions allow programmers to break programs into smaller, reusable parts. There are two types of functions: built-in functions that are predefined in C like printf() and user-defined functions created by the programmer. A function is defined with a return type, name, and parameters. Functions can call other functions and be called from main or other functions. Parameters can be passed by value, where the value is copied, or by reference, where the address is passed so changes to the parameter are reflected in the caller. Functions allow for modularity and code reuse.
This document summarizes two projects that aim to optimize Python performance: the AST optimizer and register-based bytecode. The AST optimizer rewrites Python abstract syntax trees to enable more optimizations than CPython's peephole optimizer. It aims to improve performance by constant folding, loop optimizations, and other transformations. The register-based bytecode project rewrites CPython's stack-based bytecode to use registers, enabling additional optimizations like common subexpression elimination and constant/attribute deduplication. Both projects showed speedups over CPython in benchmarks, but may not translate to all real applications. The document provides details on each project's approach and goals.
This document discusses functions in MATLAB. It defines a function as a group of statements that perform a task and can accept inputs and produce outputs. Functions provide reusable code and can accept multiple input arguments and return multiple output arguments. There are built-in MATLAB functions and user-defined functions. Built-in functions include basic math, trigonometric, data analysis, and other functions. User-defined functions are created by the user and must have the same name as the file. They are defined using the function keyword and can return single or multiple outputs. Functions are called from the command window by specifying their name and valid inputs.
Functions allow programmers to organize and reuse code. There are three types of functions: built-in functions, modules, and user-defined functions. User-defined functions are created using the def keyword and can take parameters and arguments. Functions can return values and have different scopes depending on if a variable is local or global. Recursion is when a function calls itself, and is useful for breaking down complex problems into simpler sub-problems. Common recursive functions calculate factorials, Fibonacci numbers, and generate the Pascal's triangle.
The Ring programming language version 1.5.3 book - Part 21 of 184Mahmoud Samir Fayed
This document discusses functions in Ring programming language. It covers defining functions, calling functions, declaring parameters, sending parameters to functions, using main functions, variable scope, returning values from functions, and recursion. Functions can be defined using func, def, or simply by name depending on the style. Parameters are declared within the function definition. The main function is optional and acts as the entry point if present. Variables can be global or local depending on whether they are defined inside or outside of functions. Functions can return values or end execution without returning values. Recursion is supported by allowing functions to call themselves.
This document discusses functions in C programming. It defines a function as a program segment that carries out a specific task. Functions allow programs to be developed in a modular way by dividing the program into reusable pieces. Functions can take parameters as input and return a value. Parameters are passed by value. Local variables declared within a function only exist for the duration of the function call. The document provides examples of defining, calling, and using return values from functions.
This document discusses functions in C programming. It defines a function as a program segment that carries out a specific task. Functions allow programs to be developed in a modular way by dividing the program into reusable pieces. Functions can take parameters as input and return a value. The key aspects covered include defining functions with a return type, parameters, and body, calling functions by passing actual parameters, and the scope of variables. Examples are provided to illustrate function definition, calling, parameters, return values, and recursion.
This document provides an outline and overview of functions in C++. It discusses:
- The definition of a function as a block of code that performs a specific task and can be called from other parts of the program.
- The standard library that is included in C++ and provides useful tools like containers, iterators, algorithms and more.
- The parts of a function definition including the return type, name, parameters, and body.
- How to declare functions, call functions by passing arguments, and how arguments are handled.
- Scope rules for local and global variables as they relate to functions.
The Ring programming language version 1.7 book - Part 24 of 196Mahmoud Samir Fayed
This document provides documentation on functions in Ring programming language. It discusses defining and calling functions, declaring parameters, using main functions, variable scope, return values, and recursion. Functions are defined using func, def, or func keywords followed by the function name and parameters. Parameters are passed within parentheses when calling a function. Variables inside functions are local, while those outside are global. Functions can return values using the return statement. Recursion allows a function to call itself, passing different parameters each time.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
Walmart Business+ and Spark Good for Nonprofits.pdfTechSoup
"Learn about all the ways Walmart supports nonprofit organizations.
You will hear from Liz Willett, the Head of Nonprofits, and hear about what Walmart is doing to help nonprofits, including Walmart Business and Spark Good. Walmart Business+ is a new offer for nonprofits that offers discounts and also streamlines nonprofits order and expense tracking, saving time and money.
The webinar may also give some examples on how nonprofits can best leverage Walmart Business+.
The event will cover the following::
Walmart Business + (https://business.walmart.com/plus) is a new shopping experience for nonprofits, schools, and local business customers that connects an exclusive online shopping experience to stores. Benefits include free delivery and shipping, a 'Spend Analytics” feature, special discounts, deals and tax-exempt shopping.
Special TechSoup offer for a free 180 days membership, and up to $150 in discounts on eligible orders.
Spark Good (walmart.com/sparkgood) is a charitable platform that enables nonprofits to receive donations directly from customers and associates.
Answers about how you can do more with Walmart!"
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxEduSkills OECD
Iván Bornacelly, Policy Analyst at the OECD Centre for Skills, OECD, presents at the webinar 'Tackling job market gaps with a skills-first approach' on 12 June 2024
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
Chapter wise All Notes of First year Basic Civil Engineering.pptxDenish Jangid
Chapter wise All Notes of First year Basic Civil Engineering
Syllabus
Chapter-1
Introduction to objective, scope and outcome the subject
Chapter 2
Introduction: Scope and Specialization of Civil Engineering, Role of civil Engineer in Society, Impact of infrastructural development on economy of country.
Chapter 3
Surveying: Object Principles & Types of Surveying; Site Plans, Plans & Maps; Scales & Unit of different Measurements.
Linear Measurements: Instruments used. Linear Measurement by Tape, Ranging out Survey Lines and overcoming Obstructions; Measurements on sloping ground; Tape corrections, conventional symbols. Angular Measurements: Instruments used; Introduction to Compass Surveying, Bearings and Longitude & Latitude of a Line, Introduction to total station.
Levelling: Instrument used Object of levelling, Methods of levelling in brief, and Contour maps.
Chapter 4
Buildings: Selection of site for Buildings, Layout of Building Plan, Types of buildings, Plinth area, carpet area, floor space index, Introduction to building byelaws, concept of sun light & ventilation. Components of Buildings & their functions, Basic concept of R.C.C., Introduction to types of foundation
Chapter 5
Transportation: Introduction to Transportation Engineering; Traffic and Road Safety: Types and Characteristics of Various Modes of Transportation; Various Road Traffic Signs, Causes of Accidents and Road Safety Measures.
Chapter 6
Environmental Engineering: Environmental Pollution, Environmental Acts and Regulations, Functional Concepts of Ecology, Basics of Species, Biodiversity, Ecosystem, Hydrological Cycle; Chemical Cycles: Carbon, Nitrogen & Phosphorus; Energy Flow in Ecosystems.
Water Pollution: Water Quality standards, Introduction to Treatment & Disposal of Waste Water. Reuse and Saving of Water, Rain Water Harvesting. Solid Waste Management: Classification of Solid Waste, Collection, Transportation and Disposal of Solid. Recycling of Solid Waste: Energy Recovery, Sanitary Landfill, On-Site Sanitation. Air & Noise Pollution: Primary and Secondary air pollutants, Harmful effects of Air Pollution, Control of Air Pollution. . Noise Pollution Harmful Effects of noise pollution, control of noise pollution, Global warming & Climate Change, Ozone depletion, Greenhouse effect
Text Books:
1. Palancharmy, Basic Civil Engineering, McGraw Hill publishers.
2. Satheesh Gopi, Basic Civil Engineering, Pearson Publishers.
3. Ketki Rangwala Dalal, Essentials of Civil Engineering, Charotar Publishing House.
4. BCP, Surveying volume 1
Leveraging Generative AI to Drive Nonprofit InnovationTechSoup
In this webinar, participants learned how to utilize Generative AI to streamline operations and elevate member engagement. Amazon Web Service experts provided a customer specific use cases and dived into low/no-code tools that are quick and easy to deploy through Amazon Web Service (AWS.)
Pengantar Penggunaan Flutter - Dart programming language1.pptx
User defined functions
1. Introduction
Function Definition
Void function
Global Vs Local variables
Random Number Generator
Recursion
Function Overloading
Sample Code
2. Experience has shown that the best way to develop and maintain large
programs is to construct it from smaller pieces(Modules)
This technique Called “Divide and Conquer”
Bad Development Approach Wise Development Approach
main()
main() •Easer To {
{ -----
----- Design ----
----- Build }
----- Debug
----- Extend function f1()
. Modify {
. Understand ---
. Reuse ---
---- Better Organization }
-----
----- function f2()
Return 0; {
} ---
---
}
3. In FORTRAN Modules Known as Subprograms
In Pascal Modules known as Procedures &
Functions
In C++ Modules Known as Functions & Classes
Programs use new and “prepackaged” modules
New: programmer-defined functions and classes
Prepackaged: from the standard library
4. Functions invoked by a function–call-statement which consist of it’s
name and information it needs (arguments)
Boss To Worker Analogy
A Boss (the calling/caller function) asks a worker (the called
function) to perform a task and return result when it is done.
Boss
Main
Worker
Worker Worker
Function Z
Function A Function B
Worker Worker
Note: usual main( ) Calls other
Function B1 Function B2 functions, but other functions
can call each other
5. • Functions called by writing
functionName (argument);
or
functionName(argument1, argument2, …);
• Example
cout << sqrt( 900.0 );
• sqrt (square root) function
• The preceding statement would print 30
• All functions in math library return a double
Function Arguments can be:
- Constant sqrt(9);
- Variable sqrt(x);
- Expression sqrt( x*9 + y) ;
sqrt( sqrt(x) ) ;
6. • Calling/invoking a function
– sqrt(x);
– Parentheses an operator used to call function
• Pass argument x
• Function gets its own copy of arguments
– After finished, passes back result
Function Name argument Output
3
cout<< sqrt(9);
Parentheses used to enclose argument(s)
7. Math Library Functions Revisited
Method Description Example
ceil( x ) rounds x to the smallest integer ceil( 9.2 ) is 10.0
not less than x ceil( -9.8 ) is -9.0
cos( x ) trigonometric cosine of x cos( 0.0 ) is 1.0
(x in radians)
exp( x ) exponential function ex exp( 1.0 ) is 2.71828
exp( 2.0 ) is 7.38906
fabs( x ) absolute value of x fabs( 5.1 ) is 5.1
fabs( 0.0 ) is 0.0
fabs( -8.76 ) is 8.76
floor( x ) rounds x to the largest integer floor( 9.2 ) is 9.0
not greater than x floor( -9.8 ) is -10.0
fmod( x, y ) remainder of x/y as a floating- fmod( 13.657, 2.333 ) is 1.992
point number
log( x ) natural logarithm of x (base e) log( 2.718282 ) is 1.0
log( 7.389056 ) is 2.0
log10( x ) logarithm of x (base 10) log10( 10.0 ) is 1.0
log10( 100.0 ) is 2.0
pow( x, y ) x raised to power y (xy) pow( 2, 7 ) is 128
pow( 9, .5 ) is 3
sin( x ) trigonometric sine of x sin( 0.0 ) is 0
(x in radians)
sqrt( x ) square root of x sqrt( 900.0 ) is 30.0
sqrt( 9.0 ) is 3.0
tan( x ) trigonometric tangent of x tan( 0.0 ) is 0
(x in radians)
Fig. 3.2 Math library functions.
8. Functions
Modularize a program
Software reusability
Call function multiple times
Local variables
Known only in the function in which they are defined
All variables declared in function definitions are local variables
Parameters
Local variables passed to function when called
Provide outside information
9. Function prototype
Tells compiler argument type and return type of function
int square( int );
Function takes an int and returns an int
Explained in more detail later
Calling/invoking a function
square(x);
Parentheses an operator used to call function
Pass argument x
Function gets its own copy of arguments
After finished, passes back result
10. Syntax format for function definition
returned-value-type function-name (parameter-list)
{
Declarations of local variables and Statements
}
Parameter list
Comma separated list of arguments
Data type needed for each argument
If no arguments, use void or leave blank
Return-value-type
Data type of result returned (use void if nothing
returned)
11. Example function
int square( int y )
{
return y * y;
}
return keyword
Returns data, and control goes to function’s
caller
If no data to return, use return;
Function ends when reaches right brace
Control goes to caller
Functions cannot be defined inside other functions
12. // Creating and using a programmer-defined function.
#include <iostream.h>
Function prototype: specifies
int square( int ); // function prototype data types of arguments and
return values. square
int main()
expects an int, and returns
{
an int.
// loop 10 times and calculate and output
// square of x each time
for ( int x = 1; x <= 10; x++ )
cout << square( x ) << " "; // function call
Parentheses () cause function to be called.
cout << endl;
When done, it returns the result.
return 0; // indicates successful termination
} // end main
// square function definition returns square of an integer
int square( int y ) // y is a copy of argument to function
{
return y * y; // returns square of y as an int
Definition of square. y is a
copy of the argument passed.
} // end function square Returns y * y, or y squared.
1 4 9 16 25 36 49 64 81 100
13. #include<iostream.h>
int square(int); // prototype Output
int cube(int); // prototype 1 square=1
main() 1 cube=1
{ int i; 2 square=4
for (int i=1;i<=10;i++){ 2 cube=8
.
.
cout<< i<< “square=“ << square(i) << endl;
.
cout<< i<< “cube=“ <<cube(i) << endl; .
} // end for 10 square=100
return 0; 10 cube=1000
} // end main function
int square(int y) //function definition
{
return y*y; // returned Result
}
int cube(int y) //function definition
{
return y*y*y; // returned Result
}
14. // Finding the maximum of three floating-point (real) numbers.
#include <iostream.h>
double maximum( double, double, double ); // function prototype
int main()
{
double number1, number2;
double number3; Function maximum takes 3
arguments (all double) and
cout << "Enter three real numbers: "; returns a double.
cin >> number1 >> number2 >> number3;
// number1, number2 and number3 are arguments to the maximum function call
cout << "Maximum is: "
<< maximum( number1, number2, number3 ) << endl;
return 0; // indicates successful termination
} // end main
// function maximum definition. x, y and z are parameters
double maximum( double x, double y, double z )
{
double max = x; // assume x is largest Enter three real numbers: 99.32 37.3 27.1928
if ( y > max ) // if y is larger, Maximum is: 99.32
max = y; // assign y to max
Enter three real numbers: 1.1 3.333 2.22
if ( z > max ) // if z is larger,
Maximum is: 3.333
max = z; // assign z to max
return max; // max is largest value
} // end function maximum
15. Function prototype contains
Function name
Parameters (number and data type)
Return type (void if returns nothing)
Only needed if function definition after
function call
Prototype must match function definition
Function prototype
double maximum( double, double, double );
Definition
double maximum( double x, double y, double
z )
{
…
}
16. If the Function does not RETURN result, it is called void Function
#include<iostream.h>
void add2Nums(int,int);
main()
{ int a, b;
cout<<“enter tow Number:”;
cin >>a >> b;
add2Nums(a, b)
return 0;
}
void add2Nums(int x, int y)
{
cout<< x<< “+” << y << “=“ << x+y;
}
17. If the function Does Not Take Arguments specify this with EMPT Y-LIST OR
write void inside
#include<iostream.h>
void funA();
void funB(void)
main()
{ Will be the same
funA(); in all cases
funB();
return 0;
}
void funA()
{
cout << “Function-A takes no arqumentsn”;
}
void funB()
{
cout << “Also Function-B takes No argumentsn”;
}
18. Local variables
Known only in the function in which they are
defined
All variables declared inside a function are local
variables
Parameters
Local variables passed to function when called (passing-
parameters)
Variables defined outside and before function main:
Called global variables
Can be accessible and used anywhere in the entire
program
19. Omitting the type of returned result defaults to int, but
omitting a non-integer type is a Syntax Error
If a Global variable defined again as a local variable in a
function, then the Local-definition overrides the Global
defining
Function prototype, function definition, and function call
must be consistent in:
1- Number of arguments
2- Type of those arguments
3-Order of those arguments
20. #include<iostream.h>
int x,y; //Global Variables
int add2(int, int); //prototype
main()
{ int s;
x = 11;
y = 22;
cout << “global x=” << x << endl;
cout << “Global y=” << y << endl;
s = add2(x, y);
cout << x << “+” << y << “=“ << s;
cout<<endl;
cout<<“n---end of output---n”;
return 0;
} global x=11
int add2(int x1,int y1)
{ int x; //local variables global y=22
x=44; Local x=44
cout << “nLocal x=” << x << endl; 11+22=33
return x1+y1;
}
---end of output---
21. int sum(int x, int y)
{
int result;
result = x+y;
}
this function must return an integer value as indicated in the header
definition (return result;) should be added
----------------------------------------------------------------------------------------
-
int sum (int n)
{ if (n==0)
return 0;
else
n+sum(n-1);
}
the result of n+sum(n-1) is not returned; sum returns an improper
result, the else part should be written as:-
else return n+sum(n-1);
22. void f(float a);
{
float a;
cout<<a<<endl;
}
; found after function definition header.
redefining the parameter a in the function
void f(float a)
{
float a2 = a + 8.9;
cout <<a2<<endl;
}
23. void product(void)
{
int a, b, c, result;
cout << “enter three integers:”;
cin >> a >> b >> c;
result = a*b*c;
cout << “Result is” << result;
return result;
}
According to the definition it should not return a value , but in the block (body) it
did & this is WRONG.
Remove return Result;
24. Call by value
• A copy of the value is passed
Call by reference
• The caller passes the address of the value
Call by value
Up to this point all the calls we have seen are call-by-value, a copy
of the value (known) is passed from the caller-function to the called-
function
Any change to the copy does not affect the original value in the
caller function
Advantages, prevents side effect, resulting in reliable software
25. Call By Reference
We introduce reference-parameter, to perform call by reference. The caller
gives the called function the ability to directly access the caller’s value, and to
modify it.
A reference parameter is an alias for it’s corresponding argument, it is stated in
c++ by “flow the parameter’s type” in the function prototype by an
ampersand(&) also in the function definition-header.
Advantage: performance issue
void function_name (type &);// prototype
main()
{
-----
------
}
void function_name(type ¶meter_name)
26. #include<iostream.h>
int squareVal(int); //prototype call by value function
void squareRef(int &); // prototype call by –reference function
int main()
{ int x=2; z=4;
cout<< “x=“ << x << “before calling squareVal”;
cout << “n” << squareVal(x) << “n”; // call by value
cout<< “x=“ << x << “After returning”
cout<< “z=“ << z << “before calling squareRef”;
squareRef(z); // call by reference
cout<< “z=“ << z<< “After returning squareRef”
return 0;
} x=2 before calling squareVal
int squareVal(int a) 4
{ x=2 after returning
return a*=a; // caller’s argument not modified z=4 before calling squareRef
} z=16 after returning squareRef
void squarRef(int &cRef)
{
cRef *= cRef; // caller’s argument modified
}
27. rand function generates an integer between 0 and RAND-
MAX(~32767) a symbolic constant defined in <stdlib.h>
You may use modulus operator (%) to generate numbers within a
specifically range with rand.
//generate 10 random numbers open-range
int x;
for( int i=0; i<=10; i++){
x=rand();
cout<<x<<“ “;
}
-------------------------------------------------------
//generate 10 integers between 0……..49
int x;
for( int i=0; i<10; i++){
x=rand()%50;
cout<<x<<“ “;
}
28. //generate 10 integers between 5…15
int x;
for ( int i=1; i<=10; i++){
x= rand()%11 + 5;
cout<<x<<“ “;
}
------------------------------------
//generate 100 number as simulation of rolling a
dice
int x;
for (int i=1; i<=100; i++){
x= rand%6 + 1;
cout<<x<<“ “;
}
29. the rand( ) function will generate the same set of random
numbers each time you run the program .
To force NEW set of random numbers with each new run
use the randomizing process
Randomizing is accomplished with the standard library
function srand(unsigned integer); which needs a
header file <stdlib.h>
Explanation of signed and unsigned integers:
int is stored in at least two-bytes of memory and can
have positive & negative values
unsigned int also stored in at least two-bytes of
memory but it can have only positive values 0…..65535
30. #include<iostream.h>
#include<iomanip.h>
#include<stdlib.h>
int main()
{
int i;
unsigned num;
// we will enter a different number each time we run
cin>>num;
srand(num);
for(i=1; i<=5; i++)
cout<<setw(10)<< 1+rand()%6;
return 0;
}
Output for Multiple Runs
19 6 1 1 4 2 1
18 6 1 5 1 4 4 Different-set of Random
3 1 2 5 6 2 4 numbers
0 1 5 5 3 5 5
3 1 2 5 6 3 4
32. Main calls another function…..normal
A function calls another function2….normal
A function calls itself ?! Possible?? YES
A recursive function is one that call itself.
33. A recursive function is called to solve a problem
The function knows to solve only the simplest cases
or so-called base-cases
Thus if the function called with a base-case, it simply
returns a result. But if it is called with more complex
problem, the function divides the problem into two
conceptual pieces, one knows how to do, and another
doesn't know what to do.
The second case/piece must resemble the original
problem, but be a slightly simpler/smaller version of
the original problem
34. Thus the function launches (calls) a fresh
copy of itself to work on the smaller
problem –this is related as a Recursive-
call/recursive step.
The function keeps dividing each new sub
problem into two conceptual pieces until
eventually terminates after converging on
the base-case.
The function thus recognize the base-case
and returns a result to the previous copy of
the way up the line until original call of the
function returns the final result to main.
35. 5! Final value=120
5!
5!=5*24=120 returned
5*4! 5*4!
4!=4*6=24 returned
4*3! 4*3!
3!=3*2=6 returned
3*2! 3*2!
2!=2*1=2 returned
2*1! 2*1!
1
1 1
36. //Recursive factorial Function
#include<iostream.h>
#include<iomonip.h>
unsigned lion factorial(unsigned long);//prototype
int main()
{
int num;
cout<<“enter a positive integer:”;
cin>>num;
cout<<“factorial=“<<factorial(num);
return 0;
}
unsigned long factorial(unsigned long n)
{
if ( n <= 1) //the base case
return 1;
else
return n * factorial (n - 1);
}
37. Function overloading
Functions with same name and different
parameters
Should perform similar tasks
I.e., function to square ints and function to square floats
int square( int x) {return x * x;}
float square(float x) { return x * x; }
A call-time c++ complier selects the proper function by
examining the number, type and order of the parameters