-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56d3b15
commit eb7f95a
Showing
28 changed files
with
478 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//pseudocode | ||
|
||
function main() | ||
tax = 1.16 | ||
total = 0 | ||
sumtax = 0 | ||
producttax = 0 | ||
semitotal = 0 | ||
sumsemitotal = 0 | ||
output "Escribe la cantidad: " | ||
input quantity | ||
loop while quantity > 0 | ||
output "Escribe el precio : " | ||
input price | ||
priceandtax = price * quantity * tax | ||
producttax = 0.16 * price | ||
sumtax = producttax + sumtax | ||
semitotal = price * quantity | ||
sumsemitotal = sumsemitotal + semitotal | ||
total = priceandtax + total | ||
output "Total: $" + total + " Subtotal: $" + sumsemitotal + " Impuestos: $" + sumtax | ||
output "Escribe la cantidad: " | ||
input quantity | ||
end while | ||
output "Total: $" + total + " Subtotal: $" + sumsemitotal + " Impuestos: $" + sumtax | ||
end function |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function main() | ||
a = 0 | ||
b = 1 | ||
c = 0 | ||
input d | ||
output " Fibonacci Sequence until " + d | ||
loop while c < d | ||
c = a + b | ||
output c | ||
a = b | ||
b = c | ||
end while | ||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0"?> | ||
<flowgorithm fileversion="2.11"> | ||
<attributes> | ||
<attribute name="name" value=""/> | ||
<attribute name="authors" value="Daniel"/> | ||
<attribute name="about" value=""/> | ||
<attribute name="saved" value="2019-03-12 05:51:05 a. m."/> | ||
<attribute name="created" value="RGFuaWVsO0xBUFRPUC1RMkNKS01RRDsyMDE5LTAzLTEyOzA1OjI5OjU0IGEuIG0uOzMxMzE="/> | ||
<attribute name="edited" value="RGFuaWVsO0xBUFRPUC1RMkNKS01RRDsyMDE5LTAzLTEyOzA1OjUxOjA1IGEuIG0uOzE7MzIzMA=="/> | ||
</attributes> | ||
<function name="Main" type="None" variable=""> | ||
<parameters/> | ||
<body> | ||
<comment text="3. Print all the multiples of k from m to n."/> | ||
<declare name="k, m, n, i, output" type="Integer" array="False" size=""/> | ||
<input variable="m"/> | ||
<input variable="n"/> | ||
<input variable="k"/> | ||
<if expression="m<n"> | ||
<then> | ||
<for variable="i" start="m" end="n" direction="inc" step="1"> | ||
<assign variable="output" expression="k*i"/> | ||
<output expression="k & " x " & i & " = " & output" newline="True"/> | ||
</for> | ||
</then> | ||
<else> | ||
<for variable="i" start="n" end="m" direction="inc" step="1"> | ||
<assign variable="output" expression="k*i"/> | ||
<output expression="k & " x " & i & " = " & output" newline="True"/> | ||
</for> | ||
</else> | ||
</if> | ||
</body> | ||
</function> | ||
</flowgorithm> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
function main() | ||
// 3. Print all the multiples of k from m to n. | ||
input m | ||
input n | ||
input k | ||
if m < n then | ||
loop i from m to n | ||
var_output = k * i | ||
output k + " x " + i + " = " + var_output | ||
end loop | ||
else | ||
loop i from n to m | ||
var_output = k * i | ||
output k + " x " + i + " = " + var_output | ||
end loop | ||
end If | ||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0"?> | ||
<flowgorithm fileversion="2.11"> | ||
<attributes> | ||
<attribute name="name" value=""/> | ||
<attribute name="authors" value="Daniel"/> | ||
<attribute name="about" value=""/> | ||
<attribute name="saved" value="2019-03-12 06:10:24 a. m."/> | ||
<attribute name="created" value="RGFuaWVsO0xBUFRPUC1RMkNKS01RRDsyMDE5LTAzLTEyOzA1OjUxOjE2IGEuIG0uOzMxMjQ="/> | ||
<attribute name="edited" value="RGFuaWVsO0xBUFRPUC1RMkNKS01RRDsyMDE5LTAzLTEyOzA2OjEwOjI0IGEuIG0uOzE7MzIyNw=="/> | ||
</attributes> | ||
<function name="Main" type="None" variable=""> | ||
<parameters/> | ||
<body> | ||
<comment text="4. Get the average of n exams."/> | ||
<comment text="c = numer of exams "/> | ||
<comment text="b = grades"/> | ||
<declare name="a, b, c, i" type="Real" array="False" size=""/> | ||
<input variable="c"/> | ||
<assign variable="a" expression="0"/> | ||
<for variable="i" start="1" end="c" direction="inc" step="1"> | ||
<input variable="b"/> | ||
<assign variable="a" expression="a+b"/> | ||
</for> | ||
<assign variable="a" expression="a/c"/> | ||
<output expression=""The average is: " & a" newline="True"/> | ||
</body> | ||
</function> | ||
</flowgorithm> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function main() | ||
// 4. Get the average of n exams. | ||
// c = numer of exams | ||
// b = grades | ||
input c | ||
a = 0 | ||
loop i from 1 to c | ||
input b | ||
a = a + b | ||
end loop | ||
a = a / c | ||
output "The average is: " + a | ||
end function |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function main() | ||
contadorprimos = 200 | ||
|
||
// se sacaran los factores primos de n | ||
input n | ||
output "Los factores primos son: " | ||
loop i from 1 to contadorprimos | ||
fact = 0 | ||
loop j from 1 to contadorprimos | ||
if i MOD j = 0 then | ||
fact = fact + 1 | ||
end If | ||
end loop | ||
if fact = 2 then | ||
loop while n MOD i = 0 | ||
n = n / i | ||
output i | ||
end while | ||
end If | ||
end loop | ||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0"?> | ||
<flowgorithm fileversion="2.11"> | ||
<attributes> | ||
<attribute name="name" value=""/> | ||
<attribute name="authors" value="Daniel"/> | ||
<attribute name="about" value=""/> | ||
<attribute name="saved" value="2019-03-20 12:20:24 a. m."/> | ||
<attribute name="created" value="RGFuaWVsO0xBUFRPUC1RMkNKS01RRDsyMDE5LTAzLTEzOzEyOjMzOjAxIGEuIG0uOzMxMTc="/> | ||
<attribute name="edited" value="RGFuaWVsO0xBUFRPUC1RMkNKS01RRDsyMDE5LTAzLTIwOzEyOjIwOjI0IGEuIG0uOzU7MzIyOA=="/> | ||
</attributes> | ||
<function name="Main" type="None" variable=""> | ||
<parameters/> | ||
<body> | ||
<declare name="i, j, primo, fact, contadorprimos, n, x" type="Integer" array="False" size=""/> | ||
<declare name="numero, guardado" type="Real" array="False" size=""/> | ||
<assign variable="contadorprimos" expression="200"/> | ||
<comment text="se sacaran los factores primos de n"/> | ||
<input variable="n"/> | ||
<output expression=""Los factores primos son: "" newline="True"/> | ||
<for variable="i" start="1" end="contadorprimos" direction="inc" step="1"> | ||
<assign variable="fact" expression="0"/> | ||
<for variable="j" start="1" end="contadorprimos" direction="inc" step="1"> | ||
<if expression="i % j = 0"> | ||
<then> | ||
<assign variable="fact" expression="fact + 1"/> | ||
</then> | ||
<else/> | ||
</if> | ||
</for> | ||
<if expression="fact = 2"> | ||
<then> | ||
<while expression="n%i = 0"> | ||
<assign variable="n" expression="n/i"/> | ||
<output expression="i" newline="True"/> | ||
</while> | ||
</then> | ||
<else/> | ||
</if> | ||
</for> | ||
</body> | ||
</function> | ||
</flowgorithm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0"?> | ||
<flowgorithm fileversion="2.11"> | ||
<attributes> | ||
<attribute name="name" value=""/> | ||
<attribute name="authors" value="Daniel"/> | ||
<attribute name="about" value=""/> | ||
<attribute name="saved" value="2019-03-15 10:51:03 p. m."/> | ||
<attribute name="created" value="RGFuaWVsO0xBUFRPUC1RMkNKS01RRDsyMDE5LTAzLTE1OzEwOjIwOjQ0IHAuIG0uOzMxMzU="/> | ||
<attribute name="edited" value="RGFuaWVsO0xBUFRPUC1RMkNKS01RRDsyMDE5LTAzLTE1OzEwOjUxOjAzIHAuIG0uOzE7MzI0Mg=="/> | ||
</attributes> | ||
<function name="Main" type="None" variable=""> | ||
<parameters/> | ||
<body> | ||
<declare name="priceandtax, price, quantity, tax, producttax, sumtax, semitotal, sumsemitotal, total" type="Real" array="False" size=""/> | ||
<declare name="cobrar" type="Integer" array="False" size=""/> | ||
<assign variable="tax" expression="1.16"/> | ||
<assign variable="total" expression="0"/> | ||
<assign variable="sumtax" expression="0"/> | ||
<assign variable="producttax" expression="0"/> | ||
<assign variable="semitotal" expression="0"/> | ||
<assign variable="sumsemitotal" expression="0"/> | ||
<output expression=""Escribe la cantidad: "" newline="True"/> | ||
<input variable="quantity"/> | ||
<while expression="quantity > 0"> | ||
<output expression=""Escribe el precio : "" newline="True"/> | ||
<input variable="price"/> | ||
<assign variable="priceandtax" expression="price*quantity*tax"/> | ||
<assign variable="producttax" expression="0.16*price"/> | ||
<assign variable="sumtax" expression="producttax + sumtax"/> | ||
<assign variable="semitotal" expression="price * quantity"/> | ||
<assign variable="sumsemitotal" expression="sumsemitotal + semitotal"/> | ||
<assign variable="total" expression="priceandtax + total"/> | ||
<output expression=""Total: $" & total & " Subtotal: $" & sumsemitotal & " Impuestos: $" & sumtax" newline="True"/> | ||
<output expression=""Escribe la cantidad: "" newline="True"/> | ||
<input variable="quantity"/> | ||
</while> | ||
<output expression=""Total: $" & total & " Subtotal: $" & sumsemitotal & " Impuestos: $" & sumtax" newline="True"/> | ||
</body> | ||
</function> | ||
</flowgorithm> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0"?> | ||
<flowgorithm fileversion="2.11"> | ||
<attributes> | ||
<attribute name="name" value=""/> | ||
<attribute name="authors" value="Daniel"/> | ||
<attribute name="about" value=""/> | ||
<attribute name="saved" value="2019-03-13 12:32:59 a. m."/> | ||
<attribute name="created" value="RGFuaWVsO0xBUFRPUC1RMkNKS01RRDsyMDE5LTAzLTEyOzA3OjMwOjA5IHAuIG0uOzMxNDA="/> | ||
<attribute name="edited" value="RGFuaWVsO0xBUFRPUC1RMkNKS01RRDsyMDE5LTAzLTEzOzEyOjMyOjU5IGEuIG0uOzE7MzIzNw=="/> | ||
</attributes> | ||
<function name="Main" type="None" variable=""> | ||
<parameters/> | ||
<body> | ||
<declare name="hours, minutes, i, j, h" type="Integer" array="False" size=""/> | ||
<for variable="i" start="0" end="11" direction="inc" step="1"> | ||
<for variable="j" start="0" end="5" direction="inc" step="1"> | ||
<for variable="h" start="0" end="9" direction="inc" step="1"> | ||
<if expression="i<=9"> | ||
<then> | ||
<output expression=""0"" newline="False"/> | ||
</then> | ||
<else/> | ||
</if> | ||
<output expression="i" newline="False"/> | ||
<output expression="":"" newline="False"/> | ||
<output expression="j" newline="False"/> | ||
<output expression="h" newline="True"/> | ||
</for> | ||
</for> | ||
</for> | ||
</body> | ||
</function> | ||
</flowgorithm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function main() | ||
loop i from 0 to 11 | ||
loop j from 0 to 5 | ||
loop h from 0 to 9 | ||
if i <= 9 then | ||
output "0" � | ||
end If | ||
output i � | ||
output ":" � | ||
output j � | ||
output h | ||
end loop | ||
end loop | ||
end loop | ||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
int main() { | ||
int i, j, n, k; | ||
|
||
cin >> n; | ||
k = n; | ||
for (i = 1; i <= n; i++) { | ||
for (j = 1; j <= k; j++) { | ||
cout << "*"; | ||
} | ||
cout << "" << endl; | ||
k = k - 1; | ||
} | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "pch.h" | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
int i, j, n; | ||
|
||
cin >> n; | ||
|
||
for (i = 0; i <= n; i++) | ||
{ | ||
for ( j = 1; j <= i; j++) | ||
{ | ||
cout << "*"; | ||
} | ||
cout << "\n"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "pch.h" | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
int i, j, n; | ||
|
||
cin >> n; | ||
|
||
for (i = 0; i <= n; i++) | ||
{ | ||
for ( j = 1; j <= i; j++) | ||
{ | ||
cout << j; | ||
} | ||
cout << "\n"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0"?> | ||
<flowgorithm fileversion="2.11"> | ||
<attributes> | ||
<attribute name="name" value=""/> | ||
<attribute name="authors" value="Daniel"/> | ||
<attribute name="about" value=""/> | ||
<attribute name="saved" value="2019-03-20 12:23:34 AM"/> | ||
<attribute name="created" value="RGFuaWVsO0RFU0tUT1AtM1ZVVUpTRzsyMDE5LTAzLTE5OzExOjQ2OjQ0IFBNOzI5OTY="/> | ||
<attribute name="edited" value="RGFuaWVsO0RFU0tUT1AtM1ZVVUpTRzsyMDE5LTAzLTIwOzEyOjIzOjM0IEFNOzE7MzA3Ng=="/> | ||
</attributes> | ||
<function name="Main" type="None" variable=""> | ||
<parameters/> | ||
<body> | ||
<declare name="i, j, n, k" type="Integer" array="False" size=""/> | ||
<input variable="n"/> | ||
<assign variable="k" expression="n"/> | ||
<for variable="i" start="1" end="n" direction="inc" step="1"> | ||
<for variable="j" start="1" end="k" direction="inc" step="1"> | ||
<output expression="j" newline="False"/> | ||
</for> | ||
<output expression="""" newline="True"/> | ||
<assign variable="k" expression="k-1"/> | ||
</for> | ||
</body> | ||
</function> | ||
</flowgorithm> |
Empty file.
Oops, something went wrong.