https://computersciencewiki.org/index.php?title=Designing_solutions_through_programming_-_October_11_2016_Lesson_Notes&feed=atom&action=history
Designing solutions through programming - October 11 2016 Lesson Notes - Revision history
2024-03-29T09:25:32Z
Revision history for this page on the wiki
MediaWiki 1.39.6
https://computersciencewiki.org/index.php?title=Designing_solutions_through_programming_-_October_11_2016_Lesson_Notes&diff=3710&oldid=prev
Mr. MacKenty: Created page with " __NOTOC__ <table cellspacing="10" style="width:100%;"> <tr> <td style="width:50%; margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1..."
2016-10-11T07:37:59Z
<p>Created page with " __NOTOC__ <table cellspacing="10" style="width:100%;"> <tr> <td style="width:50%; margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1..."</p>
<p><b>New page</b></p><div> __NOTOC__ <br />
<table cellspacing="10" style="width:100%;"><br />
<tr><br />
<td style="width:50%; margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#E6F9E6; align:right;vertical-align:top;"><br />
==[[File:class_plan.png]] What are we going to learn today?==<br />
<br />
# Today in class we will start learning about collections and arrays. THESE ARE DIFFERENT. <br />
# If using weapons as array examples offends you, please use [http://mikesrpgcenter.com/bgate/potions.html this potion list as an alternative].<br />
<br />
<syntaxhighlight lang="php"><br />
<?php<br />
<br />
# this file is used to teach the VERY BASICS of arrays in PHP<br />
<br />
$shop_items = array(<br />
"short sword",<br />
"dagger",<br />
"flail",<br />
"morning star",<br />
"spear",<br />
"long bow",<br />
"crossbow",<br />
"long sword",<br />
"two handed sword",<br />
"scimitar",<br />
"short bow",<br />
"staff",<br />
"club"<br />
);<br />
<br />
# This creates a very simple array.<br />
# We can perform some different operations on this array:<br />
<br />
# count the items in the array: <br />
<br />
echo "<p>Welcome to our shop. We sell many things for adventurers </p>";<br />
echo "<p>==========================================</p>";<br />
<br />
# let's list our inventory:<br />
<br />
for ($i = 0; $i < count($shop_items); $i++)<br />
{<br />
<br />
echo $i . " - $shop_items[$i] <br />";<br />
<br />
}<br />
?><br />
<br />
</syntaxhighlight><br />
<br />
<br />
Below we have an example if an associative array: <br />
<br />
<syntaxhighlight lang="php"><br />
<?php<br />
<br />
# this file is used to teach the VERY BASICS of arrays in PHP<br />
<br />
$shop_items = array(<br />
"short sword" =>"10",<br />
"dagger" => "2",<br />
"flail" => "12",<br />
"morning star" => "15",<br />
"spear" => "25",<br />
"long bow" => "15",<br />
"crossbow" => "20",<br />
"long sword" => "21",<br />
"two handed sword" => "30",<br />
"scimitar" => "18",<br />
"short bow" => "15",<br />
"staff" => "5",<br />
"club" => "2"<br />
);<br />
<br />
# This creates a very simple array.<br />
# We can perform some different operations on this array:<br />
<br />
# count the items in the array: <br />
<br />
echo "<p>Welcome to our shop. We sell many things for adventurers </p>";<br />
echo "<p>==========================================</p>";<br />
<br />
# let's list our inventory:<br />
<br />
foreach ($shop_items as $i => $cost_of_item)<br />
{<br />
<br />
echo $i . " costs $cost_of_item <br />";<br />
<br />
}<br />
?><br />
<br />
</syntaxhighlight><br />
<br />
<br />
</td><br />
<br />
<td style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#E6F9E6; align:right;vertical-align:top;"><br />
<br />
==[[file:homework.png]] Homework ==<br />
<br />
# Please review our page about [[collections]] and [[arrays]]<br />
<br />
<br />
</td><br />
</tr><br />
<tr><br />
<br />
<td style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:lightyellow; align:right;vertical-align:top;" colspan="2"><br />
<br />
==[[File:target.png]] How am I being assessed today? ==<br />
<br />
# You will be formatively assessed in class today<br />
<br />
</td><br />
<br />
</tr><br />
<tr><br />
<br />
<td style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#FFF5FF; align:right;vertical-align:top;"><br />
<br />
== [[File:ourstandards.png]] Standards we are covering today ==<br />
* Describe the characteristics and applications of a collection. <br />
* Construct algorithms using the access methods of a collection.<br />
* [[Designing solutions through programming standards | Click here for all our standards]]<br />
<br />
<br />
<br />
<br />
</td><br />
<br />
<br />
<br />
<td style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#FFF5FF; align:right;vertical-align:top;" colspan="2"><br />
<br />
== [[Image:computer1.png]] As a computer scientist, you have: ==<br />
<br />
* Confidence in dealing with complexity<br />
* Persistence in working with difficult problems<br />
* Tolerance for ambiguity<br />
* The ability to deal with open-ended problems<br />
* The ability to communicate and work with others to achieve a common goal or solution<br />
<br />
</td><br />
</tr><br />
<tr><br />
<td style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:lightgray; align:right;vertical-align:top;" colspan="2"><br />
<br />
== [[Image:credit.png]] Credits ==<br />
* Icons used with tremendous gratitude by [http://www.freepik.com/ Freepik] from [http://www.flaticon.com/ flaticon]<br />
</td><br />
</tr><br />
</table><br />
[[Category:2016-2017 Class Notes]]<br />
[[Category:2016-2017 School Year]]</div>
Mr. MacKenty