Skip to content

Commit

Permalink
Tareas agregadas
Browse files Browse the repository at this point in the history
  • Loading branch information
MindSetFPS committed Mar 20, 2019
1 parent 56d3b15 commit eb7f95a
Show file tree
Hide file tree
Showing 28 changed files with 478 additions and 0 deletions.
26 changes: 26 additions & 0 deletions 1cashierpseudocode.txt
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
Binary file added Assignment 3.2/2Fibonacci.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions Assignment 3.2/2FibonacciPesudocode.txt
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
35 changes: 35 additions & 0 deletions Assignment 3.2/3.fprg
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&lt;n">
<then>
<for variable="i" start="m" end="n" direction="inc" step="1">
<assign variable="output" expression="k*i"/>
<output expression="k &amp; &quot; x &quot; &amp; i &amp; &quot; = &quot; &amp; 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 &amp; &quot; x &quot; &amp; i &amp; &quot; = &quot; &amp; output" newline="True"/>
</for>
</else>
</if>
</body>
</function>
</flowgorithm>
Binary file added Assignment 3.2/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Assignment 3.2/3.txt
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
28 changes: 28 additions & 0 deletions Assignment 3.2/4average.fprg
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&#13;&#10;"/>
<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="&quot;The average is: &quot; &amp; a" newline="True"/>
</body>
</function>
</flowgorithm>
Binary file added Assignment 3.2/4average.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions Assignment 3.2/4average.txt
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
Binary file added Assignment 3.2/5PrimeProduct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Assignment 3.2/5Primeproduct.txt
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
42 changes: 42 additions & 0 deletions Assignment 3.2/5ProductosPeroNoEstoyMuySeguro.fprg
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="&quot;Los factores primos son: &quot;" 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>
40 changes: 40 additions & 0 deletions Cashier.fprg
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="&quot;Escribe la cantidad: &quot;" newline="True"/>
<input variable="quantity"/>
<while expression="quantity &gt; 0">
<output expression="&quot;Escribe el precio : &quot;" 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="&quot;Total: $&quot; &amp; total &amp; &quot; Subtotal: $&quot; &amp; sumsemitotal &amp; &quot; Impuestos: $&quot; &amp; sumtax" newline="True"/>
<output expression="&quot;Escribe la cantidad: &quot;" newline="True"/>
<input variable="quantity"/>
</while>
<output expression="&quot;Total: $&quot; &amp; total &amp; &quot; Subtotal: $&quot; &amp; sumsemitotal &amp; &quot; Impuestos: $&quot; &amp; sumtax" newline="True"/>
</body>
</function>
</flowgorithm>
Binary file added ClassWork 3.1/PrintsFrom0000to1159 - Main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions ClassWork 3.1/PrintsFrom0000to1159.fprg
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&lt;=9">
<then>
<output expression="&quot;0&quot;" newline="False"/>
</then>
<else/>
</if>
<output expression="i" newline="False"/>
<output expression="&quot;:&quot;" newline="False"/>
<output expression="j" newline="False"/>
<output expression="h" newline="True"/>
</for>
</for>
</for>
</body>
</function>
</flowgorithm>
15 changes: 15 additions & 0 deletions ClassWork 3.1/PrintsFrom0000to1159.txt
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
19 changes: 19 additions & 0 deletions Loop Exercises In Class 13 03 2019/1B.txt
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;
}

19 changes: 19 additions & 0 deletions Loop Exercises In Class 13 03 2019/1a.txt
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";
}
}
19 changes: 19 additions & 0 deletions Loop Exercises In Class 13 03 2019/2.txt
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";
}
}
26 changes: 26 additions & 0 deletions Loop Exercises In Class 13 03 2019/2b.fprg
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="&quot;&quot;" newline="True"/>
<assign variable="k" expression="k-1"/>
</for>
</body>
</function>
</flowgorithm>
Empty file.
Loading

0 comments on commit eb7f95a

Please sign in to comment.