Deprecated: wp_getimagesize(): Implicitly marking parameter $image_info as nullable is deprecated, the explicit nullable type must be used instead in /hosting/www/gimnesia.net/aula/wp-includes/media.php on line 5474
Deprecated: OGF_Upload_Fonts_Admin_Screen::font_file_edit_field(): Optional parameter $value declared before required parameter $description is implicitly treated as a required parameter in /hosting/www/gimnesia.net/aula/wp-content/plugins/olympus-google-fonts/admin/class-ogf-upload-fonts-screen.php on line 184
Deprecated: Creation of dynamic property WPSP_Functions::$advanced_settings is deprecated in /hosting/www/gimnesia.net/aula/wp-content/plugins/wp-support-plus-responsive-ticket-system/includes/class-wpsp-functions.php on line 81
Deprecated: Creation of dynamic property WPSP_Functions::$general_settings_advanced is deprecated in /hosting/www/gimnesia.net/aula/wp-content/plugins/wp-support-plus-responsive-ticket-system/includes/class-wpsp-functions.php on line 82
Deprecated: WPvivid_Exporter::wxr_authors_list(): Implicitly marking parameter $post_ids as nullable is deprecated, the explicit nullable type must be used instead in /hosting/www/gimnesia.net/aula/wp-content/plugins/wpvivid-backuprestore/includes/class-wpvivid-exporter.php on line 1935
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-date-query.php on line 516
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-date-query.php on line 516
UNITAT 5. Divide et Impera. – Aula de Informàtica
Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-theme-json.php on line 2380
Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-theme-json.php on line 2380
Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-theme-json.php on line 2380
Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-theme-json.php on line 2380
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /hosting/www/gimnesia.net/aula/wp-includes/class-wp-block-type-registry.php on line 168
A la unitat anterior hem usat els condicionals per implementar una tria de opcions.
Dividim en problemes semblants
Detectam funcions
Implementam funcions
En aquesta unitat coneixerem les funcions, com es dissenyen i com s’implementen.
S’usen funcions per tenir un disseny i codificació més legible, més moldejable i més ordenada.
Els llenguatges de programació d’alt nivell, els més parescuts al llenguatge humà, usen funcions per resoldre els problemes. Els de baix nivell usen rutinres que són sistemes semblants. bots de posició de memòria.Nosaltres usam un llenguatge d’alt nivell i explicarem com es mou per dins la memòria una funció.
Funcions
Una funció és un element que reb uns inputs i retorna uns outputs.
Per exemple, podriem tenir una funció que sumi dos nombres, haurien d’entrar dos nombres d’input i la funció ens retornaria un output (que hauria de ser la suma dels dos nombres).
En l’unitat anterior hem vist un exemple d’una funció random de PHP, podem veure la seva descripció en aquest enllaç.
Observacions sobre la funció rand:
La funció està escrita dins la codificació del llenguatge PHP.
Per cridar una funció es posa un nom de funció i dins un parentesi els paràmetres que li enviam.
rand ( void ) : int //”Reb un valor void(cap valor) i retorna un int”
rand (int $min, int $max) : int //reb dos valors min i max i retorna un int entre els dos intèrvals.
http://aula.gimnesia.net/2019/10/29/unitat-5-divide-et-impera/http://aula.gimnesia.net/wp-content/uploads/2019/10/pesce-3.jpghttp://aula.gimnesia.net/wp-content/uploads/2019/10/pesce-3-150x150.jpgadmin2on batxilleratA la unitat anterior hem usat els condicionals per implementar una tria de opcions.
Dividim en problemes semblants
Detectam funcions
Implementam funcions
En aquesta unitat coneixerem les funcions, com es dissenyen i com s'implementen.
S'usen funcions per tenir un disseny i codificació més legible, més moldejable i més ordenada.
Els llenguatges de programació d'alt...adminpereantonibennassar@gmail.comAdministratorAula de Informàtica