From ccfb57540e91e962e90217cf6e36b7d0374a9c99 Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Wed, 24 Jan 2018 19:05:29 -0600 Subject: [PATCH 01/13] Update Lab_1.md --- Lab_1.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/Lab_1.md b/Lab_1.md index c733efb..ea4f503 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -32,7 +32,8 @@ This is the first step <-----+ a Monday \ / \ / - | No + | + |No v --------------------- The last step @@ -43,7 +44,37 @@ The last step #### Fizzbuzz * starting at one and incrementing by one to a number that is given, print out either the number, or if the number is divisible by 2, print "Fizz", and if the number is divisible by 3 print "Buzz" - +---------------------------- +Start set initial value at 1 +---------------------------- + |-----------------------------++--+ + V || ^ +---------------------------- ^| | +Increase Value by 1 || | +---------------------------- || | + | |^ | + V || ^ + / \ || | + / \ || | + / \ Yes || | ____________ +/ Is value divisble by 2 \-----------+|--|-----|Print "Fizz"| +\ / | | |____________| + \ / | ^ + \ / ^ | + |No | | + V | | + / \ | | + / \ | | + / \ Yes | ^ ____________ +/ Is value divisble by 3 \----------- +--|------>|Print "Buzz"| +\ / | |____________| + \ / | + \ / ^ + |No | + v | + ------------- | + Print value -->------------------------+ + ------------- #### Determin a students letter grade when given the %. #### Convert a tempature from C to F or vice versa. From e3047189f67bbb5ff2e388e95a1cc051f039bcca Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Wed, 24 Jan 2018 19:07:20 -0600 Subject: [PATCH 02/13] Update Lab_1.md --- Lab_1.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Lab_1.md b/Lab_1.md index ea4f503..537c615 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -43,12 +43,13 @@ The last step ## Flowchart Tasks: #### Fizzbuzz -* starting at one and incrementing by one to a number that is given, print out either the number, or if the number is divisible by 2, print "Fizz", and if the number is divisible by 3 print "Buzz" +* starting at one and incrementing by one to a number that is given, print out either the number, or if the number is divisible by 2, print "Fizz", and if the number is divisible by 3 print "Buzz" +~~~ ---------------------------- Start set initial value at 1 ---------------------------- - |-----------------------------++--+ - V || ^ + |---------------------------------+ + v || ^ ---------------------------- ^| | Increase Value by 1 || | ---------------------------- || | @@ -74,8 +75,9 @@ Increase Value by 1 || | v | ------------- | Print value -->------------------------+ - ------------- -#### Determin a students letter grade when given the %. + ------------- + ~~~ +#### Determine a students letter grade when given the %. #### Convert a tempature from C to F or vice versa. From 14abd51dc35f3106dda31cd0f12ebf02e60c8b06 Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Wed, 24 Jan 2018 19:35:35 -0600 Subject: [PATCH 03/13] Update Lab_1.md --- Lab_1.md | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/Lab_1.md b/Lab_1.md index 537c615..5887c96 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -57,8 +57,8 @@ Increase Value by 1 || | V || ^ / \ || | / \ || | - / \ Yes || | ____________ -/ Is value divisble by 2 \-----------+|--|-----|Print "Fizz"| + / \ Yes || | ____________ +/ Is value divisble by 2 \-----------+|--|----- |Print "Fizz"| \ / | | |____________| \ / | ^ \ / ^ | @@ -66,7 +66,7 @@ Increase Value by 1 || | V | | / \ | | / \ | | - / \ Yes | ^ ____________ + / \ Yes | ^ ____________ / Is value divisble by 3 \----------- +--|------>|Print "Buzz"| \ / | |____________| \ / | @@ -78,9 +78,75 @@ Increase Value by 1 || | ------------- ~~~ #### Determine a students letter grade when given the %. +~~~ +--------------------------------- +Enter Students Percentage Grade % +--------------------------------- + | + v + / \ + / \ Yes +------------+ +/ Is value greater \ ----->|Print A | +\ than or equal to 90 / +------------+ + \ / + \ / + | + |No + v + / \ Yes +------------+ +/ Is value greater \ ----->|Print B | +\ than or equal to 80 / +------------+ + \ / + \ / + | + |No + v + / \ + / \ Yes +------------+ +/ Is value greater \ ----->|Print C | +\ than or equal to 70 / +------------+ + \ / + \ / + | + |No + v + / \ + / \ Yes +------------+ +/ Is value greater \ ----->|Print D | +\ than or equal to 60 / +------------+ + \ / + \ / + | + |No + v + ------------- + Print F + ------------- +~~~ #### Convert a tempature from C to F or vice versa. - +~~~ +------------------------------ +Insert Temperature Value +------------------------------ + / \ + / \ Yes+------------------------+ +----------------- ---+ +/ Is value in Celisus \ ----->|Value* multiply(9/5)+32 |----->|Print "New Value" "F"| +\ / +------------------------+ +---------------------+ + \ / + \ / + | + |No + v +------------------------------- +Value subtract 32 multiply 5/9 +-------------------------------- + | + v +-------------------- +Print "New Value" "C" +--------------------- +~~~ #### When give three numbers return the largest of them #### The game of Nim: From 7f2e0822a14b9d1bc401b1c23949d61c30517bc8 Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Wed, 24 Jan 2018 19:46:22 -0600 Subject: [PATCH 04/13] Update Lab_1.md --- Lab_1.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Lab_1.md b/Lab_1.md index 5887c96..17de9d6 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -93,6 +93,7 @@ Enter Students Percentage Grade % | |No v + / \ / \ Yes +------------+ / Is value greater \ ----->|Print B | \ than or equal to 80 / +------------+ @@ -147,7 +148,39 @@ Value subtract 32 multiply 5/9 Print "New Value" "C" --------------------- ~~~ -#### When give three numbers return the largest of them +#### When given three numbers return the largest of them +~~~ +--------------------------------- +Assign first number as a +assign second number as b +assign third number as c +--------------------------------- + | + v + / \ + / \ Yes +------------+ +/ Is a greater \ -----> |Print a | +\ than b and / +------------+ + greater c + \ / + \ / + | + |No + v + / \ + / \ Yes +------------+ +/ Is b greater \ --------> |Print b | +\ than a and / +------------+ + greater c + \ / + \ / + | + |No + v + ------------- + Print c + ------------- +~~~ #### The game of Nim: * This game is played between two players. From 955686dbf499ed52345e1f19e66737629a46ac2c Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Wed, 24 Jan 2018 20:14:10 -0600 Subject: [PATCH 05/13] Update Lab_1.md --- Lab_1.md | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/Lab_1.md b/Lab_1.md index 17de9d6..7b9dc2b 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -45,6 +45,11 @@ The last step #### Fizzbuzz * starting at one and incrementing by one to a number that is given, print out either the number, or if the number is divisible by 2, print "Fizz", and if the number is divisible by 3 print "Buzz" ~~~ +---------- +Start +---------- + | + v ---------------------------- Start set initial value at 1 ---------------------------- @@ -76,9 +81,19 @@ Increase Value by 1 || | ------------- | Print value -->------------------------+ ------------- + | + v +----------- +END +------------ ~~~ #### Determine a students letter grade when given the %. ~~~ +---------- +Start +---------- + | + v --------------------------------- Enter Students Percentage Grade % --------------------------------- @@ -124,9 +139,19 @@ Enter Students Percentage Grade % ------------- Print F ------------- + | + v +----------- +END +------------ ~~~ #### Convert a tempature from C to F or vice versa. ~~~ +---------- +Start +---------- + | + v ------------------------------ Insert Temperature Value ------------------------------ @@ -147,9 +172,19 @@ Value subtract 32 multiply 5/9 -------------------- Print "New Value" "C" --------------------- + | + v +----------- +END +------------ ~~~ #### When given three numbers return the largest of them ~~~ +---------- +Start +---------- + | + v --------------------------------- Assign first number as a assign second number as b @@ -180,6 +215,11 @@ assign third number as c ------------- Print c ------------- + | + v +----------- +END +------------ ~~~ #### The game of Nim: @@ -189,13 +229,58 @@ assign third number as c * The person who takes the last stone from the last remaining pile looses. 1. Create a flow chart for the optimal move for a player if there is only one pile. +~~~ +------------------------- +Insert the amount of stones +--------------------------- + +~~~ 1. Create a flow chart for the optimal move for a player if there are exatly two piles. 1. Can you merge these together to create a flowchart for an optimal move if there are two or less piles? Please do so, if yes. 1. What about if there are any number of piles. #### Find the sum of the first 100 numbers 1. modify this to find the sum of the next 100 numbers when given a starting value. +~~~ +---------- +Start +---------- + | + v +----------------------- +Insert initial value=n +----------------------- + |<------------------------------+ + v ^ +---------------------- | +set i=0 | +---------------------- | + | | + v | +--------------- | +increase i by 1 | +--------------- | + / \ | + / \ Yes +-------+-----------------------------+ +/ Is i less \ -----------> |n+(n+1)=n | + |add initial value to initial value +1| +\ than 100 / +-------------------------------------+ + + \ / + \ / + | + |No + v +--------------- +Print n +--------------- + | + v +------------ +END +-------------- +~~~ #### Find the nth fibonaci number * The 0th and the 1st fibonaci numbers are both 1. * All other fibonaci numbers equal the sum of the two before it. From 5bcf2964fd0dbfca96822d186e397d44b2d18c3b Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Wed, 24 Jan 2018 20:15:09 -0600 Subject: [PATCH 06/13] Update Lab_1.md --- Lab_1.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Lab_1.md b/Lab_1.md index 7b9dc2b..a8a6a01 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -229,12 +229,7 @@ END * The person who takes the last stone from the last remaining pile looses. 1. Create a flow chart for the optimal move for a player if there is only one pile. -~~~ -------------------------- -Insert the amount of stones ---------------------------- -~~~ 1. Create a flow chart for the optimal move for a player if there are exatly two piles. 1. Can you merge these together to create a flowchart for an optimal move if there are two or less piles? Please do so, if yes. 1. What about if there are any number of piles. From 2c70aa55d36b967933197c42045ce79e48b9f967 Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Thu, 25 Jan 2018 18:05:34 -0600 Subject: [PATCH 07/13] Update Lab_1.md --- Lab_1.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Lab_1.md b/Lab_1.md index a8a6a01..b5ab7f6 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -229,7 +229,6 @@ END * The person who takes the last stone from the last remaining pile looses. 1. Create a flow chart for the optimal move for a player if there is only one pile. - 1. Create a flow chart for the optimal move for a player if there are exatly two piles. 1. Can you merge these together to create a flowchart for an optimal move if there are two or less piles? Please do so, if yes. 1. What about if there are any number of piles. From 180d29f2e803472e794438a1ec5d5869ad224a20 Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Mon, 5 Feb 2018 19:00:43 -0600 Subject: [PATCH 08/13] Update Lab_1.md --- Lab_1.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/Lab_1.md b/Lab_1.md index b5ab7f6..d47d0f3 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -51,7 +51,7 @@ Start | v ---------------------------- -Start set initial value at 1 +Start set initial value at 0 ---------------------------- |---------------------------------+ v || ^ @@ -87,6 +87,23 @@ Increase Value by 1 || | END ------------ ~~~ +Integer n =number +for (int i=0,i>=n,i++) +{ + if (n%6==0) { + print "Fizz Buzz" + } + else if (n%2==0){ + Print "Fizz" + } + else if (n%3==0){ + Print "Buzz" + } + else{ + Print n + } + } + #### Determine a students letter grade when given the %. ~~~ ---------- @@ -145,6 +162,23 @@ Enter Students Percentage Grade % END ------------ ~~~ +gradePerc= grade value +if(gradePerc > 89){ + Print "A" + } +else if (gradePerc > 79){ + Print "B" + } +else if (gradePerc > 69){ + Print "C" + } +else if (gradePerc > 59){ + Print "D" + } +else { + Print "F" + } + #### Convert a tempature from C to F or vice versa. ~~~ ---------- @@ -178,6 +212,17 @@ Print "New Value" "C" END ------------ ~~~ +teMp = temperature value +String x = Degrees in Celsius or Fahrenheit +if (x == Celsius){ + n=teMp * (9/5) + newTemp= n+32 + Print newTemp +"F" + } +else{ + w = teMp -32 + newteMp = w*(5/9) + } #### When given three numbers return the largest of them ~~~ ---------- From 37219a0905ba2e223cb2eabbc7bf65e0eb0729de Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Mon, 5 Feb 2018 19:01:51 -0600 Subject: [PATCH 09/13] Update Lab_1.md --- Lab_1.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Lab_1.md b/Lab_1.md index d47d0f3..b90340b 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -86,7 +86,7 @@ Increase Value by 1 || | ----------- END ------------ - ~~~ + Integer n =number for (int i=0,i>=n,i++) { @@ -103,7 +103,7 @@ for (int i=0,i>=n,i++) Print n } } - + ~~~ #### Determine a students letter grade when given the %. ~~~ ---------- @@ -161,7 +161,7 @@ Enter Students Percentage Grade % ----------- END ------------ -~~~ + gradePerc= grade value if(gradePerc > 89){ Print "A" @@ -178,7 +178,7 @@ else if (gradePerc > 59){ else { Print "F" } - +~~~ #### Convert a tempature from C to F or vice versa. ~~~ ---------- @@ -211,7 +211,7 @@ Print "New Value" "C" ----------- END ------------ -~~~ + teMp = temperature value String x = Degrees in Celsius or Fahrenheit if (x == Celsius){ @@ -223,6 +223,7 @@ else{ w = teMp -32 newteMp = w*(5/9) } + ~~~ #### When given three numbers return the largest of them ~~~ ---------- From 01aa109f0d95b98bd2e289c6df540e9809677500 Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Mon, 5 Feb 2018 19:05:19 -0600 Subject: [PATCH 10/13] Update Lab_1.md --- Lab_1.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Lab_1.md b/Lab_1.md index b90340b..449aaec 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -59,6 +59,15 @@ Start set initial value at 0 Increase Value by 1 || | ---------------------------- || | | |^ | + V + / \ || | + / \ || | + / \ Yes || | ____________ +/ Is value divisble by 6 \-----------+|--|----- |Print "FizzBuzz"| +\ / || | |____________ | + \ / || ^ + \ / |^ | + |No || | V || ^ / \ || | / \ || | From c12d8baeff3d9fdb0fb305959a5f45c64077acf2 Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Mon, 5 Feb 2018 19:31:18 -0600 Subject: [PATCH 11/13] Update Lab_1.md --- Lab_1.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Lab_1.md b/Lab_1.md index 449aaec..c63b020 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -275,6 +275,21 @@ assign third number as c ----------- END ------------ + +a= first number +b= second number +c= third number +if (a>b && a>c){ + Print a "Is the largest number" + } +else if (b>a && b>c){ + Print b "Is the largest number" +else if (c>a && c>b){ + Print c "Is the largest number" +else{ + Print "There are numbers that are equal" + } + ~~~ #### The game of Nim: From bc57cc8696a3c3e5ea5f2a7cefc48e075ab3c1fb Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Mon, 5 Feb 2018 19:34:52 -0600 Subject: [PATCH 12/13] Update Lab_1.md --- Lab_1.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lab_1.md b/Lab_1.md index c63b020..8104599 100644 --- a/Lab_1.md +++ b/Lab_1.md @@ -343,7 +343,9 @@ Print n ------------ END -------------- - +n=initial value +for (int i=0,i<101,i++){ +} ~~~ #### Find the nth fibonaci number * The 0th and the 1st fibonaci numbers are both 1. From b4d0cd15b2f46a6e010e4ecef98109aa2bde84b9 Mon Sep 17 00:00:00 2001 From: SkylarGalloway <35279968+SkylarGalloway@users.noreply.github.com> Date: Mon, 5 Feb 2018 20:28:22 -0600 Subject: [PATCH 13/13] Rename Lab_1.md to Lab_1 code.md --- Lab_1.md => Lab_1 code.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Lab_1.md => Lab_1 code.md (100%) diff --git a/Lab_1.md b/Lab_1 code.md similarity index 100% rename from Lab_1.md rename to Lab_1 code.md