{"id":306,"date":"2021-01-21T11:11:44","date_gmt":"2021-01-21T11:11:44","guid":{"rendered":"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/?page_id=306"},"modified":"2021-03-04T10:55:31","modified_gmt":"2021-03-04T10:55:31","slug":"coding","status":"publish","type":"page","link":"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/coding\/","title":{"rendered":"Coding"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Week 1<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">DIY Task 1 Evidence&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Task:&nbsp;&nbsp;Write C# code that displays your full name, askes what year you were born and e.g.2000 and askes for the current year e.g. 2020. The application should display your name the year born and current year and calculate and display how old you are in years. Upload slot on Moodle&nbsp;&nbsp;<\/td><\/tr><tr><td>Code:&nbsp;using&nbsp;System;&nbsp;<br>   public class Test&nbsp;<br>{&nbsp;<br>         public static void&nbsp;Main()&nbsp;<br>{&nbsp;<br>Console.WriteLine(&#8220;Nils&nbsp;Slivackis&#8221;);&nbsp;<br>int&nbsp;numberBox;&nbsp;<br>int&nbsp;numberBox2;&nbsp;<br>numberBox=Convert.ToInt32(&nbsp;Console.ReadLine());&nbsp;<br>numberBox2=Convert.ToInt32(&nbsp;Console.ReadLine());&nbsp;<br>Console.WriteLine(numberBox);&nbsp;<br>Console.WriteLine(numberBox2);&nbsp;<br>      \/\/Output 22 as text&nbsp;&nbsp;<br>Console.WriteLine(&#8220;The Sum of {0} &#8211; {1} = {2}&#8221;,numberBox2,numberBox, (numberBox2-numberBox));&nbsp;<br>}&nbsp;<br>}&nbsp;<\/td><\/tr><tr><td>Problems:&nbsp;&nbsp;I didn&#8217;t really have any problems with this task it was pretty simple.<\/td><\/tr><tr><td>Research:for research i didn&#8217;t need to do a lot because Robert gave us example codes that contained little bits of the code we needed so i just looked threw the practice codes and figured out what to do <\/td><\/tr><tr><td>Evaluation: Although i don&#8217;t like coding for now it&#8217;s pretty simple <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Week 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Task 2&nbsp;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>using&nbsp;System;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>public class Test<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>{<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>public static void&nbsp;Main()<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>{<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong><\/strong> <strong>string&nbsp;yourName&nbsp;= &#8220;Nils&nbsp;Slivackis&#8221;;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong><\/strong> <strong>int&nbsp;yourAge=29;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong><\/strong> <strong>Console.WriteLine(yourName);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong><\/strong> <strong>Console.WriteLine(yourAge);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>}<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>}<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Task 3&nbsp;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>using&nbsp;System;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>public class Test<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>{<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>public static void&nbsp;Main()<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>{<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;string&nbsp;yourName;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;int&nbsp;yourAge;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;Console.WriteLine(&#8220;Nils&nbsp;Slivackis&#8221;);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;yourName=Console.ReadLine();<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;Console.WriteLine(&#8220;19&#8221;);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;yourAge=Convert.ToInt32(Console.ReadLine());<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;Console.WriteLine(&#8220;Hi {0}&#8221;,yourName);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;Console.WriteLine(&#8220;you are {0} years old&#8221;,&nbsp;yourAge);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>}<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>}<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Task 4<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>using&nbsp;System;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>public class Test<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>{<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>public static void&nbsp;Main()<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>{<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;int&nbsp;yourAge;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;Console.WriteLine(&#8220;Please enter your age&#8221;);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;yourAge=Convert.ToInt32(Console.ReadLine());<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;if(yourAge==18);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;{<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;<\/strong> <strong>Console.WriteLine(&#8220;You are {0} years old&#8221;,yourAge);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;}<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;Console.WriteLine(&#8220;The End&#8221;);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>}<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>}<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Task 6&nbsp;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>using&nbsp;System;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>public class Test<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>{<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>public static void&nbsp;Main()<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>{<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;int&nbsp;yourAge;<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;Console.WriteLine(&#8220;pleas enter your age here&#8221;);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;yourAge=Convert.ToInt32(Console.ReadLine());<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;if(yourAge&gt;=18);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;{<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;<\/strong> <strong>Console.WriteLine(&#8220;you are 18 or older&#8221;);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;}<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>&nbsp;Console.WriteLine(&#8220;The end&#8221;);<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><\/strong> <strong>}<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>}<\/strong>\u00a0<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Task:\u00a0\u00a0\u00a0Develop C# code that uses asks for user Age as an int data type. This numbers then used in 3 if () statement and tests<br>.Age is grater then 0 and less then 5, and output &#8220;infant&#8221;<br>.Age is grater then 5 but less then or equal to 16, and outputs &#8220;school&#8221;<br>.Age is greater then 16, and outputs &#8220;college&#8221;<br><\/td><\/tr><tr><td>Code:\u00a0using System;<br>public class Test<br>{<br>public static void Main()<br>{<br>int myAge=4;<br>if(myAge&lt;5) { Console.WriteLine(&#8220;Infent&#8221;); }else if(myAge&gt;=5 &amp;&amp; myAge&lt;=10)<br>{<br>Console.WriteLine(&#8220;School&#8221;);<br><code>}else if(myAge&gt;10 &amp;&amp; myAge&lt;=16) { Console.WriteLine(\"college\"); } }<\/code><br>}<\/td><\/tr><tr><td>Problems:\u00a0I had problems on figuring out how to write the code but after some research and help I figured it out <\/td><\/tr><tr><td>Research: I looked at the task codes we had and in the end used to codes to make one and changed the &#8220;test point&#8221; to infant, school and college  <\/td><\/tr><tr><td>Evaluation: Once i figured out the code it was relatively easy to write only problems i ran it to during me typing it up was forgetting to but capital letters and some symbols.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Week 1 DIY Task 1 Evidence&nbsp; Task:&nbsp;&nbsp;Write C# code that displays your full name, askes what year you were born and e.g.2000 and askes for the current year e.g. 2020. The application should display your name the year born and current year and calculate and display how old you are in years. Upload slot on &hellip; <a href=\"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/coding\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Coding&#8221;<\/span><\/a><\/p>\n","protected":false},"author":197,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-306","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/wp-json\/wp\/v2\/pages\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/wp-json\/wp\/v2\/users\/197"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":12,"href":"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/wp-json\/wp\/v2\/pages\/306\/revisions"}],"predecessor-version":[{"id":386,"href":"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/wp-json\/wp\/v2\/pages\/306\/revisions\/386"}],"wp:attachment":[{"href":"https:\/\/digitalspace.bradfordcollege.ac.uk\/10605683\/wp-json\/wp\/v2\/media?parent=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}