Programming: Library Routines, Procedures & Functions - A Comprehensive Guide, Schemes and Mind Maps of Computer science

A comprehensive guide to programming concepts, focusing on library routines, procedures, and functions. It explains the differences between functions and procedures, explores the use of library routines in python, and provides pseudocode examples for implementing procedures and functions. Ideal for students learning the fundamentals of programming and understanding how to utilize pre-built routines and functions effectively.

Typology: Schemes and Mind Maps

2023/2024

Uploaded on 01/16/2025

dilip-das-1
dilip-das-1 🇬🇧

6 documents

1 / 14

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Programming
Library Routines, Procedures & Functions
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Programming: Library Routines, Procedures & Functions - A Comprehensive Guide and more Schemes and Mind Maps Computer science in PDF only on Docsity!

Programming

Library Routines, Procedures & Functions

Built in Functions Many programming languages will use built in functions ready to be used. What built in functions can you remember for Python? bin, chr, float, int, max, min, ord, len, round When thinking about the difference between Functions and Procedures, what do all of the above have in common? They all return a value

Library Routines So what are Library Routines? How are they different? A tested and ready to use routine available in the development system of a programming language that can be incorporated into a program What examples can you think of that we have used in Python? print, input (have a little cross over with functions) - Standard Library Routines Math, random, time - Libraries that we can pull into our code if we require them

Library Routines - Pseudocode

Procedures in Pseudocode (no parameters)

PROCEDURE

<statement(s)>

ENDPROCEDURE

TO RUN

CALL

Procedures in Pseudocode (parameters) PROCEDURE( : , : ...) <statement(s)> ENDPROCEDURE TO RUN CALL (Value1, Value2, ...)

Functions in Pseudocode (no parameters)

FUNCTION RETURNS

<statement(s)>

RETURN

ENDFUNCTION

TO RUN

OUTPUT identifier()

Functions in Pseudocode (parameters) FUNCTION ( : , : ,...)RETURNS <statement(s)> RETURN ENDFUNCTION TO RUN OUTPUT identifier (param1, param2)

Function Pseudocode Task 2 Write a Function using Pseudocode that returns the sum of an array of numbers Your function should take one parameter (array of numbers) and return an integer. Your function should add all of the numbers in the array together and return the value. Call your function 5 times with different values each time.

Keywords Complete the Programming Keywords on Google Classroom This needs to be completed for homework if not done this lesson