From e9161792780007a77a1b6d4858e04ac7ab9414d8 Mon Sep 17 00:00:00 2001 From: Ivan Farid Espadas Escalante Date: Thu, 6 Feb 2020 11:59:46 -0600 Subject: [PATCH 01/22] Commit Prueba Commit Prueba E2 --- Unidad 2-Estructuras de Control/Equipo2_CodePain/Ejercicio2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Unidad 2-Estructuras de Control/Equipo2_CodePain/Ejercicio2.py b/Unidad 2-Estructuras de Control/Equipo2_CodePain/Ejercicio2.py index 5935361..14c8cbb 100644 --- a/Unidad 2-Estructuras de Control/Equipo2_CodePain/Ejercicio2.py +++ b/Unidad 2-Estructuras de Control/Equipo2_CodePain/Ejercicio2.py @@ -20,6 +20,7 @@ #Inicio condicionales para asignación e impresión de quien es mayor, menor o si son iguales #Salida: impresión de quien es mayor, menor o si son iguales + if aNum > bNum: print(str(aNum) + " > " + str(bNum)) #La primera salida es el número más grande y la segunda el más chico elif (aNum < bNum): From 01a04fce813433304bd70b0b81e1b08291fd692c Mon Sep 17 00:00:00 2001 From: Ivan Farid Espadas Escalante Date: Thu, 6 Feb 2020 12:21:13 -0600 Subject: [PATCH 02/22] Commit prueba 2 Commit prueba 2 --- Unidad 2-Estructuras de Control/Equipo2_CodePain/Ejercicio2.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Unidad 2-Estructuras de Control/Equipo2_CodePain/Ejercicio2.py b/Unidad 2-Estructuras de Control/Equipo2_CodePain/Ejercicio2.py index 14c8cbb..5935361 100644 --- a/Unidad 2-Estructuras de Control/Equipo2_CodePain/Ejercicio2.py +++ b/Unidad 2-Estructuras de Control/Equipo2_CodePain/Ejercicio2.py @@ -20,7 +20,6 @@ #Inicio condicionales para asignación e impresión de quien es mayor, menor o si son iguales #Salida: impresión de quien es mayor, menor o si son iguales - if aNum > bNum: print(str(aNum) + " > " + str(bNum)) #La primera salida es el número más grande y la segunda el más chico elif (aNum < bNum): From 576c62d94a54faed4bdb7040250d7a750d5e3393 Mon Sep 17 00:00:00 2001 From: Ivan Farid Espadas Escalante Date: Thu, 6 Feb 2020 12:48:20 -0600 Subject: [PATCH 03/22] Commit Commit prueba --- Unidad 2-Estructuras de Control/Ejercicio8.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Unidad 2-Estructuras de Control/Ejercicio8.py b/Unidad 2-Estructuras de Control/Ejercicio8.py index 0136a78..afb3d53 100644 --- a/Unidad 2-Estructuras de Control/Ejercicio8.py +++ b/Unidad 2-Estructuras de Control/Ejercicio8.py @@ -18,4 +18,5 @@ elif aMult%bNum==0: print("Si es Multiplo") else: - print("No es multiplo") \ No newline at end of file + print("No es multiplo") + \ No newline at end of file From b9149499ee25c3c3a17185e78e3b40f29d98a540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Immanuel=20Meza=20Maga=C3=B1a?= <56287951+JoshuaMeza@users.noreply.github.com> Date: Tue, 18 Feb 2020 18:33:52 -0600 Subject: [PATCH 04/22] Funciones --- Unidad 3-Funciones/Ejercicio43.py | 67 +++++++++++++++++++++++++++++++ Unidad 3-Funciones/Ejercicio48.py | 58 ++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 Unidad 3-Funciones/Ejercicio43.py create mode 100644 Unidad 3-Funciones/Ejercicio48.py diff --git a/Unidad 3-Funciones/Ejercicio43.py b/Unidad 3-Funciones/Ejercicio43.py new file mode 100644 index 0000000..2bad2ac --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio43.py @@ -0,0 +1,67 @@ +#Autor Joshua Immanuel Meza Magana +#Version 1.0 +#Program who count how many positive and negative numbers are on N numbers, 0 break the count. + +#Functions +def specifyNumbers(): + _N=0 + + _N=int(input()) + + if _N<0: + while _N<0: + _N=int(input()) + + return _N + +def inputNumbers(_N): + _listNumbers=[] + num=0 + con=0 + + while con<_N: + num=int(input()) + con=con+1 + + if num==0: + con=_N + else: + _listNumbers.append(num) + + return _listNumbers + +def pResult(_N,_listNumbers): + _pos=0 + + for x in _listNumbers: + if x>0: + _pos=_pos+1 + + return _pos + +def nResult(_N,_listNumbers): + _neg=0 + + for x in _listNumbers: + if x<0: + _neg=_neg+1 + + return _neg + + +def printResults(_pos,_neg): + print(_pos) + print(_neg) + +#Input +N=0 +listNumbers=[] +N=specifyNumbers() +listNumbers.extend(inputNumbers(N)) + +#Process +pos=pResult(N,listNumbers) +neg=nResult(N,listNumbers) + +#Output +printResults(pos,neg) diff --git a/Unidad 3-Funciones/Ejercicio48.py b/Unidad 3-Funciones/Ejercicio48.py new file mode 100644 index 0000000..a2616f9 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio48.py @@ -0,0 +1,58 @@ +#Autor Joshua Immanuel Meza Magana +#Version 1.0 +#Program who add a little amount of money to the salary of a worker depending on the time he has worked on the company. + +#Functions +def readAge(): + _age=0 + + _age=int(input()) + + if _age<0 or _age>15: + while _age<0 or _age>15: + _age=int(input()) + + return _age + +def readMoney(): + _money=0 + + _money=int(input()) + + if _money<0: + while _money<0: + _money=int(input()) + + return _money + +def calculateExtra(_age,_money): + _total=0 + + if _age>=1 and _age<=3: + _total=_money*1.01 + else: + if _age>=4 and _age<=6: + _total=_money*1.03 + else: + if _age>=7 and _age<=9: + _total=_money*1.05 + else: + _total=_money*1.07 + + return _total + +def printResult(_total): + print(_total) + +#Input +age=0 +money=0 +total=0 +age=int(readAge()) +money=int(readMoney()) + +#Process +total=int(calculateExtra(age,money)) + +#Output +printResult(total) From e5b897414338b28fc6234d744f16de6fde1d9a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Immanuel=20Meza=20Maga=C3=B1a?= <56287951+JoshuaMeza@users.noreply.github.com> Date: Wed, 19 Feb 2020 19:31:14 -0600 Subject: [PATCH 05/22] PY DOC --- Unidad 3-Funciones/Ejercicio43.py | 68 ++++++++++++++++- Unidad 3-Funciones/Ejercicio48.py | 70 +++++++++++++++--- .../__pycache__/Ejercicio43.cpython-38.pyc | Bin 0 -> 2640 bytes .../__pycache__/Ejercicio48.cpython-38.pyc | Bin 0 -> 1053 bytes 4 files changed, 126 insertions(+), 12 deletions(-) create mode 100644 Unidad 3-Funciones/__pycache__/Ejercicio43.cpython-38.pyc create mode 100644 Unidad 3-Funciones/__pycache__/Ejercicio48.cpython-38.pyc diff --git a/Unidad 3-Funciones/Ejercicio43.py b/Unidad 3-Funciones/Ejercicio43.py index 2bad2ac..c87c1a4 100644 --- a/Unidad 3-Funciones/Ejercicio43.py +++ b/Unidad 3-Funciones/Ejercicio43.py @@ -1,9 +1,18 @@ -#Autor Joshua Immanuel Meza Magana -#Version 1.0 -#Program who count how many positive and negative numbers are on N numbers, 0 break the count. +''' +Author Joshua Immanuel Meza Magana +Version 1.0 +Program who count how many positive and negative numbers are on N numbers, 0 break the count. +''' #Functions def specifyNumbers(): + ''' + It gets the N numbers that we will count. + Args: + _N (int): Value of the number of numbers + Returns: + The N numbers that will be counted + ''' _N=0 _N=int(input()) @@ -15,6 +24,16 @@ def specifyNumbers(): return _N def inputNumbers(_N): + ''' + Get a vector of the numbers that we will compare. + Args: + _N (int): Number of numbers + _listNumbers (list): The temporary list of numbers + num (int): Variable where the user input the numbers + con (int): Counter + Returns: + Values of the list of numbers + ''' _listNumbers=[] num=0 con=0 @@ -31,6 +50,15 @@ def inputNumbers(_N): return _listNumbers def pResult(_N,_listNumbers): + ''' + It calculates the amount of positive numbers. + Args: + _N (int): Number of numbers + _listNumbers (list): List of numbers + _pos (int): Ammount of positive numbers + Returns: + Ammount of positive numbers + ''' _pos=0 for x in _listNumbers: @@ -40,6 +68,15 @@ def pResult(_N,_listNumbers): return _pos def nResult(_N,_listNumbers): + ''' + It calculates the amount of negative numbers. + Args: + _N (int): Number of numbers + _listNumbers (list): List of numbers + _neg (int): Ammount of negative numbers + Returns: + Ammount of negative numbers + ''' _neg=0 for x in _listNumbers: @@ -50,18 +87,43 @@ def nResult(_N,_listNumbers): def printResults(_pos,_neg): + ''' + It print the amount of positive and negative numbers + Args: + _pos (int): Copy of the value of the positive numbers + _neg (int): Copy of the value of the negative numbers + Returns: + Nothing + ''' print(_pos) print(_neg) #Input +''' +It recives the N amount of numbers, and then it reads them. + Args: + N (int): Number of numbers + listNumbers (list): List of numbers +''' N=0 listNumbers=[] N=specifyNumbers() listNumbers.extend(inputNumbers(N)) #Process +''' +Calculate how many positive and negative numbers are on the N numbers. + Args: + pos (int): Ammount of positive numbers + neg (int): Amount of negative numbers + N (int): Number of numbers + listNumbers (list): List of numbers +''' pos=pResult(N,listNumbers) neg=nResult(N,listNumbers) #Output +''' +Print the results. +''' printResults(pos,neg) diff --git a/Unidad 3-Funciones/Ejercicio48.py b/Unidad 3-Funciones/Ejercicio48.py index a2616f9..42470eb 100644 --- a/Unidad 3-Funciones/Ejercicio48.py +++ b/Unidad 3-Funciones/Ejercicio48.py @@ -1,9 +1,18 @@ -#Autor Joshua Immanuel Meza Magana -#Version 1.0 -#Program who add a little amount of money to the salary of a worker depending on the time he has worked on the company. +''' +Author Joshua Immanuel Meza Magana +Version 1.0 +Program who add a little amount of money to the salary of a worker depending on the time he has worked on the company. +''' #Functions def readAge(): + ''' + It reads the age of the worker. + Args: + _age (int): Value of the age of the worker + Returns: + The age of the worker + ''' _age=0 _age=int(input()) @@ -15,18 +24,34 @@ def readAge(): return _age def readMoney(): + ''' + It reads the salary of the worker + Args: + _money (float): Salary of the worker + Returns: + The salary of the worker + ''' _money=0 - _money=int(input()) + _money=float(input()) if _money<0: while _money<0: - _money=int(input()) + _money=float(input()) return _money def calculateExtra(_age,_money): - _total=0 + ''' + It calculates the total new amount of money + Args: + _age (int): Age of the worker + _money (float): Normal amount of money + _total (float): New total amount of money + Returns: + The new total amount of money + ''' + _total=float(0) if _age>=1 and _age<=3: _total=_money*1.01 @@ -37,22 +62,49 @@ def calculateExtra(_age,_money): if _age>=7 and _age<=9: _total=_money*1.05 else: - _total=_money*1.07 + if _age>=10: + _total=_money*1.07 + else: + _total=_money return _total def printResult(_total): + ''' + It prints the total of money + Args: + _total (float): Total of money + Returns: + Nothing + ''' print(_total) #Input +''' +It receives the values. + Args: + age (int): Age of the worker + money (float): Salary of the worker + total (float): New total amount of money +''' age=0 money=0 total=0 age=int(readAge()) -money=int(readMoney()) +money=float(readMoney()) #Process -total=int(calculateExtra(age,money)) +''' +It calculates the new total. + Args: + age (int): Age of the worker + money (float): Salary of the worker + total (float): New total amount of money +''' +total=float(calculateExtra(age,money)) #Output +''' +It prints the result. +''' printResult(total) diff --git a/Unidad 3-Funciones/__pycache__/Ejercicio43.cpython-38.pyc b/Unidad 3-Funciones/__pycache__/Ejercicio43.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..552127bc76039d795f40db67d543f28a3fa22e3a GIT binary patch literal 2640 zcmc&#%WfP+6s@YBN4sZiP!a`{Rf$yw!6+zRStyESCn11GDBws81EX?RWv1hv?siqR zUz)6jH9PiU$q(=ud_Zqm>S-56R?h*{}OO0Pc0uPYn+^gc$f*xPZU3i;&?6|Ph;8E1GDAsPUoEW zJN#~x*wz+*F5(<4dEtIHwFPH0s}`4@DVytLrK=jC_=A}PlyvvsfUTf@;eo`W z8YNk7TeM*P&d)?wVe5}?cD8!^2E5vfRgxa3z1=j-M=G(V_aw5PhQmr92bOg8Vgv$JBuWGakaoOPza`5@3VQ6s;?0_Ibn zHkq!&JVb!z1u5)7bztqnU_f3`0E|KP#@?6!R1X&rv9TxFI|O!M|B&g;F^rFzWBQtn z8Il*r0HG&710l{SPn6|?AFI#;TQ9jEk-dcFC=G4eC01^3q92qzW-mZ?OxDjIPtn#+cFJ+Pzefi8}G)28N*Iqhfu zxdSWa7Br+$q3{7y0_sCsW55^4dL%@7^KywV@4+f^WlVR;x3`clz>13YfgQ*ab_65G zhQ^!?5YwTE!#oyNO(R>3Ts8t`Eb!Q1-hj1#h!Xj?D6Kva{|`!_MF~o) zy8UgGN-tiI5?s;ia|D-ytDa18dR&6j+p9QXWMOsL7lY8k^Ejatdy2ipY|74mca}i# zWE$QUmv>6yrtJM*xS%APE>V3a&Ccfe=Xm+0Tn);_|1i(>mteT^52e1v+oh?nliFdF z44jw_yq;BOaf@ku%Jf^<;8VKf@TNO4b-MW)_6+7IvgT8L15aYo?6ew1z2BE<*zdbH z&?Pn(HyS~4Ckxu?HZb|lGGkFwrxvnn;bBC22>69)H*(q3|9F(jJXQ}-ka-uHO5MNV T-+_A5zlk}uMmHJ(4QhV^Y6Xyd literal 0 HcmV?d00001 diff --git a/Unidad 3-Funciones/__pycache__/Ejercicio48.cpython-38.pyc b/Unidad 3-Funciones/__pycache__/Ejercicio48.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3c5b8f9a299aa2745b983abfc0d94b07a99f88a GIT binary patch literal 1053 zcmZ`%y-yTD6rY*>xV<~TQ_;$xvGR!0U_l504I&nLQ4Gzxfh;?d%XxRZI6G@Zp*pSY z{2yqnt*!MRxXxH@Y_PDg^7rNhPoi)0K7X@s=6!5VPSzOcow>g??=tq4oN+>o-2&$! zgk+MxW+9V8I?!CY(t{S#mlbG72B8b~z`m*|HedrDy0EylJXk`x${Ps8edQ>Bz&VrE z$E;aPkpF}@ECF5x=gSb1A27p=&2zx^;dfa+11-9)Ui|IP9s7SyKEoMgcUmQqu<{JV zp%^-y)C|2&x?7kgAG+IdTOBf80r>OD>SDB+E1gF@m1fVg=uVateU+L#TJM;9#ZL54 zXKfw#_X0#zQZJykmCz`40Fx4Sp2Xcf!bZRO*p zd;)@TSJXsfOQp$$!_XDNBB8Q4{^gR%EpEOfBNp=U=NdZV(aJ!AQ)HQLTRSn6l8=&5D9iPMM& Qb$pG$bvb=CUUR0LU*v?<5&!@I literal 0 HcmV?d00001 From 526cf8fc6aa89e878e1ae179acdaeb5316711ec6 Mon Sep 17 00:00:00 2001 From: Irving Poot Date: Wed, 19 Feb 2020 20:24:49 -0600 Subject: [PATCH 06/22] Ejercicios 13 y 19 --- Unidad 3-Funciones/Ejercicio13.c | 49 +++++++++++++ Unidad 3-Funciones/Ejercicio13.py | 21 ++++++ Unidad 3-Funciones/Ejercicio19.c | 117 +++++++++++++----------------- Unidad 3-Funciones/Ejercicio19.py | 19 +++++ 4 files changed, 138 insertions(+), 68 deletions(-) create mode 100644 Unidad 3-Funciones/Ejercicio13.c create mode 100644 Unidad 3-Funciones/Ejercicio13.py create mode 100644 Unidad 3-Funciones/Ejercicio19.py diff --git a/Unidad 3-Funciones/Ejercicio13.c b/Unidad 3-Funciones/Ejercicio13.c new file mode 100644 index 0000000..8e35a04 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio13.c @@ -0,0 +1,49 @@ +#include + +int hora(); +int traducirHora(int); +void imprimirHora(int); + +int main(){ + // Entrada de la hora + int horaOriginal; + horaOriginal = hora(); + traducirHora(horaOriginal); + imprimirHora(horaOriginal); +} + + + + +// Leer la hora +int hora(){ + int horaMilitar = 0; + scanf("%d",&horaMilitar); + return horaMilitar; +} + +// Traduce la hora +int traducirHora(int horaOriginal){ + int amPm = 0; + int horas = 0; + int minutos = 0; + //Define am/pm + amPm = 'am'; + + //Se obtienen los primeros 2 números + horas = horaOriginal % 100; + + // Se optienen los últimos 2 números + minutos = horaOriginal - (horaOriginal % 100 ) * 100; + + // Traduce al formato + if (horas > 12) + horas = horas - 12; + amPm = 'pm'; + return ("%d : %d %d",horas, minutos, amPm); +} + +//Imprimir hora traducida +void imprimirHora(int horaOriginal){ + printf(horaOriginal); +} \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio13.py b/Unidad 3-Funciones/Ejercicio13.py new file mode 100644 index 0000000..7d06770 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio13.py @@ -0,0 +1,21 @@ +#Autor Irving Eduardo Poot Moo +#Version 1.0 +#Program who translate a militar hour to a normal hour + + +#Translation Process +def timeTranslate(time): + amPm = "am" + hours = time // 100 + minutes = time - (time // 100)*100 + + + if (hours > 12): + hours = hours - 12 + amPm = "pm" + + return (str(hours).zfill(2)+":"+str(minutes).zfill(2)+ " " + amPm) + +#Main Process +time = int(input()) +print(timeTranslate(time)) \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio19.c b/Unidad 3-Funciones/Ejercicio19.c index 7a1dff8..3219234 100644 --- a/Unidad 3-Funciones/Ejercicio19.c +++ b/Unidad 3-Funciones/Ejercicio19.c @@ -1,79 +1,60 @@ -/* - Autor: Carlos Chan Gongora 15/02/2019 - Entradas: Tres numeros. - Salidas: El mayor de los 3 numeros. - Procedimiento general: Lee los 3 numeros, posterior verifica si son iguales y encuentra - el mayor de los 3 numeros, si los numeros no son iguales imprime el mayor, de ser iguales - imprime un texto indicando que los numeros son iguales. -*/ #include -int entrada(); -int encontrarMayor(int, int, int); -int verificarIgualdad(int, int, int); -void imprimirResultados(int, int); +float entrada1(); +float entrada2(); +float entrada3(); +float comparacion(float, float, float); +void imprimirMayor(float); -int main(){ - // Entradas - int num1, num2, num3, mayor, igualdad; - num1 = entrada(); - num2 = entrada(); - num3 = entrada(); - - // Procesos - igualdad = verificarIgualdad(num1, num2, num3); - if(!igualdad){ - mayor = encontrarMayor(num1, num2, num3); - } +float main(){ + //Entradas + float num1, num2, num3; + float numMayor; + num1 = entrada1(); + num2 = entrada2(); + num3 = entrada3(); + // Proceso + comparacion(num1, num2, num3); + // Impresion del numero + imprimirMayor(numMayor); +} - // Salidas - imprimirResultados(igualdad, mayor); - return 0; +float entrada1(){ + float numero = 1; + scanf("%d",&numero); + return numero; } -// Lee un numero -int entrada(){ - int numero = 1; - printf("Ingrese un numero: "); - scanf("%d", &numero); - return numero; -} -// Verifica si los numeros son iguales, de ser verdad regresa 1 o de lo contrario regresa 0 -int verificarIgualdad(int num1, int num2, int num3){ - int igualdad = 0; - if(num1 == num2 && num2 == num3){ - igualdad = 1; - } - return igualdad; +float entrada2(){ + float numero = 1; + scanf("%d",&numero); + return numero; } -// Compara 3 numeros para encontrar el mayor -int encontrarMayor(int num1, int num2, int num3){ - int mayor = 0; - if((num1 > num2 && num1 > num3) || (num1 >= num2 && num1 >= num3)){ - mayor = num1; - } - else if(num2 > num1 && num2 > num3){ - mayor = num2; - } - else{ - mayor = num3; - } - return mayor; + +float entrada3(){ + float numero = 1; + scanf("%d",&numero); + return numero; } -// Verifica si los numeros son iguales, en ese caso imprime que "son iguales", -// de lo contrario imprime al mayor -void imprimirResultados(int igualdad, int mayor){ - if(igualdad){ - printf("Los numeros son iguales"); - } - else{ - printf("El mayor es: %d", mayor); - } + +float comparacion(float num1, float num2, float num3){ + float numMayor = 0; + if (num3 < num1 > num2) + { + numMayor = num1; + } + else if (num3 < num2 > num1) + { + numMayor = num2; + } + else + { + numMayor = num3; + } + return numMayor; } -/*AUTOR QA: RONSSON RAMIRO MAY SANTOS -ENTRADAS: 9,9, -3 -SALIDAS: EL MAYOR ES -3 -OBSERVACIONES: SOLO FUNCIONA CON NUMEROS POSITIVOS, CON UN NEGATIVO DICE QUE EL NEGATIVO ES EL MAYOR. -*/ +void imprimirMayor(float numMayor){ + printf("El numero mayor es: %d", numMayor); +} diff --git a/Unidad 3-Funciones/Ejercicio19.py b/Unidad 3-Funciones/Ejercicio19.py new file mode 100644 index 0000000..74c54c7 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio19.py @@ -0,0 +1,19 @@ +#Determinate +numMayor = 0 +num1 = 0 +num2 = 0 +num3 = 0 + +def comparisons(num1, num2, num3): + if num1 > num2 and num1 > num3: + numMayor = num1 + elif num2 > num1 and num2 > num3: + numMayor = num2 + else: + numMayor = num3 + return ("El numero mayor es:", numMayor) + +num1 = float(input()) +num2 = float(input()) +num3 = float(input()) +print(comparisons(num1, num2, num3)) \ No newline at end of file From e11484d270d489d40cfa4216b3bcd937df8bf915 Mon Sep 17 00:00:00 2001 From: Irving Poot Date: Wed, 19 Feb 2020 20:31:42 -0600 Subject: [PATCH 07/22] Correcciones --- Unidad 3-Funciones/Ejercicio13.c | 18 +++++++++++------- Unidad 3-Funciones/Ejercicio19.c | 10 +++++++--- Unidad 3-Funciones/Ejercicio19.py | 4 ++++ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Unidad 3-Funciones/Ejercicio13.c b/Unidad 3-Funciones/Ejercicio13.c index 8e35a04..7a6877c 100644 --- a/Unidad 3-Funciones/Ejercicio13.c +++ b/Unidad 3-Funciones/Ejercicio13.c @@ -1,3 +1,7 @@ +//Autor Irving Eduardo Poot Moo +//Version 1.0 +//Program who translate a militar hour to a normal hour + #include int hora(); @@ -15,35 +19,35 @@ int main(){ -// Leer la hora +// Reeds the hour int hora(){ int horaMilitar = 0; scanf("%d",&horaMilitar); return horaMilitar; } -// Traduce la hora +// Translate the hour int traducirHora(int horaOriginal){ int amPm = 0; int horas = 0; int minutos = 0; - //Define am/pm + //Determinate am/pm amPm = 'am'; - //Se obtienen los primeros 2 números + //Gets the firts 2 numbers horas = horaOriginal % 100; - // Se optienen los últimos 2 números + // Gets the las 2 numbers minutos = horaOriginal - (horaOriginal % 100 ) * 100; - // Traduce al formato + // Translate the format if (horas > 12) horas = horas - 12; amPm = 'pm'; return ("%d : %d %d",horas, minutos, amPm); } -//Imprimir hora traducida +//Print the translated hour void imprimirHora(int horaOriginal){ printf(horaOriginal); } \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio19.c b/Unidad 3-Funciones/Ejercicio19.c index 3219234..f9600a8 100644 --- a/Unidad 3-Funciones/Ejercicio19.c +++ b/Unidad 3-Funciones/Ejercicio19.c @@ -1,3 +1,7 @@ +//Autor Irving Eduardo Poot Moo +//Version 1.0 +//Program who compare two nombers and print the bigger + #include float entrada1(); @@ -7,15 +11,15 @@ float comparacion(float, float, float); void imprimirMayor(float); float main(){ - //Entradas + //Inputs float num1, num2, num3; float numMayor; num1 = entrada1(); num2 = entrada2(); num3 = entrada3(); - // Proceso + // Process comparacion(num1, num2, num3); - // Impresion del numero + // Print number imprimirMayor(numMayor); } diff --git a/Unidad 3-Funciones/Ejercicio19.py b/Unidad 3-Funciones/Ejercicio19.py index 74c54c7..a86444c 100644 --- a/Unidad 3-Funciones/Ejercicio19.py +++ b/Unidad 3-Funciones/Ejercicio19.py @@ -1,9 +1,13 @@ +#Autor Irving Eduardo Poot Moo +#Version 1.0 +#Program who Program who compare two nombers and print the bigger #Determinate numMayor = 0 num1 = 0 num2 = 0 num3 = 0 +#Comparing numbers def comparisons(num1, num2, num3): if num1 > num2 and num1 > num3: numMayor = num1 From 506fbaec6d8dd651f505dff5bc9bfb2332f2b64a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20G=C3=B3mez?= Date: Wed, 19 Feb 2020 21:03:15 -0600 Subject: [PATCH 08/22] Ejercicios 1 y 7 Python y c, documentados y modularizados --- Unidad 3-Funciones/Ejercicio1.c | 49 ++++++++++++++ Unidad 3-Funciones/Ejercicio1.py | 40 +++++++++++ Unidad 3-Funciones/Ejercicio7.c | 111 +++++++++++++++++-------------- Unidad 3-Funciones/Ejercicio7.py | 44 ++++++++++++ 4 files changed, 194 insertions(+), 50 deletions(-) create mode 100644 Unidad 3-Funciones/Ejercicio1.c create mode 100644 Unidad 3-Funciones/Ejercicio1.py create mode 100644 Unidad 3-Funciones/Ejercicio7.py diff --git a/Unidad 3-Funciones/Ejercicio1.c b/Unidad 3-Funciones/Ejercicio1.c new file mode 100644 index 0000000..f2511dd --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio1.c @@ -0,0 +1,49 @@ +//Autor: Jonathan Gómez +// Program that determines if an integer N number is even or odd +//Version 1.0 +#include + +int readNumber(int); +int calculateTypeNumber(int, int); +void printTypeNumber(int); + +int main(){ + int Number=0, typeNumber=0; + //Input: A integer Number + Number= readNumber(Number); + + //Process: Determines if the module of 2 of Number is 0, which means that is an even number + //Then the value of typeNumber change to 1, which for this program represents even and 0 represents odd + typeNumber= calculateTypeNumber(Number,typeNumber); + + //Output: 1 for even Number or 0 for odd Number + printTypeNumber(typeNumber); + +} + +int readNumber (int Number){ + //Read the number which want to know is even or odd and returns the value to the original variable Number + + scanf("%d", &Number); + + return Number; +} + +int calculateTypeNumber (int Number, int typeNumber){ + //Using the module function we compare the result with 0, that means _Number is even or odd + //The _typeNumber is even when the module give us 0 and odd when is >0, in the moment when the _Number + //is a even number the value of the flag change and if is not == 0 then the flag still being the same + //This function returns the value of _typeNumber because we are going to use it for the output + + typeNumber=0; + if (Number%2 == 0){ + typeNumber=1; + } + return typeNumber; +} + +void printTypeNumber(int typeNumber){ + //Using the value of _typeNumber we have the output of our program + + printf("%d", typeNumber); +} \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio1.py b/Unidad 3-Funciones/Ejercicio1.py new file mode 100644 index 0000000..9ae0396 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio1.py @@ -0,0 +1,40 @@ +#Autor: Jonathan Gómez +#Version 1.0 +#Program that determines if an integer N number is even or odd + +#Functions +def readNumber(): + #Read the number which want to know is even or odd and returns the value to the original variable Number + + _Number= int(input()) + + return _Number + +def calculateTypeNumber(_Number): + #Using the module function we compare the result with 0, that means _Number is even or odd + #The _typeNumber is even when the module give us 0 and odd when is >0, in the moment when the _Number + #is a even number the value of the flag change and if is not == 0 then the flag still being the same + #This function returns the value of _typeNumber because we are going to use it for the output + + _typeNumber=0 + if _Number%2==0 : + _typeNumber=1 + + return _typeNumber + +def printTypeNumber(_typeNumber): + #Using the value of _typeNumber we have the output of our program + + print(_typeNumber) + +#Input: A integer Number +Number=0 +typeNumber=0 +Number=(readNumber()) + +#Process: Determines if the module of 2 of Number is 0, which means that is an even number +#Then the value of typeNumber change to 1, which for this program represents even and 0 represents odd +typeNumber= calculateTypeNumber(Number) + +#Output: 1 for even Number or 0 for odd Number +printTypeNumber(typeNumber) \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio7.c b/Unidad 3-Funciones/Ejercicio7.c index d224a48..48234aa 100644 --- a/Unidad 3-Funciones/Ejercicio7.c +++ b/Unidad 3-Funciones/Ejercicio7.c @@ -1,54 +1,65 @@ -/* - Autor: Raul Rivadeneyra - Entradas: numeros positivos - Salidas: la adicion al numero ingresado respecto a ciertos factores - Proceso general: si el numero ingresado es mayor a 1000 o 3000 o 5000 aumenta cierta cantidad respectivamente - */ -#include "stdio.h" - -void getNumber(float*); -void moreThan1K(float*); -void moreThan3K(float*); -void moreThan5K(float*); - -int main() { - float number; - getNumber(&number); - moreThan1K(&number); - moreThan3K(&number); - moreThan5K(&number); - - printf("The outcome is: %f\n", number); - return 0; -} - -void getNumber(float *number) { - printf("Insert a positive number: "); - scanf("%f", number); - while (number <= 0) { - printf("The number isn\'t positive, try again: "); - scanf("%f", number); - } -} +//Autor: Jonathan Gómez +//Program that receives a positive number to which a percentage is added depending on its size. +//Version 1.0 -void moreThan1K(float *number) { - if (*number > 1000){ - *number += (*number * 0.05); - } -} +#include -void moreThan3K(float *number) { - if (*number > 3000){ - *number += (*number * 0.1); - } -} +//Function prototypes +int readNumber(int); +int calculatepercentage(int, int); +void printNewNumber(int); + +int main (){ + //Declaration of variables + int Number=0; + int newNumber=0; + + //Input:A integer Number and variable declarations + Number= readNumber(Number); + + //Process:With the help of another adding variable, its value is modified based on the number entered by the user + newNumber= calculatepercentage(newNumber, Number); + + //Output:The new value of newNumber, that is the result of the process + printNewNumber(newNumber); + + } + + int readNumber(int Number){ + //Read the number which is going to use to calculate the percentage the program will add + //Returns the Number value + + scanf("%d",&Number); + + return Number; + + } + + int calculatepercentage( int newNumber, int Number) { + //With if sentences the program determines how much percentage is going to add to the variable + //That percentage depends of how big is the number (1000=5%, 3000=10%, 5000=%5) + //The program would be add all the if sentences + + newNumber = Number; + if (Number>1000) { + newNumber+= Number*0.05; + } else { + if (Number>3000){ + newNumber+= Number*0.1; + } else { + if (Number>5000){ + newNumber+=Number*0.05; + } + } + } + + return newNumber; -void moreThan5K(float *number) { - if (*number > 5000){ - *number += (*number * 0.05); } -} -/* -QA: Hector Abraham V. Cosgalla -TODO MAL!! -*/ + + void printNewNumber(int newNumber){ + //Using the newNumber the program print the output + + printf("%d", newNumber); + + } \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio7.py b/Unidad 3-Funciones/Ejercicio7.py new file mode 100644 index 0000000..c222fc7 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio7.py @@ -0,0 +1,44 @@ +#Autor: Jonathan Gómez +#Program that receives a positive number to which a percentage is added depending on its size. +#Version 1.0 + +#Functions +def readNumber (): + #Read the number which is going to use to calculate the percentage the program will add + #Returns the _Number + + _Number=int(input()) + + return _Number + +def calculatepercentage (_Number): + #With if sentences the program determines how much percentage is going to add to the variable + #That percentage depends of how big is the number (1000=5%, 3000=10%, 5000=%5) + #The program would be add all the if sentences + + _newNumber= _Number + + if _Number>1000: + _newNumber+= _Number*0.05 + elif (_Number>3000): + _newNumber+= _Number*0.1 + elif (_Number>5000): + _newNumber+= _Number*0.05 + + return _newNumber + +def printNewNumber(_newNumber): + #Using the _newNumber the program print the output + + print(int(_newNumber)) + +#Input:A integer Number and variable declarations +Number=0 +newNumber=0 +Number=readNumber() + +#Process:With the help of another adding variable, its value is modified based on the number entered by the user +newNumber= calculatepercentage(Number) + +#Output:The new value of newNumber, that is the result of the process +printNewNumber(newNumber) \ No newline at end of file From 9e7a462b953efb7a2af6ede178d0723504bf0efb Mon Sep 17 00:00:00 2001 From: Irving Poot Date: Wed, 19 Feb 2020 21:15:48 -0600 Subject: [PATCH 09/22] Update Ejercicio13.c --- Unidad 3-Funciones/Ejercicio13.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/Unidad 3-Funciones/Ejercicio13.c b/Unidad 3-Funciones/Ejercicio13.c index 7a6877c..e012261 100644 --- a/Unidad 3-Funciones/Ejercicio13.c +++ b/Unidad 3-Funciones/Ejercicio13.c @@ -1,7 +1,3 @@ -//Autor Irving Eduardo Poot Moo -//Version 1.0 -//Program who translate a militar hour to a normal hour - #include int hora(); @@ -19,35 +15,35 @@ int main(){ -// Reeds the hour +// Leer la hora int hora(){ - int horaMilitar = 0; - scanf("%d",&horaMilitar); - return horaMilitar; + int horaOriginal = 0; + scanf("%d",&horaOriginal); + return horaOriginal; } -// Translate the hour +// Traduce la hora int traducirHora(int horaOriginal){ - int amPm = 0; + char amPm = " "; int horas = 0; int minutos = 0; - //Determinate am/pm + //Define am/pm amPm = 'am'; - //Gets the firts 2 numbers + //Se obtienen los primeros 2 números horas = horaOriginal % 100; - // Gets the las 2 numbers + // Se optienen los últimos 2 números minutos = horaOriginal - (horaOriginal % 100 ) * 100; - // Translate the format + // Traduce al formato if (horas > 12) horas = horas - 12; amPm = 'pm'; - return ("%d : %d %d",horas, minutos, amPm); + return ("%d : %d %c",horas, minutos, amPm); } -//Print the translated hour +//Imprimir hora traducida void imprimirHora(int horaOriginal){ printf(horaOriginal); } \ No newline at end of file From 00b34a43711936d2ce04d7f065bb5a2226b0b762 Mon Sep 17 00:00:00 2001 From: Irving Poot Date: Wed, 19 Feb 2020 21:18:41 -0600 Subject: [PATCH 10/22] Update Ejercicio13.c --- Unidad 3-Funciones/Ejercicio13.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Unidad 3-Funciones/Ejercicio13.c b/Unidad 3-Funciones/Ejercicio13.c index e012261..27feda6 100644 --- a/Unidad 3-Funciones/Ejercicio13.c +++ b/Unidad 3-Funciones/Ejercicio13.c @@ -1,3 +1,7 @@ +//Autor Irving Eduardo Poot Moo +//Version 1.0 +//Program who translate a militar hour to a normal hour + #include int hora(); @@ -5,7 +9,7 @@ int traducirHora(int); void imprimirHora(int); int main(){ - // Entrada de la hora + // input int horaOriginal; horaOriginal = hora(); traducirHora(horaOriginal); @@ -15,35 +19,35 @@ int main(){ -// Leer la hora +// Reed the hour int hora(){ int horaOriginal = 0; scanf("%d",&horaOriginal); return horaOriginal; } -// Traduce la hora +// Translate the hour int traducirHora(int horaOriginal){ char amPm = " "; int horas = 0; int minutos = 0; - //Define am/pm + //Determinate am/pm amPm = 'am'; - //Se obtienen los primeros 2 números + //Gets the first two numbers horas = horaOriginal % 100; - // Se optienen los últimos 2 números + // Gets the last two numbers minutos = horaOriginal - (horaOriginal % 100 ) * 100; - // Traduce al formato + // Translate the format if (horas > 12) horas = horas - 12; amPm = 'pm'; return ("%d : %d %c",horas, minutos, amPm); } -//Imprimir hora traducida +//Print the translated hour void imprimirHora(int horaOriginal){ printf(horaOriginal); } \ No newline at end of file From 71015876cef75bbf548817c78c5f704c0371d097 Mon Sep 17 00:00:00 2001 From: Aldebaran <56288948+AldebaranLP@users.noreply.github.com> Date: Wed, 19 Feb 2020 22:45:09 -0600 Subject: [PATCH 11/22] Create Ejercicio25.c --- Unidad 3-Funciones/Ejercicio25.c | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Unidad 3-Funciones/Ejercicio25.c diff --git a/Unidad 3-Funciones/Ejercicio25.c b/Unidad 3-Funciones/Ejercicio25.c new file mode 100644 index 0000000..43424d2 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio25.c @@ -0,0 +1,40 @@ +//Author: Aldebaran Lira +//Program that finds the corresponding ASCII-code +//Version 1.0 + +#include + +//Function prototypes +void readLetter(char *); +int findASCIIcode(int); +void printCode(int); + +int main(){ + + // Declaration of variables + char letter; + int ASCIIc; + + //Input: A letter of the alphabet + readLetter(&letter); + + //Process: Find the ASCII-code + ASCIIc=(letter); + + //Output: The ASCII-code + printCode(ASCIIc); + + return 0; +} + +void readLetter(char *_letter){ + scanf("%c",_letter); getchar(); +} + +int findASCIIcode(int _ASCIIc){ + return _ASCIIc; +} + +void printCode(int _output){ + printf("%d\n\n",_output); +} From c26b58b4f1dee9ffd78e597c231eee8d4d43b125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Immanuel=20Meza=20Maga=C3=B1a?= <56287951+JoshuaMeza@users.noreply.github.com> Date: Wed, 19 Feb 2020 22:47:56 -0600 Subject: [PATCH 12/22] C finished --- Unidad 3-Funciones/Ejercicio43.c | 236 ++++++++++++++++-------------- Unidad 3-Funciones/Ejercicio48.c | 203 +++++++++++++------------ Unidad 3-Funciones/Ejercicio48.py | 17 +-- 3 files changed, 240 insertions(+), 216 deletions(-) diff --git a/Unidad 3-Funciones/Ejercicio43.c b/Unidad 3-Funciones/Ejercicio43.c index d25edfb..2719240 100644 --- a/Unidad 3-Funciones/Ejercicio43.c +++ b/Unidad 3-Funciones/Ejercicio43.c @@ -1,130 +1,146 @@ /* - Autor: Raul Rivadeneyra - Entradas: Numeros enteros - Salidas: Cuantos numeros positivos y negativos hay - Proceso general: lee numeros enteros del usuario y si es positivo le suma uno al contador de positivos y lo similar - si es negativo. +Author Joshua Immanuel Meza Magana +Version 1.0 +Program who count how many positive and negative numbers are on N numbers, 0 break the count. */ -#include "stdio.h" +#include -void process(int*, int*); -char getNumbers(int*); -void checkSign(int, int*, int*); +void specifyNumbers(int *); +void inputNumbers(int,float[]); +int pResult(int,float[]); +int nResult(int,float[]); +void printResult(int,int); int main() { - int positive = 0; - int negative = 0; - //Da instrucciones al usuario - printf("Insert numbers to check how many positives or negatives are (type 0 to stop):\n"); + /* Input + It recives the N amount of numbers, and then it reads them. + Args: + nNum (int): Number of numbers + listNumbers (vector): List of numbers + */ + int nNum=0; + specifyNumbers(&nNum); + float listNumbers[nNum]; + inputNumbers(nNum,listNumbers); + + /*Process + Calculate how many positive and negative numbers are on the N numbers. + Args: + pos (int): Ammount of positive numbers + neg (int): Amount of negative numbers + N (int): Number of numbers + listNumbers (list): List of numbers + */ + int pos=0,neg=0; + pos=pResult(nNum,listNumbers); + neg=nResult(nNum,listNumbers); + + /*Output + Print the results. + */ + printResult(pos,neg); - //Proceso - process(&positive, &negative); - - //Imprime el resultado - printf("There are %d positive numbers and %d negative numbers\n", positive, negative); return 0; } -//Funciones// - -//Combina las funciones de getNumber y checkSign en un ciclo -void process(int *positive, int *negative) { - int number; - while (getNumbers(&number) == 0) { - checkSign(number, positive, negative); - } +/* Functions */ + +void specifyNumbers(int *_nNum){ + /* + It gets the N numbers that we will count. + Args: + _nNum (int): Value of the number of numbers + Returns: + The N numbers that will be counted + */ + scanf("%d",_nNum); + + if (*_nNum<0 || *_nNum==0){ + while (*_nNum<0 || *_nNum==0){ + scanf("%d",_nNum); + } + } } -/* - Lee numeros enteros y le asigna el valor directamente a la variable externa (paso por referencia), - si el numero es 0 entonces devuelve 1 para finalizar el ciclo donde se llamo, de lo contrario hace - return 0 por lo que sigue el ciclo -*/ -char getNumbers(int *number) { - scanf("%d", number); - if (*number == 0){ - return 1; - } - return 0; +void inputNumbers(int _nNum,float _listNumbers[]){ + /* + Get a vector of the numbers that we will compare. + Args: + _nNum (int): Number of numbers + _listNumbers (vector): The temporary list of numbers + con (int): Counter + Returns: + Values of the list of numbers + */ + int con=0; + + while (con<_nNum){ + scanf("%f",&_listNumbers[con]); + if (_listNumbers[con]==0){ + con=_nNum; + } + con+=1; + } } -//Evalua si el numero dado es postitivo o negativo y suma 1 a el asignado -void checkSign(int value, int *positive, int *negative) { - if (value > 0){ - *positive = *positive + 1; - } - else{ - *negative = * negative + 1; - } +int pResult(int _nNum,float _listNumbers[]){ + /* + It calculates the amount of positive numbers. + Args: + _nNum (int): Number of numbers + _listNumbers (vector): List of numbers + _pos (int): Ammount of positive numbers + Returns: + Ammount of positive numbers + */ + int _pos=0,i=0; + + while (i<_nNum){ + if (_listNumbers[i]==0){ + break; + } else if (_listNumbers[i]>0){ + _pos+=1; + } + i+=1; + } + + return _pos; } -/* -Autor: Raul Rivadeneyra -Entradas: Numeros enteros -Salidas: Cuantos numeros positivos y negativos hay -Proceso general: lee numeros enteros del usuario y si es positivo le suma uno al contador de positivos y lo similar -si es negativo. -*/ - -#include "stdio.h" - -void process(int*, int*); -char getNumbers(int*); -void checkSign(int, int*, int*); - -int main() { - int positive = 0; - int negative = 0; - - //Da instrucciones al usuario - printf("Insert numbers to check how many positives or negatives are (type 0 to stop):\n"); - - //Proceso - process(&positive, &negative); - - //Imprime el resultado - printf("There are %d positive numbers and %d negative numbers\n", positive, negative); - return 0; +int nResult(int _nNum,float _listNumbers[]){ + /* + It calculates the amount of negative numbers. + Args: + _nNum (int): Number of numbers + _listNumbers (vector): List of numbers + _neg (int): Ammount of negative numbers + Returns: + Ammount of negative numbers + */ + int _neg=0,i=0; + + while (i<_nNum){ + if (_listNumbers[i]==0){ + break; + } else if (_listNumbers[i]<0){ + _neg+=1; + } + i+=1; + } + + return _neg; } -//Funciones// - -//Combina las funciones de getNumber y checkSign en un ciclo -void process(int *positive, int *negative) { - int number; - while (getNumbers(&number) == 0) { - checkSign(number, positive, negative); - } -} - -/* -Lee numeros enteros y le asigna el valor directamente a la variable externa (paso por referencia), -si el numero es 0 entonces devuelve 1 para finalizar el ciclo donde se llamo, de lo contrario hace -return 0 por lo que sigue el ciclo -*/ -char getNumbers(int *number) { - scanf("%d", number); - if (*number == 0){ - return 1; - } - return 0; +void printResult(int _pos,int _neg){ + /* + It print the amount of positive and negative numbers + Args: + _pos (int): Copy of the value of the positive numbers + _neg (int): Copy of the value of the negative numbers + Returns: + Nothing + */ + printf("%d %d",_pos,_neg); } - -//Evalua si el numero dado es postitivo o negativo y suma 1 a el asignado -void checkSign(int value, int *positive, int *negative) { - if (value > 0){ - *positive = *positive + 1; - } - else{ - *negative = * negative + 1; - } -} - -/* -QA: Realizó: Jose Mendez -Entradas: (5, -6, 9, -7, 99, -99 , 0) -Salidas: 3 positivps y 3 negativos -Funciona Correctamente. -*/ diff --git a/Unidad 3-Funciones/Ejercicio48.c b/Unidad 3-Funciones/Ejercicio48.c index d0a5baf..bf9525e 100644 --- a/Unidad 3-Funciones/Ejercicio48.c +++ b/Unidad 3-Funciones/Ejercicio48.c @@ -1,116 +1,125 @@ /* -Autor: Eyder Concha Moreno 16/Febrero/19 -Entradas: sueldo base, antiguedad en la empresa -Salidas: Incentivo, sueldo total y sueldo base, o error por entradas incorrectas - -Procedimiento general: -1.-Preguntamos el número de años de antiguedad -2.-Preguntamos antiguedad del empleado -3.-Verificamos si los datos ingresados son válidos -4.-Con su antiguedad, determinamos el porcentaje a otorgar -5.-Definimos el incentivo con el porcentaje obtenido -6.-Calculamos el sueldo total -7.-Asignamos un mensaje de salida de acuerdo a lo escrito por el usuario +Author Joshua Immanuel Meza Magana +Version 1.0 +Program who add a little amount of money to the salary of a worker depending on the time he has worked on the company. */ #include -#include -void entradas(float*, int*); -int validacionValores(float, int); -float calculoIncentivo(float, int); -float calculoSueldoTotal(float, float); -void salidas(int, float, float, float); - -int main() -{ - /*Entradas*/ - - float sueldoBase; - int antiguedad; - - float incentivo; - float sueldoTotal; - - int cantidadValida; - - /*Procedimiento*/ - printf("Ingresa el sueldo base y la antiguedad en la empresa respectivamente\n"); - entradas(&sueldoBase, &antiguedad); +int readAge(); +float readMoney(); +float calculateExtra(int,float); +void printResult(float); + +int main() { + + /*Input + It receives the values. + Args: + age (int): Age of the worker + money (float): Salary of the worker + total (float): New total amount of money + */ + int age=0; + float money=0,total=0; + age=readAge(); + money=readMoney(); + + /*Process + It calculates the new total. + Args: + age (int): Age of the worker + money (float): Salary of the worker + total (float): New total amount of money + */ + total=calculateExtra(age,money); + + /*Output + It prints the result. + Args: + total (float): New total amount of money + */ + printResult(total); + + return 0; +} - //Comprobamos si valores ingresados son validos - cantidadValida = validacionValores(sueldoBase, antiguedad); +/* Functions */ - //Determinamos incentivo y sueldo total - incentivo = calculoIncentivo(sueldoBase, antiguedad); - sueldoTotal = calculoSueldoTotal(sueldoBase, incentivo); +int readAge(){ + /* + It reads the age of the worker. + Args: + _age (int): Value of the age of the worker + Returns: + The age of the worker + */ + int _age=0; - //Con base a la validación, determinamos la salida - salidas(cantidadValida, sueldoTotal, sueldoBase, incentivo); + scanf("%d",&_age); - return 0; -} + if (_age<0 || _age>15 || _age==0){ + while (_age<0 || _age>15 || _age==0){ + scanf("%d",&_age); + } + } -void entradas(float* sueldoBase, int* antiguedad){ - scanf("%f", sueldoBase); - scanf("%d", antiguedad) !=2; + return _age; } -void salidas(int cantidadValida, float sueldoTotal, float sueldoBase, float incentivo){ - if(cantidadValida){ - printf("El sueldo total es de: $ %f \nEl sueldo base es de: $ %f \nEl incentivo es de: %f", sueldoTotal, sueldoBase, incentivo); - } else { - printf("Entrada invalida"); +float readMoney(){ + /* + It reads the salary of the worker. + Args: + _money (float): Salary of the worker + Returns: + The salary of the worker + */ + float _money=0; + + scanf("%f",&_money); + + if (_money<0){ + while (_money<0){ + scanf("%f",&_money); } -} + } -float calculoSueldoTotal(float sueldoBase, float incentivo){ - float suma = sueldoBase + incentivo; - return suma; + return _money; } -float calculoIncentivo(float sueldoBase, int antiguedad){ - float porcentajeIncentivo; - float incentivo; - - // Determinamos el incentivo con base a la antiguedad - if(antiguedad < 1){ - porcentajeIncentivo = 0; - - } else if(antiguedad < 4){ - porcentajeIncentivo = .01; - - } else if(antiguedad < 7){ - porcentajeIncentivo = .03; - - } else if(antiguedad < 10){ - porcentajeIncentivo = .05; - - } else { - porcentajeIncentivo = .07; - } - - incentivo = porcentajeIncentivo * sueldoBase; - return incentivo; +float calculateExtra(int _age,float _money){ + /* + It calculates the total new amount of money. + Args: + _age (int): Age of the worker + _money (float): Normal amount of money + _total (float): New total amount of money + Returns: + The new total amount of money + */ + float _total=0; + + if (_age>=1 && _age<=3){ + _total=_money*1.01; + } else if (_age>=4 && _age<=6){ + _total=_money*1.03; + } else if (_age>=7 && _age<=9){ + _total=_money*1.05; + } else if (_age>=10){ + _total=_money*1.07; + } + + return _total; } -int validacionValores(float sueldoBase, int antiguedad){ - // Se valida si las entradas leidas son validas - int cantidadValida = 1; - if(antiguedad <= 0 || sueldoBase <= 0){ - cantidadValida = 0; - } - return cantidadValida; +void printResult(float _total){ + /* + It prints the total of money. + Args: + _total (float): Total of money + Returns: + Nothing + */ + printf("%f",_total); } -/* -Autor QA: Jimmy Nathan Ojeda Arana -Entradas: 1000,8 -Salidas: El sueldo total es de: $ 1050.000000 El sueldo base es de: $ 1000.000000 El incentivo es de: 50.000000 -Proceso: OK -Modularización: OK. El main no puede estar más simple. - Función entradas: OK - Función validacionValores: OK - Función calculoIncentivo: OK - Función calculoSueldoTotal: OK - Función salidas: OK -*/ diff --git a/Unidad 3-Funciones/Ejercicio48.py b/Unidad 3-Funciones/Ejercicio48.py index 42470eb..45894c8 100644 --- a/Unidad 3-Funciones/Ejercicio48.py +++ b/Unidad 3-Funciones/Ejercicio48.py @@ -17,15 +17,15 @@ def readAge(): _age=int(input()) - if _age<0 or _age>15: - while _age<0 or _age>15: + if _age<0 or _age>15 or _age==0: + while _age<0 or _age>15 or _age==0: _age=int(input()) return _age def readMoney(): ''' - It reads the salary of the worker + It reads the salary of the worker. Args: _money (float): Salary of the worker Returns: @@ -43,7 +43,7 @@ def readMoney(): def calculateExtra(_age,_money): ''' - It calculates the total new amount of money + It calculates the total new amount of money. Args: _age (int): Age of the worker _money (float): Normal amount of money @@ -62,16 +62,13 @@ def calculateExtra(_age,_money): if _age>=7 and _age<=9: _total=_money*1.05 else: - if _age>=10: - _total=_money*1.07 - else: - _total=_money + _total=_money*1.07 return _total def printResult(_total): ''' - It prints the total of money + It prints the total of money. Args: _total (float): Total of money Returns: @@ -106,5 +103,7 @@ def printResult(_total): #Output ''' It prints the result. + Args: + total (float): New total amount of money ''' printResult(total) From 6757a898bd762fb82459357068a62e078a178db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20G=C3=B3mez?= Date: Wed, 19 Feb 2020 22:47:58 -0600 Subject: [PATCH 13/22] Update Ejercicio13.c Ya funciona --- Unidad 3-Funciones/Ejercicio13.c | 59 +++++++++++++++----------------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/Unidad 3-Funciones/Ejercicio13.c b/Unidad 3-Funciones/Ejercicio13.c index 7a6877c..63f2aae 100644 --- a/Unidad 3-Funciones/Ejercicio13.c +++ b/Unidad 3-Funciones/Ejercicio13.c @@ -4,50 +4,45 @@ #include -int hora(); -int traducirHora(int); -void imprimirHora(int); +int readHour(int); +void traduceHour(int, int, float, int); + int main(){ // Entrada de la hora - int horaOriginal; - horaOriginal = hora(); - traducirHora(horaOriginal); - imprimirHora(horaOriginal); + int originalHour, horas, amPm, min; + originalHour = readHour(originalHour); + traduceHour(originalHour, horas, min, amPm); } - - - // Reeds the hour -int hora(){ - int horaMilitar = 0; - scanf("%d",&horaMilitar); - return horaMilitar; +int readHour(int originalHour){ + scanf("%d",&originalHour); + return originalHour; } // Translate the hour -int traducirHora(int horaOriginal){ - int amPm = 0; - int horas = 0; - int minutos = 0; +void traduceHour(int originalHour, int horas, float min, int amPm){ + //Determinate am/pm - amPm = 'am'; - + amPm=0; //Gets the firts 2 numbers - horas = horaOriginal % 100; - + horas = originalHour / 100; // Gets the las 2 numbers - minutos = horaOriginal - (horaOriginal % 100 ) * 100; + min = originalHour - (originalHour / 100 ) * 100; // Translate the format - if (horas > 12) + if (horas > 12) { horas = horas - 12; - amPm = 'pm'; - return ("%d : %d %d",horas, minutos, amPm); -} - -//Print the translated hour -void imprimirHora(int horaOriginal){ - printf(horaOriginal); -} \ No newline at end of file + amPm=1; + } + + //Print the translated hour + if (amPm==0){ + printf("%d : %1.2d am", horas, min); + } else + { + printf("%d : %1.2d pm", horas, min); + } + +} \ No newline at end of file From c1b7ebffd2eb9c832f2f4c5a6e0c835c8d7c3039 Mon Sep 17 00:00:00 2001 From: Aldebaran <56288948+AldebaranLP@users.noreply.github.com> Date: Wed, 19 Feb 2020 23:16:34 -0600 Subject: [PATCH 14/22] PY DOC --- Unidad 3-Funciones/Ejercicio25.py | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Unidad 3-Funciones/Ejercicio25.py diff --git a/Unidad 3-Funciones/Ejercicio25.py b/Unidad 3-Funciones/Ejercicio25.py new file mode 100644 index 0000000..37b67f6 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio25.py @@ -0,0 +1,57 @@ +''' +Author: Aldebaran Lira +Version 0.0 +Find the ASCII-code +''' + +#Functions + +#Int +def readLetter(): + ''' + It reads a letter from the alphabet + Args: + _letter (str): Value of the variable + Returns: + A letter of the alphabet + ''' + _letter = str(input()) + + return _letter + +#Process +def findASCIIcode(_letter): + ''' + It searches for the corresponding code + Args: + _letter (str): A letter of the alphabet + _code (int): ASCII-code + Returns: + The correspondinf code + ''' + _code=ord(_letter) + + return _code + +#Output +def printResult(_code): + ''' + It prints the corresponding code + Args: + _code (int):The corresponding code + Returns: + Nothing + ''' + print(_code) + + +#Input +code=0 +letter=0 +letter=readLetter() + +#Process +code=findASCIIcode(letter) + +#Output +printResult(code) From c30c9e8bd4605c1383d9f8f54926d16edbb89fc3 Mon Sep 17 00:00:00 2001 From: Ivan Farid Espadas Escalante Date: Wed, 19 Feb 2020 23:56:10 -0600 Subject: [PATCH 15/22] Ejercicios 31 y 37 Autor Farid Espadas --- .vscode/settings.json | 5 +++ .../Prueba_1-7_C/pefmat-ejercicio2.c | 24 ++++++++++++++ .../Prueba_1-7_C/prueba_c.exe | Bin 0 -> 42774 bytes Unidad 3-Funciones/Ejercicio 37.c | 30 ++++++++++++++++++ Unidad 3-Funciones/Ejercicio 37.py | 0 Unidad 3-Funciones/Ejercicio 31.PY | 14 ++++++++ Unidad 3-Funciones/Ejercicio 31.c | 22 +++++++++++++ 7 files changed, 95 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 Unidad 2-Estructuras de Control/Prueba_1-7_C/pefmat-ejercicio2.c create mode 100644 Unidad 2-Estructuras de Control/Prueba_1-7_C/prueba_c.exe create mode 100644 Unidad 3-Funciones/Ejercicio 37.c create mode 100644 Unidad 3-Funciones/Ejercicio 37.py create mode 100644 Unidad 3-Funciones/Ejercicio 31.PY create mode 100644 Unidad 3-Funciones/Ejercicio 31.c diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0f06797 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "stdio.h": "c" + } +} \ No newline at end of file diff --git a/Unidad 2-Estructuras de Control/Prueba_1-7_C/pefmat-ejercicio2.c b/Unidad 2-Estructuras de Control/Prueba_1-7_C/pefmat-ejercicio2.c new file mode 100644 index 0000000..003f4fb --- /dev/null +++ b/Unidad 2-Estructuras de Control/Prueba_1-7_C/pefmat-ejercicio2.c @@ -0,0 +1,24 @@ +#include + +int main (){ + //Holi clase :v + + float aNum, bNum; + + scanf("%f",&aNum); + scanf("%f",&bNum); + + if (aNum > bNum){ + printf("%.1f > %.1f",aNum,bNum); + } + else if (aNum < bNum){ + printf("%.1f > %.1f",bNum,aNum); + + } + else{ + printf("Son iguales"); + } + + //Holi clase :v + return 0; +} diff --git a/Unidad 2-Estructuras de Control/Prueba_1-7_C/prueba_c.exe b/Unidad 2-Estructuras de Control/Prueba_1-7_C/prueba_c.exe new file mode 100644 index 0000000000000000000000000000000000000000..58d8724bfc876eac890b6d6582e00532071c3aac GIT binary patch literal 42774 zcmeHw3w#t+miMjhPSTK&?m&2`Q5&XFPzVVG1P8S9=sYAZ^WY(15t0sM=sc!V4JabP zPL$f7%w}i&cHD2BRn*yacKk+X#|38ebHc*}UB`)t4l1LJGTJfdu;?HUhkXBYZ&g=U zIZa_D9%f~X*>DaIGqx93Iz0UM@;@EOPQCW$ zsqEP?znr>PD*ffunhj0uuC_qy`aoT?tG=$KrB!jQ^SJ`S7FSb?tDvIV)!f?P%N#du ztXpGU>1C``N@c%%EcZ^fg|XKq#*VWjDOs|(SSFBe!)ak`U_7o)oF1I?L-&A_+#ums zTo`j91>n9<7}pB`flCBLgG0NBLNVo-_XO0Hj zFb06NILG3=8E4Evc$w?k+X>Vb{fR-)Zab*lCQ&Z8VFxm(+yV_jyKwpPt7<68_2|J3 z=|OcHb8tMx&&zcY{85~QSBf*{AiO!*LXm|8e+DPvl~ckvJj|0fXYL{n$h!uYUYstR zWS^MB!<>0@a!8go#T&AFw_cP>i`D@kRRfkTd@ABX7 zfrXU}$U~-QBp109%A@4)K<%Z2II{-H@&4lX{>1Ahi8nR|HRgAgk699i<&>xe?|r+k<} z&;MI<{_yl(Q0WAl*zojcknV{dsE=i+5GR;(?5aE095CeT zPask{UZ9_$|EXsQm3ts>=;V}LgajGK=u8K8k!*k@Qw@AEgDdgUfgX;3;#BBlR>T7D zp{k(T16cvYj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m%$-(0xS|!uI zMOw=h6%^fCmuO4ukicO4hq z(FPd}4I@Wu=nWcMM-L98ZK}>yjc(OFqM64AZBZqPp$v3uM%&1vy&ypsjph{LbqAv< z1wQ&B7Z8IUo}sNRM4fhh%*N!fv}PJ3oQ-f_Qygv&w(4Q{vOOPMDrP*Yi>M8?xK#gE zAAX5HMW}aYO=JvHtfAf2=+7BqcTCY$@?!Ko#D!V3(I46m-}hWIi8lG6cCcY%yRuPk zrdFm0h>gBLi_eb@VCn#jZ3r>`q&+gxqo7ecv3)I^f>(HX!NK0L^<#ExqmE!*eoM7bd literal 0 HcmV?d00001 diff --git a/Unidad 3-Funciones/Ejercicio 37.c b/Unidad 3-Funciones/Ejercicio 37.c new file mode 100644 index 0000000..7f2a6f1 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio 37.c @@ -0,0 +1,30 @@ +#include + +int main() +{ + int i, j, n, sum = 0, es_primo = 1; + + scanf("%d", &n); + + for (i = 2; n > 0; i++) //a partir de dos están los primos + { + for (j = 2; j < i; j++) + { + if (i%j == 0) + { + es_primo = 0; + break; + } + } + + if (es_primo) + { + sum += i; + n--; + } + + es_primo = 1; + } + + printf("%d", sum); +} diff --git a/Unidad 3-Funciones/Ejercicio 37.py b/Unidad 3-Funciones/Ejercicio 37.py new file mode 100644 index 0000000..e69de29 diff --git a/Unidad 3-Funciones/Ejercicio 31.PY b/Unidad 3-Funciones/Ejercicio 31.PY new file mode 100644 index 0000000..ccec8b8 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio 31.PY @@ -0,0 +1,14 @@ +i = 0 +cont = 0 +num = 0 + +num = int(input()) + +for i in range(1, num): + if num%i == 0: + cont = cont + 1 + +if cont == 2: + print("Es primo") +else: + print("No es primo") \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio 31.c b/Unidad 3-Funciones/Ejercicio 31.c new file mode 100644 index 0000000..3a227b8 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio 31.c @@ -0,0 +1,22 @@ +#include + +int main (){ + + int num, i, cont = 0; + + scanf("%d",&num); + + for (i = 1; i <= num; i++){ + + if(num%i == 0){ + cont = cont + 1; + } + } + + if (cont > 2 || num == 1 ){ + printf("No es primo"); + } + else{ + printf("Es primo"); + } +} \ No newline at end of file From 8e56f53763c92829c58f6a600a0039389df519d0 Mon Sep 17 00:00:00 2001 From: Ivan Farid Espadas Escalante Date: Thu, 20 Feb 2020 10:19:47 -0600 Subject: [PATCH 16/22] Modificacion logica matematica Autor: Ivan Farid Espadas --- Unidad 3-Funciones/Ejercicio 37.py | 0 Unidad 3-Funciones/Ejercicio 31.PY | 2 +- .../{Ejercicio 37.c => Ejercicio 37.c} | 0 Unidad 3-Funciones/Ejercicio 37.py | 27 +++++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) delete mode 100644 Unidad 3-Funciones/Ejercicio 37.py rename Unidad 3-Funciones/{Ejercicio 37.c => Ejercicio 37.c} (100%) create mode 100644 Unidad 3-Funciones/Ejercicio 37.py diff --git a/Unidad 3-Funciones/Ejercicio 37.py b/Unidad 3-Funciones/Ejercicio 37.py deleted file mode 100644 index e69de29..0000000 diff --git a/Unidad 3-Funciones/Ejercicio 31.PY b/Unidad 3-Funciones/Ejercicio 31.PY index ccec8b8..1683a7b 100644 --- a/Unidad 3-Funciones/Ejercicio 31.PY +++ b/Unidad 3-Funciones/Ejercicio 31.PY @@ -4,7 +4,7 @@ num = 0 num = int(input()) -for i in range(1, num): +for i in range(1, num+1): if num%i == 0: cont = cont + 1 diff --git a/Unidad 3-Funciones/Ejercicio 37.c b/Unidad 3-Funciones/Ejercicio 37.c similarity index 100% rename from Unidad 3-Funciones/Ejercicio 37.c rename to Unidad 3-Funciones/Ejercicio 37.c diff --git a/Unidad 3-Funciones/Ejercicio 37.py b/Unidad 3-Funciones/Ejercicio 37.py new file mode 100644 index 0000000..651c335 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio 37.py @@ -0,0 +1,27 @@ +i = 0 +j = 0 +n = 0 +sum = 0 +es_primo = 1 + +n = int(input()) + +for i in range(2,n): + + for j in range(2,i): + + if i % j == 0: + + es_primo = 0 + + break + + if es_primo: + + sum += i + + n = n - 1 + + es_primo = 1 + +print (sum) From 92401eb8f4a7d77cb5dd77dde8726c6cdb46322d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Immanuel=20Meza=20Maga=C3=B1a?= <56287951+JoshuaMeza@users.noreply.github.com> Date: Sun, 23 Feb 2020 15:11:43 -0600 Subject: [PATCH 17/22] PYDOC WORKS --- Unidad 3-Funciones/Ejercicio43.py | 82 +++++++------ Unidad 3-Funciones/Ejercicio48.py | 115 +++++++++--------- .../__pycache__/Ejercicio43.cpython-38.pyc | Bin 2640 -> 2966 bytes .../__pycache__/Ejercicio48.cpython-38.pyc | Bin 1053 -> 2262 bytes 4 files changed, 103 insertions(+), 94 deletions(-) diff --git a/Unidad 3-Funciones/Ejercicio43.py b/Unidad 3-Funciones/Ejercicio43.py index c87c1a4..437d589 100644 --- a/Unidad 3-Funciones/Ejercicio43.py +++ b/Unidad 3-Funciones/Ejercicio43.py @@ -1,18 +1,18 @@ -''' +""" Author Joshua Immanuel Meza Magana Version 1.0 Program who count how many positive and negative numbers are on N numbers, 0 break the count. -''' +""" #Functions def specifyNumbers(): - ''' + """ It gets the N numbers that we will count. Args: _N (int): Value of the number of numbers Returns: The N numbers that will be counted - ''' + """ _N=0 _N=int(input()) @@ -24,7 +24,7 @@ def specifyNumbers(): return _N def inputNumbers(_N): - ''' + """ Get a vector of the numbers that we will compare. Args: _N (int): Number of numbers @@ -33,7 +33,7 @@ def inputNumbers(_N): con (int): Counter Returns: Values of the list of numbers - ''' + """ _listNumbers=[] num=0 con=0 @@ -50,7 +50,7 @@ def inputNumbers(_N): return _listNumbers def pResult(_N,_listNumbers): - ''' + """ It calculates the amount of positive numbers. Args: _N (int): Number of numbers @@ -58,7 +58,7 @@ def pResult(_N,_listNumbers): _pos (int): Ammount of positive numbers Returns: Ammount of positive numbers - ''' + """ _pos=0 for x in _listNumbers: @@ -68,7 +68,7 @@ def pResult(_N,_listNumbers): return _pos def nResult(_N,_listNumbers): - ''' + """ It calculates the amount of negative numbers. Args: _N (int): Number of numbers @@ -76,7 +76,7 @@ def nResult(_N,_listNumbers): _neg (int): Ammount of negative numbers Returns: Ammount of negative numbers - ''' + """ _neg=0 for x in _listNumbers: @@ -87,43 +87,47 @@ def nResult(_N,_listNumbers): def printResults(_pos,_neg): - ''' + """ It print the amount of positive and negative numbers Args: _pos (int): Copy of the value of the positive numbers _neg (int): Copy of the value of the negative numbers Returns: Nothing - ''' + """ print(_pos) print(_neg) -#Input -''' -It recives the N amount of numbers, and then it reads them. - Args: - N (int): Number of numbers - listNumbers (list): List of numbers -''' -N=0 -listNumbers=[] -N=specifyNumbers() -listNumbers.extend(inputNumbers(N)) +def main(): + #Input + """ + It recives the N amount of numbers, and then it reads them. + Args: + N (int): Number of numbers + listNumbers (list): List of numbers + """ + N=0 + listNumbers=[] + N=specifyNumbers() + listNumbers.extend(inputNumbers(N)) + + #Process + """ + Calculate how many positive and negative numbers are on the N numbers. + Args: + pos (int): Ammount of positive numbers + neg (int): Amount of negative numbers + N (int): Number of numbers + listNumbers (list): List of numbers + """ + pos=pResult(N,listNumbers) + neg=nResult(N,listNumbers) -#Process -''' -Calculate how many positive and negative numbers are on the N numbers. - Args: - pos (int): Ammount of positive numbers - neg (int): Amount of negative numbers - N (int): Number of numbers - listNumbers (list): List of numbers -''' -pos=pResult(N,listNumbers) -neg=nResult(N,listNumbers) + #Output + """ + Print the results. + """ + printResults(pos,neg) -#Output -''' -Print the results. -''' -printResults(pos,neg) +if __name__=="__main__": + main() diff --git a/Unidad 3-Funciones/Ejercicio48.py b/Unidad 3-Funciones/Ejercicio48.py index 45894c8..b3a08f3 100644 --- a/Unidad 3-Funciones/Ejercicio48.py +++ b/Unidad 3-Funciones/Ejercicio48.py @@ -1,18 +1,19 @@ -''' +""" Author Joshua Immanuel Meza Magana Version 1.0 -Program who add a little amount of money to the salary of a worker depending on the time he has worked on the company. -''' +Program who add a little amount of money to the salary of a worker +depending on the time he has worked on the company. +""" #Functions def readAge(): - ''' + """ It reads the age of the worker. - Args: - _age (int): Value of the age of the worker - Returns: - The age of the worker - ''' + Args: + _age (Int): Value of the age of the worker + Returns: + The age of the worker + """ _age=0 _age=int(input()) @@ -24,13 +25,13 @@ def readAge(): return _age def readMoney(): - ''' + """ It reads the salary of the worker. - Args: - _money (float): Salary of the worker - Returns: - The salary of the worker - ''' + Args: + _money (Float): Salary of the worker + Returns: + The salary of the worker + """ _money=0 _money=float(input()) @@ -42,15 +43,15 @@ def readMoney(): return _money def calculateExtra(_age,_money): - ''' + """ It calculates the total new amount of money. - Args: - _age (int): Age of the worker - _money (float): Normal amount of money - _total (float): New total amount of money - Returns: - The new total amount of money - ''' + Args: + _age (Int): Age of the worker + _money (Float): Normal amount of money + _total (Float): New total amount of money + Returns: + The new total amount of money + """ _total=float(0) if _age>=1 and _age<=3: @@ -67,43 +68,47 @@ def calculateExtra(_age,_money): return _total def printResult(_total): - ''' + """ It prints the total of money. - Args: - _total (float): Total of money - Returns: - Nothing - ''' + Args: + _total (Float): Total of money + Returns: + Nothing + """ print(_total) -#Input -''' -It receives the values. +def main(): + #Input + """ + It receives the values. Args: - age (int): Age of the worker - money (float): Salary of the worker - total (float): New total amount of money -''' -age=0 -money=0 -total=0 -age=int(readAge()) -money=float(readMoney()) + age (Int): Age of the worker + money (Float): Salary of the worker + total (Float): New total amount of money + """ + age=0 + money=0 + total=0 + age=int(readAge()) + money=float(readMoney()) -#Process -''' -It calculates the new total. + #Process + """ + It calculates the new total. Args: - age (int): Age of the worker - money (float): Salary of the worker - total (float): New total amount of money -''' -total=float(calculateExtra(age,money)) + age (Int): Age of the worker + money (Float): Salary of the worker + total (Float): New total amount of money + """ + total=float(calculateExtra(age,money)) -#Output -''' -It prints the result. + #Output + """ + It prints the result. Args: - total (float): New total amount of money -''' -printResult(total) + total (Float): New total amount of money + """ + printResult(total) + +if __name__=="__main__": + main() diff --git a/Unidad 3-Funciones/__pycache__/Ejercicio43.cpython-38.pyc b/Unidad 3-Funciones/__pycache__/Ejercicio43.cpython-38.pyc index 552127bc76039d795f40db67d543f28a3fa22e3a..113a549ffbf9a9abba012a1e794bd5cae18d00e9 100644 GIT binary patch delta 433 zcmYjLze~eF6u!G$l56@)YoSmC4;?hr#l=xXL2${SxO6bY=B!b3mCIE`5<0|xKmrcp zpsSmIhJ)aowf~5BRiqET@80*`_ujkj_EV>KQm;Ee#pm?sbh`$?REzmQO6)2m2amn2 zZdiK&eT&&){R)XaX5|2auyG9B=ErldG8xQIVkI>8_4JOS5N2QqGAKa~GLXVoC{YS> z_y!@6Mye_~%8aVV)^gXoqeR9-OZ(I6g;xum0WO8GcG zVa*qvlN6jdceL(_t$mLeCI z(Cb&PqeObY`%B|yl#~W%Lt$#yj4YLvI1VDtRF>!+fMAHB1shcdI+o~Y2l0LF@v-l@ hr1+|=Hvj89h?(yfi_ThGAICOnk*>lLsgV@|e*kkGT(JNE delta 199 zcmbOxenCV#l$V!_0SGG2`NmD;vfSSAjbiSi?b$b8`?#&r87jar!qD(M6so^ zFW^XJN@Z(iT*%1Ckjk726lrFP;!I_Mvba)NQ#n()nwc0GQh0(HG)QEF#=8V z)8wA4$E~Dvi_tHNJ14Wa#IH0rDYdBh7F%jXNorooE#`v!;#V1lp}X z_dow`fsns(GTkhgd<=iS4xJzkBB-#wAq^^Q;efP+D@q`3Q5GIZM=S^*q$^8ev16&4 zbbEvnvGjmcmb*Xtn}u#?irvfdcEQ8pw;?{lRC@b~RIyi`*QNhZ3)W=N(?8YJ4_TnAgk*SG3S; zbvMM^ryw+<~fEu08qDct%?8+!3A#~q>{HS_#+Am{1HbV)_B>56_#B(g)x=C-+B};iQzZ$42Smyzy zZV!P`x2J%(VSupa0WqP}ORyLcadjuoIO6eOOvTB%7oadNi~&L+{Qv{^32v+$oY8)% zWx^Q@hFuv9{RK?e9=?b-U^#)ewbC`vx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TRSn6l8=&5D9iPMM& Qb$pG$bvb=CUUR0LU*v?<5&!@I From 72d7e520b4577d828455b12599b2fe562e6456cc Mon Sep 17 00:00:00 2001 From: Irving Poot Date: Sun, 23 Feb 2020 18:41:47 -0600 Subject: [PATCH 18/22] PyDoc y Correccion --- Unidad 3-Funciones/Ejercicio13.c | 52 ++++++++------- Unidad 3-Funciones/Ejercicio13.py | 104 ++++++++++++++++++++++++++---- Unidad 3-Funciones/Ejercicio19.py | 104 +++++++++++++++++++++++++----- 3 files changed, 210 insertions(+), 50 deletions(-) diff --git a/Unidad 3-Funciones/Ejercicio13.c b/Unidad 3-Funciones/Ejercicio13.c index 691a7b1..4f3b1d6 100644 --- a/Unidad 3-Funciones/Ejercicio13.c +++ b/Unidad 3-Funciones/Ejercicio13.c @@ -5,14 +5,20 @@ #include int readHour(int); -void traduceHour(int, int, float, int); +char traduceHour(int, char); +int translateHour(int) +int translateMinutes(int) +void printHour(int, int, char) int main(){ // Entrada de la hora - int originalHour, horas, amPm, min; + int originalHour, hour, amPm, min; originalHour = readHour(originalHour); - traduceHour(originalHour, horas, min, amPm); + hour = traduceHour(originalHour); + min = translateMinutes(originalHour); + amPm = traduceHour(amPm, hour); + printHour(hour, min, amPm); } // Reeds the hour @@ -21,27 +27,29 @@ int readHour(int originalHour){ return originalHour; } +int translateHour(int originalHour){ + hour = originalHour / 100; + return hour +} + +int translateMinutes(int originalHour){ + min = originalHour - (originalHour / 100 ) * 100 + return min +} + // Translate the hour -void traduceHour(int originalHour, int horas, float min, int amPm){ - - //Determinate am/pm - amPm=0; - //Gets the firts 2 numbers - horas = originalHour / 100; - // Gets the las 2 numbers - min = originalHour - (originalHour / 100 ) * 100; - // Translate the format - if (horas > 12) { - horas = horas - 12; - amPm=1; +char traduceHour(char amPm, int hour){ + + amPm= "am"; + if (hour > 12) { + hour = hour - 12; + amPm= "pm"; } - + return amPm +} + +void printHour(int hour, int min, char amPm){ //Print the translated hour - if (amPm==0){ - printf("%d : %1.2d am", horas, min); - } else - { - printf("%d : %1.2d pm", horas, min); - } + printf("%1.2d : %1.2d %c", hour, min, amPm); } \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio13.py b/Unidad 3-Funciones/Ejercicio13.py index 7d06770..891c66f 100644 --- a/Unidad 3-Funciones/Ejercicio13.py +++ b/Unidad 3-Funciones/Ejercicio13.py @@ -1,21 +1,99 @@ -#Autor Irving Eduardo Poot Moo -#Version 1.0 -#Program who translate a militar hour to a normal hour +''' +Author Irving Eduardo Poot Moo +Version 1.0 +Program who translate a military hour to a normal hour +''' -#Translation Process -def timeTranslate(time): - amPm = "am" - hours = time // 100 - minutes = time - (time // 100)*100 +def inputNumber(): + ''' + It gets the military hour that we will translate + Args: + N (int):Value of the military hour + Returns: + The original hour + ''' + N = 0 + N = int(input()) + return N + - +def timeTranslate(hours): + ''' + Determinate if the given hour is Am or Pm + Args: + amPm (char): Default time + hours (int): previously modified hour + Returns: + The modified time + ''' + amPm = "am" if (hours > 12): hours = hours - 12 amPm = "pm" - return (str(hours).zfill(2)+":"+str(minutes).zfill(2)+ " " + amPm) + return amPm + +def hoursTranslate(time): + ''' + Gets the hours from the military time + Args: + time (int): The original hour + hours (int): The hours of the original hour + Returns: + The modified hours + ''' + hours = time // 100 + return hours + +def minutesTranslate(time): + ''' + Gets the minutes from the military time + Args: + time (int): The original hour + minutes (int): The minutes of the original hour + Returns: + The modified minutes + ''' + minutes = time - (time // 100)*100 + return minutes + +def printHour(hours, minutes, amPm): + ''' + Print the translated hour + Args: + hours (int): The hours of the original hour + minutes (int): The minutes of the original hour + amPm (char): Determinated time + Returns: + Nothing + ''' + print(str(hours).zfill(2)+":"+str(minutes).zfill(2)+ " " + amPm) + +#Input +''' +It recives the military hour + Args: + time (int): Given hour +''' + +time = inputNumber() + +#Process +''' +Translate the militry hour step by step, beggining from the time to the hours and finally the minutes + Args: + time (int): Given hour + hours (int): Translated hours + minutes (int): Translated minutes + amPM (char): Translated time +''' +hours = hoursTranslate(time) +minutes = minutesTranslate(time) +amPm = timeTranslate(time) -#Main Process -time = int(input()) -print(timeTranslate(time)) \ No newline at end of file +#Output +''' +Print the translated hour +''' +printHour(hours, minutes, amPm) \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio19.py b/Unidad 3-Funciones/Ejercicio19.py index a86444c..800f733 100644 --- a/Unidad 3-Funciones/Ejercicio19.py +++ b/Unidad 3-Funciones/Ejercicio19.py @@ -1,23 +1,97 @@ -#Autor Irving Eduardo Poot Moo -#Version 1.0 -#Program who Program who compare two nombers and print the bigger -#Determinate -numMayor = 0 -num1 = 0 -num2 = 0 -num3 = 0 - -#Comparing numbers +''' +Author Irving Eduardo Poot Moo +Version 1.0 +Program who translate a military hour to a normal hour +''' + +def inputNum1(): + ''' + It gets the first number that we will compare + Args: + num1 (float): First given number + Retuns: + The fisrt number + ''' + num1 = float(input()) + return num1 + +def inputNum2(): + ''' + It gets the second number that we will compare + Args: + num2 (float): Second given number + Retuns: + The second number + ''' + num2 = float(input()) + return num2 + +def inputNum3(): + ''' + It gets the third number that we will compare + Args: + num3 (float): Third given number + Retuns: + The third number + ''' + num3 = float(input()) + return num3 + + def comparisons(num1, num2, num3): + ''' + Compare all the numbers to get the biggest number + Args: + num1 (float): First given number + num2 (float): Second given number + num3 (float): Third given number + numMayor (float): The biggest number + Retuns: + The biggest number + ''' if num1 > num2 and num1 > num3: numMayor = num1 elif num2 > num1 and num2 > num3: numMayor = num2 else: numMayor = num3 - return ("El numero mayor es:", numMayor) + return (numMayor) + +def outputMayor(nunMayor): + ''' + Print the biggest number + Args: + numMayor (float): Second given number + Retuns: + Nothing + ''' + print("El numero mayor es: ", numMayor) + +#Inputs +''' +It recives the number to compare + Args: + num1 (float): First given number + num2 (float): Second given number + num3 (float): Third given number +''' +num1 = inputNum1() +num2 = inputNum2() +num3 = inputNum3() + +#Process +''' +Compares the tree given number to get the biggest + Args: + num1 (float): First given number + num2 (float): Second given number + num3 (float): Third given number + numMayor (float): The Biggest number +''' +numMayor = comparisons(num1, num2, num3) -num1 = float(input()) -num2 = float(input()) -num3 = float(input()) -print(comparisons(num1, num2, num3)) \ No newline at end of file +#Output +''' +Print the bigggest number +''' +outputMayor(numMayor) \ No newline at end of file From bd54bf2694e29c16ee5b4c328b094ed1c04ba5c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20G=C3=B3mez?= Date: Sun, 23 Feb 2020 20:52:22 -0600 Subject: [PATCH 19/22] Pydoc 1 y 7 Update --- Unidad 3-Funciones/Ejercicio1.py | 74 +++++++++++++++++++++--------- Unidad 3-Funciones/Ejercicio7.py | 78 +++++++++++++++++++++++--------- 2 files changed, 108 insertions(+), 44 deletions(-) diff --git a/Unidad 3-Funciones/Ejercicio1.py b/Unidad 3-Funciones/Ejercicio1.py index 9ae0396..614be41 100644 --- a/Unidad 3-Funciones/Ejercicio1.py +++ b/Unidad 3-Funciones/Ejercicio1.py @@ -1,40 +1,70 @@ -#Autor: Jonathan Gómez -#Version 1.0 -#Program that determines if an integer N number is even or odd +""" +Autor: Jonathan Gómez +Version 1.0 +Program that determines if an integer N number is even or odd +""" #Functions def readNumber(): - #Read the number which want to know is even or odd and returns the value to the original variable Number - + """ + Read the number which want to know is even or odd and returns the value to the original variable Number + Args: + _Number: Read the number which the user wants to know if is even or odd + Returns: + _Number: The value entered + """ _Number= int(input()) return _Number def calculateTypeNumber(_Number): - #Using the module function we compare the result with 0, that means _Number is even or odd + """ + Using the module function we compare the result with 0, that means _Number is even or odd #The _typeNumber is even when the module give us 0 and odd when is >0, in the moment when the _Number #is a even number the value of the flag change and if is not == 0 then the flag still being the same #This function returns the value of _typeNumber because we are going to use it for the output - - _typeNumber=0 - if _Number%2==0 : + Args: + typeNumber: Flag who determinates the type of _Number + _Number: The value entered by the user + Returns: + _typeNumber: The type of number, even or odd + """ + _typeNumber=0 + if _Number%2==0 : _typeNumber=1 - return _typeNumber + return _typeNumber def printTypeNumber(_typeNumber): - #Using the value of _typeNumber we have the output of our program - - print(_typeNumber) + """ + Using the value of _typeNumber we have the output of our program + Args: + _typeNumber: The final output with the type of number + """ + print(_typeNumber) -#Input: A integer Number -Number=0 -typeNumber=0 -Number=(readNumber()) +def main(): + #Input + """ + Number (int): A integer Number + typeNumber (int): Type number, even or odd + """ + Number=0 + typeNumber=0 + Number=(readNumber()) -#Process: Determines if the module of 2 of Number is 0, which means that is an even number -#Then the value of typeNumber change to 1, which for this program represents even and 0 represents odd -typeNumber= calculateTypeNumber(Number) + #Process + """ + Determines if the module of 2 of Number is 0, which means that is an even number + Then the value of typeNumber change to 1, which for this program represents even and 0 represents odd + """ + typeNumber= calculateTypeNumber(Number) -#Output: 1 for even Number or 0 for odd Number -printTypeNumber(typeNumber) \ No newline at end of file + #Output + """ + 1 for even Number or 0 for odd Number + """ + printTypeNumber(typeNumber) + +if __name__== "__main__": + main() \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio7.py b/Unidad 3-Funciones/Ejercicio7.py index c222fc7..03f7450 100644 --- a/Unidad 3-Funciones/Ejercicio7.py +++ b/Unidad 3-Funciones/Ejercicio7.py @@ -1,21 +1,32 @@ -#Autor: Jonathan Gómez -#Program that receives a positive number to which a percentage is added depending on its size. -#Version 1.0 - +""" +Autor: Jonathan Gómez +Program that receives a positive number to which a percentage is added depending on its size. +Version 1.0 +""" #Functions def readNumber (): - #Read the number which is going to use to calculate the percentage the program will add - #Returns the _Number - + """ + Read the number which is going to use to calculate the percentage the program will add + Args: + _Number (int): Value of the user + Returns: + The read _Number entered by the user + """ _Number=int(input()) return _Number def calculatepercentage (_Number): - #With if sentences the program determines how much percentage is going to add to the variable - #That percentage depends of how big is the number (1000=5%, 3000=10%, 5000=%5) - #The program would be add all the if sentences - + """ + With if sentences the program determines how much percentage is going to add to the variable + That percentage depends of how big is the number (1000=5%, 3000=10%, 5000=%5) + The program would be add all the if sentences + Args: + _Number: Value entered + _newNumber: New number after increase percentage + Returns: + _newNumber: Final output + """ _newNumber= _Number if _Number>1000: @@ -28,17 +39,40 @@ def calculatepercentage (_Number): return _newNumber def printNewNumber(_newNumber): - #Using the _newNumber the program print the output - - print(int(_newNumber)) + """ + Using the _newNumber the program print the output + Args: + _newNumber: Value after increase percentage + """ + print(int(_newNumber)) + +def main(): +#Input + """ + A integer Number and variable declarations + Args: + Number (int): The number wich is going to use to calculate the new value + newNumber (int): The new value of the Number + """ + Number=0 + newNumber=0 + Number=readNumber() -#Input:A integer Number and variable declarations -Number=0 -newNumber=0 -Number=readNumber() + #Process + """ + With the help of another adding variable, its value is modified based on the number entered by the user + Args: + newNumber: The new value after increase percentage + """ + newNumber= calculatepercentage(Number) -#Process:With the help of another adding variable, its value is modified based on the number entered by the user -newNumber= calculatepercentage(Number) + #Output + """ + The new value of newNumber, that is the result of the process + Args: + newNumber: Print the final output + """ + printNewNumber(newNumber) -#Output:The new value of newNumber, that is the result of the process -printNewNumber(newNumber) \ No newline at end of file +if __name__ == "__main__": + main() \ No newline at end of file From 4ee4ed9af69ac97e475e2d49b9f65cbc064151db Mon Sep 17 00:00:00 2001 From: Ivan Farid Espadas Escalante Date: Sun, 23 Feb 2020 22:16:53 -0600 Subject: [PATCH 20/22] Ejercicios Corregidos, 31 y 37 Ejercicios corregidos, 31 y 37 --- Unidad 3-Funciones/Ejercicio 31.PY | 14 ------- Unidad 3-Funciones/Ejercicio 31.c | 22 ----------- Unidad 3-Funciones/Ejercicio 37.c | 30 -------------- Unidad 3-Funciones/Ejercicio 37.py | 27 ------------- Unidad 3-Funciones/Ejercicio31.c.c | 57 +++++++++++++++++++++++++++ Unidad 3-Funciones/Ejercicio31.py.py | 28 ++++++++++++++ Unidad 3-Funciones/Ejercicio37.c.c | 58 ++++++++++++++++++++++++++++ Unidad 3-Funciones/Ejercicio37.py.py | 30 ++++++++++++++ 8 files changed, 173 insertions(+), 93 deletions(-) delete mode 100644 Unidad 3-Funciones/Ejercicio 31.PY delete mode 100644 Unidad 3-Funciones/Ejercicio 31.c delete mode 100644 Unidad 3-Funciones/Ejercicio 37.c delete mode 100644 Unidad 3-Funciones/Ejercicio 37.py create mode 100644 Unidad 3-Funciones/Ejercicio31.c.c create mode 100644 Unidad 3-Funciones/Ejercicio31.py.py create mode 100644 Unidad 3-Funciones/Ejercicio37.c.c create mode 100644 Unidad 3-Funciones/Ejercicio37.py.py diff --git a/Unidad 3-Funciones/Ejercicio 31.PY b/Unidad 3-Funciones/Ejercicio 31.PY deleted file mode 100644 index 1683a7b..0000000 --- a/Unidad 3-Funciones/Ejercicio 31.PY +++ /dev/null @@ -1,14 +0,0 @@ -i = 0 -cont = 0 -num = 0 - -num = int(input()) - -for i in range(1, num+1): - if num%i == 0: - cont = cont + 1 - -if cont == 2: - print("Es primo") -else: - print("No es primo") \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio 31.c b/Unidad 3-Funciones/Ejercicio 31.c deleted file mode 100644 index 3a227b8..0000000 --- a/Unidad 3-Funciones/Ejercicio 31.c +++ /dev/null @@ -1,22 +0,0 @@ -#include - -int main (){ - - int num, i, cont = 0; - - scanf("%d",&num); - - for (i = 1; i <= num; i++){ - - if(num%i == 0){ - cont = cont + 1; - } - } - - if (cont > 2 || num == 1 ){ - printf("No es primo"); - } - else{ - printf("Es primo"); - } -} \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio 37.c b/Unidad 3-Funciones/Ejercicio 37.c deleted file mode 100644 index 7f2a6f1..0000000 --- a/Unidad 3-Funciones/Ejercicio 37.c +++ /dev/null @@ -1,30 +0,0 @@ -#include - -int main() -{ - int i, j, n, sum = 0, es_primo = 1; - - scanf("%d", &n); - - for (i = 2; n > 0; i++) //a partir de dos están los primos - { - for (j = 2; j < i; j++) - { - if (i%j == 0) - { - es_primo = 0; - break; - } - } - - if (es_primo) - { - sum += i; - n--; - } - - es_primo = 1; - } - - printf("%d", sum); -} diff --git a/Unidad 3-Funciones/Ejercicio 37.py b/Unidad 3-Funciones/Ejercicio 37.py deleted file mode 100644 index 651c335..0000000 --- a/Unidad 3-Funciones/Ejercicio 37.py +++ /dev/null @@ -1,27 +0,0 @@ -i = 0 -j = 0 -n = 0 -sum = 0 -es_primo = 1 - -n = int(input()) - -for i in range(2,n): - - for j in range(2,i): - - if i % j == 0: - - es_primo = 0 - - break - - if es_primo: - - sum += i - - n = n - 1 - - es_primo = 1 - -print (sum) diff --git a/Unidad 3-Funciones/Ejercicio31.c.c b/Unidad 3-Funciones/Ejercicio31.c.c new file mode 100644 index 0000000..d675b94 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio31.c.c @@ -0,0 +1,57 @@ +//Autor: Farid Espadas Escalante +#include //Algoritmo en C donde introduzcas un número y te diga si es primo o no es primo; + +//Entrada | int numero; +//Procesos | Determinar si el número es primo o no; +//Salida || str "Es primo" or "No es primo" + +int read(); +int proceso (int esprimo); + +int main(){ //Función principal + + int num, es_Primo; + + num = read(); + es_Primo = proceso(num); + + if (es_Primo == 1){ //Condicion que determina si es primo o no el número + printf("Es primo"); + } + else{ + printf("No es primo"); + } + + return 0; +} + + +int read(){ //Función donde se lee la variable a determinar si es primo o no + + int num_Scan; + + scanf("%d",&num_Scan); + + return num_Scan; +} + + +int proceso(int esprimo){ //Función donde se determina si el número se divide entre 2 números enteros nada más, recorriendo de 1 hasta ese núm con un ciclo for. + + int i, j, cont = 0; + + for (i = 1; i <= esprimo; i++){ + if (esprimo % i == 0){ + cont++; + } + } + + if (cont == 2){ + esprimo = 1; + } + else{ + esprimo = 0; + } + + return esprimo; +} \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio31.py.py b/Unidad 3-Funciones/Ejercicio31.py.py new file mode 100644 index 0000000..9e485bb --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio31.py.py @@ -0,0 +1,28 @@ +# Autor: Farid Espadas Escalante + +# Entrada | numero entero; +# Procesos | determinar si el numero es primo o no +# Salida | str "Es primo" o "no es primo" + +def esprimo(numero_inicial): + if numero_inicial < 1: + return False + elif numero_inicial == 2: + return True + else: + for i in range (2, numero_inicial): + if numero_inicial % i == 0: + return False + return True + +# Entrada | leemos el numero +numero_inicial = int(input()) +salida = esprimo(numero_inicial) + +#Salida | imprime si es primo o no +if salida is True: + print("Es primo") +else: + print("No es primo25") + + diff --git a/Unidad 3-Funciones/Ejercicio37.c.c b/Unidad 3-Funciones/Ejercicio37.c.c new file mode 100644 index 0000000..b4f2812 --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio37.c.c @@ -0,0 +1,58 @@ +//Autor: Farid Espadas Escalante +#include //Algoritmo en C que calcula la suma de los n primeros números primos, dandole n. + +//Entrada | int n; +//Procesos | Recorrer hasta encontrar los n números primos y hacer la sumatoria correspondiente. +//Salida | sumatoria de los n primeros números primos. + +int read_n(); +int sum(int num); + +int main(){ //Función principal + + int n, sum_n_prime; + + n = read_n(); + sum_n_prime = sum(n); + + printf("%d", sum_n_prime); + + return 0; + +} + +int read_n(){ //Función donde leemos la suma de los n primos a calcular + + int n_suma; + scanf("%d",&n_suma); + + return n_suma; + +} + + +int sum(int num){ //Función donde sucede la sumatoria, cada vez que encuentra un primo, lo suma. + + int i, j, n, suma = 0, es_primo = 1; + + for (i = 2; num > 0; i++) //a partir de dos están los primos + { + for (j = 2; j < i; j++) + { + if ( i % j == 0) + { + es_primo = 0; + break; + } + } + + if (es_primo) + { + suma += i; + num--; + } + es_primo = 1; + } + + return suma; +} diff --git a/Unidad 3-Funciones/Ejercicio37.py.py b/Unidad 3-Funciones/Ejercicio37.py.py new file mode 100644 index 0000000..14c200b --- /dev/null +++ b/Unidad 3-Funciones/Ejercicio37.py.py @@ -0,0 +1,30 @@ +# Autor: Farid Espadas + +# Entrada | numero entero para saber cuantos primos sumar +# Salida | numero entero que sea la suma de los numeros primos + +#Funcion para saber si es primo o no +def esprimo(numero_Inicial): +#Primero consideramos si el número es menor que uno + if numero_Inicial < 1: + return False + elif numero_Inicial == 2: + return True + else: + for i in range (2, numero_Inicial): + if numero_Inicial % i == 0: + return False + return True + +n = input() #Leemos los n numeros primos a sumar +contador = 0 +i = 0 +suma_Primos = 0 + +while contador <= int(n): + if esprimo(i) is True: + contador = contador + 1 + suma_Primos = suma_Primos + int(i) + i = i + 1 + +print(suma_Primos) From 3975ead9e36eb5eafc79a23e8ccaa582046af7b6 Mon Sep 17 00:00:00 2001 From: Ivan Farid Espadas Escalante Date: Sun, 23 Feb 2020 22:20:12 -0600 Subject: [PATCH 21/22] Correccion Correcion --- Unidad 3-Funciones/Ejercicio31.py.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Unidad 3-Funciones/Ejercicio31.py.py b/Unidad 3-Funciones/Ejercicio31.py.py index 9e485bb..b95549f 100644 --- a/Unidad 3-Funciones/Ejercicio31.py.py +++ b/Unidad 3-Funciones/Ejercicio31.py.py @@ -20,9 +20,9 @@ def esprimo(numero_inicial): salida = esprimo(numero_inicial) #Salida | imprime si es primo o no -if salida is True: +if salida is True: print("Es primo") else: - print("No es primo25") + print("No es primo") From cea6cd0d5062c46ed89cfd353f8274d9c6cdea8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Immanuel=20Meza=20Maga=C3=B1a?= <56287951+JoshuaMeza@users.noreply.github.com> Date: Mon, 24 Feb 2020 00:28:45 -0600 Subject: [PATCH 22/22] Details Name Changes --- Unidad 3-Funciones/Ejercicio31.c | 107 +++++++++--------- Unidad 3-Funciones/Ejercicio31.c.c | 57 ---------- .../{Ejercicio31.py.py => Ejercicio31.py} | 0 .../{Ejercicio37.c.c => Ejercicio37.c} | 0 .../{Ejercicio37.py.py => Ejercicio37.py} | 0 .../__pycache__/Ejercicio43.cpython-38.pyc | Bin 2966 -> 0 bytes .../__pycache__/Ejercicio48.cpython-38.pyc | Bin 2262 -> 0 bytes 7 files changed, 54 insertions(+), 110 deletions(-) delete mode 100644 Unidad 3-Funciones/Ejercicio31.c.c rename Unidad 3-Funciones/{Ejercicio31.py.py => Ejercicio31.py} (100%) rename Unidad 3-Funciones/{Ejercicio37.c.c => Ejercicio37.c} (100%) rename Unidad 3-Funciones/{Ejercicio37.py.py => Ejercicio37.py} (100%) delete mode 100644 Unidad 3-Funciones/__pycache__/Ejercicio43.cpython-38.pyc delete mode 100644 Unidad 3-Funciones/__pycache__/Ejercicio48.cpython-38.pyc diff --git a/Unidad 3-Funciones/Ejercicio31.c b/Unidad 3-Funciones/Ejercicio31.c index 02cce49..b78e165 100644 --- a/Unidad 3-Funciones/Ejercicio31.c +++ b/Unidad 3-Funciones/Ejercicio31.c @@ -1,56 +1,57 @@ -/*Autor: Guillermo Canto Dzul -Entradas: Un numero entero -Salidas: Imprime si es primo o no -*/ - -#include -int entrada(); -int proceso(int n); -void salida(int n, int esPrimo); -int main(int argc, char *argv[]) { - int n, esPrimo; - n = entrada(); - esPrimo = proceso(n); - salida(n, esPrimo); - return 0; -} -//Lee el numero -int entrada(){ - int n; - printf("Ingrese un numero:\n"); - scanf("%d", &n ); - return n; -} -//Verifica si el numero es primo o no. -int proceso(int n){ - int suma = 0; - int i, flag; - for (i=1; i //Algoritmo en C donde introduzcas un número y te diga si es primo o no es primo; + +//Entrada | int numero; +//Procesos | Determinar si el número es primo o no; +//Salida || str "Es primo" or "No es primo" + +int read(); +int proceso (int esprimo); + +int main(){ //Función principal + + int num, es_Primo; + + num = read(); + es_Primo = proceso(num); + + if (es_Primo == 1){ //Condicion que determina si es primo o no el número + printf("Es primo"); + } + else{ + printf("No es primo"); + } + + return 0; } -//Imprime el resultado. -void salida(int n, int esPrimo){ - if (esPrimo == 1){ - printf("%d es primo\n", n); - } - else{ - printf("%d no es primo\n", n); - } + + +int read(){ //Función donde se lee la variable a determinar si es primo o no + + int num_Scan; + + scanf("%d",&num_Scan); + + return num_Scan; } -/*AUTOR QA : DANIEL DELFIN -ENTRADAS -1,2,17 -SALIDAS -1 NO ES UN NUMERO PRIMO - 2 ES UN NUMERO PRIMO - 17 ES UN NUMERO PRIMO -OBSERVACIONES. MUY BIEN LA MODULARIZACION DEL CODIGO*/ + +int proceso(int esprimo){ //Función donde se determina si el número se divide entre 2 números enteros nada más, recorriendo de 1 hasta ese núm con un ciclo for. + + int i, j, cont = 0; + + for (i = 1; i <= esprimo; i++){ + if (esprimo % i == 0){ + cont++; + } + } + + if (cont == 2){ + esprimo = 1; + } + else{ + esprimo = 0; + } + + return esprimo; +} \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio31.c.c b/Unidad 3-Funciones/Ejercicio31.c.c deleted file mode 100644 index d675b94..0000000 --- a/Unidad 3-Funciones/Ejercicio31.c.c +++ /dev/null @@ -1,57 +0,0 @@ -//Autor: Farid Espadas Escalante -#include //Algoritmo en C donde introduzcas un número y te diga si es primo o no es primo; - -//Entrada | int numero; -//Procesos | Determinar si el número es primo o no; -//Salida || str "Es primo" or "No es primo" - -int read(); -int proceso (int esprimo); - -int main(){ //Función principal - - int num, es_Primo; - - num = read(); - es_Primo = proceso(num); - - if (es_Primo == 1){ //Condicion que determina si es primo o no el número - printf("Es primo"); - } - else{ - printf("No es primo"); - } - - return 0; -} - - -int read(){ //Función donde se lee la variable a determinar si es primo o no - - int num_Scan; - - scanf("%d",&num_Scan); - - return num_Scan; -} - - -int proceso(int esprimo){ //Función donde se determina si el número se divide entre 2 números enteros nada más, recorriendo de 1 hasta ese núm con un ciclo for. - - int i, j, cont = 0; - - for (i = 1; i <= esprimo; i++){ - if (esprimo % i == 0){ - cont++; - } - } - - if (cont == 2){ - esprimo = 1; - } - else{ - esprimo = 0; - } - - return esprimo; -} \ No newline at end of file diff --git a/Unidad 3-Funciones/Ejercicio31.py.py b/Unidad 3-Funciones/Ejercicio31.py similarity index 100% rename from Unidad 3-Funciones/Ejercicio31.py.py rename to Unidad 3-Funciones/Ejercicio31.py diff --git a/Unidad 3-Funciones/Ejercicio37.c.c b/Unidad 3-Funciones/Ejercicio37.c similarity index 100% rename from Unidad 3-Funciones/Ejercicio37.c.c rename to Unidad 3-Funciones/Ejercicio37.c diff --git a/Unidad 3-Funciones/Ejercicio37.py.py b/Unidad 3-Funciones/Ejercicio37.py similarity index 100% rename from Unidad 3-Funciones/Ejercicio37.py.py rename to Unidad 3-Funciones/Ejercicio37.py diff --git a/Unidad 3-Funciones/__pycache__/Ejercicio43.cpython-38.pyc b/Unidad 3-Funciones/__pycache__/Ejercicio43.cpython-38.pyc deleted file mode 100644 index 113a549ffbf9a9abba012a1e794bd5cae18d00e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2966 zcmc&$-EJF26rS02?5*RZs8m$y4I{2j_Q}dhlOg@~>hX6U zwHSLvo!R7}a~CrnvHcU^`s-s)pKAORA3AR}B@QuBl6^iF!#bs}}0IZm5+# z&wQfmr;IbT`W0(mKK`+}S=fGN#AjLFFQj;wBr+}ZKs?gNQaqA9nabua!Ys4=l%1kALVu5$_owyQ%>FwghSzz=zcvNZ zLo0gP=I);Adi10fhguxQgTeHAT1{!w^zse2cia~u?1&q2YTFy)sT>q|$#Zwy_$}0% zysFytSlhy+bEkZbm(EK-*Y8dgpq1PI8gGU8rH>oSr8pfHw#`c~?EK8k5~lumwzbiH zl0&QAfljl7th=2>MWR!icOS&|(_*(ffk{Td?Otw85kVZOWcNuLE2+fo5AGK!P3pXR z?|W^c7@hUoYr~^*H6Q9Iety&$0~g@J9E4;nsCi8<-~n%Wrh$G$08LX34IkNowT(uP zop1o=A^RhL!~oUZ3LYXVeCSzWf}QIHf$$R!DK6 zBMY{^p?*U44J?x($hKBNaS@v1M=k=8kPioOZYO#WH>d*w5QtVM!^}u?Bxvxw?cl^2 zYfLP62cTPD!w`t_1ppKd+!-q6mDF^91cRB-Zi{S9n`(L?zZ^I7sdg5LW(c#_RJ46V z#$^b!vMz^1ovL=t5RPSQ_Tf7|-m&9D7Dv8uQFqIn^b`GD$4Gt^1zWChd|*nG2Po?v z__B=gi0+%FH~8`%Mu{sUzRkY9N_+t;Y9;_Xh$Y@WT8<6NQ#Qb+BRPnQfwX#T*)nn7 z2+XMb5acG;^Pe%{iwm$1A;lEC&E#C!F2?h(Haav7S*Sy00-vEkQr1X>r}U{w+%L0pkBb2~sRTXOlelDDW;oK7z>XvpdbcLPF_T#kYuIV6pF1Z)CJwu_)T&99T z>5Rf#ZpB#X`8Sx$$w#qE0XJ7rN7R`nnxX9UeFqJAFBkDFJ7xGa;V-%M2my*^7SRtV zcqg8%O$QT6QgNaY;h%E<7SHW(Pi*tPLwCnCCpsec`7NNs=c;`S2vD2xnT`PHKXL;t_(kG|n z6X)l&UrS`1YV6F(3E^J@F{I8{mz%s!=k&ZJ*iAI l)}3AFS}uMCA19eA2Ko-g!<@vfHG(U_b>z2$R`71X{{#e$+;;!~ diff --git a/Unidad 3-Funciones/__pycache__/Ejercicio48.cpython-38.pyc b/Unidad 3-Funciones/__pycache__/Ejercicio48.cpython-38.pyc deleted file mode 100644 index c857307c1ef56f18a31f81ee28351e7f2f256a6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2262 zcmah}&2Jk;6rb4-d$aifl~T1rf`J2yE7bzQ0a;N(6q1rku}a$H;96MIo#}eV1lp}X z_dow`fsns(GTkhgd<=iS4xJzkBB-#wAq^^Q;efP+D@q`3Q5GIZM=S^*q$^8ev16&4 zbbEvnvGjmcmb*Xtn}u#?irvfdcEQ8pw;?{lRC@b~RIyi`*QNhZ3)W=N(?8YJ4_TnAgk*SG3S; zbvMM^ryw+<~fEu08qDct%?8+!3A#~q>{HS_#+Am{1HbV)_B>56_#B(g)x=C-+B};iQzZ$42Smyzy zZV!P`x2J%(VSupa0WqP}ORyLcadjuoIO6eOOvTB%7oadNi~&L+{Qv{^32v+$oY8)% zWx^Q@hFuv9{RK?e9=?b-U^#)ewbC`vxE)uaEP-VWEM;RsUk@yYAQ!-L2o~R1JQywF=*$AXFLj@rn*rYg9tTCt zwH%UOXPU<>l_#_B`(@+@j$C{#CV+V&GqBV%l|YP{`Y~}I9$}1P9nLaT&08_|J>l`M zUSi-JAf^M%eOPIJ|J#47&o%}K>;Rus`1SQ)?*7#U6+${d?uUQ;j_uh-_|~`oeD>>` z|87*ML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