syntax highlighting fix

main
borb 1 week ago
parent 441a7424cc
commit a87d654f80

@ -13,10 +13,10 @@
/* buutti.css */ /* buutti.css */
/* @theme buutti */div#\:\$p>svg>foreignObject>section .columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns12{display:grid;grid-template-columns:1fr 2fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns21{display:grid;grid-template-columns:2fr 1fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns32{display:grid;grid-template-columns:3fr 2fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns23{display:grid;grid-template-columns:2fr 3fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns111{display:grid;grid-template-columns:1fr 1fr 1fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .centered{display:flex;flex-direction:column;justify-content:center;text-align:center}div#\:\$p>svg>foreignObject>section .tableborderless td,div#\:\$p>svg>foreignObject>section th{border:none!important;border-collapse:collapse}div#\:\$p>svg>foreignObject>section.extra{background-color:#5d275d;background-image:linear-gradient(to bottom,#401a40,#1d0c1d);color:white}div#\:\$p>svg>foreignObject>section.extra a{color:rgb(145,255,209)}div#\:\$p>svg>foreignObject>section.exercise{background-color:#29366f;background-image:linear-gradient(to bottom,#20636a,#173742);color:white}div#\:\$p>svg>foreignObject>section.exercise a{color:rgb(211,173,255)} /* @theme buutti */div#\:\$p>svg>foreignObject>section .columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns12{display:grid;grid-template-columns:1fr 2fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns21{display:grid;grid-template-columns:2fr 1fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns32{display:grid;grid-template-columns:3fr 2fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns23{display:grid;grid-template-columns:2fr 3fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns111{display:grid;grid-template-columns:1fr 1fr 1fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .centered{display:flex;flex-direction:column;justify-content:center;text-align:center}div#\:\$p>svg>foreignObject>section .tableborderless td,div#\:\$p>svg>foreignObject>section th{border:none!important;border-collapse:collapse}div#\:\$p>svg>foreignObject>section.extra{background-color:#5d275d;background-image:linear-gradient(to bottom,#401a40,#1d0c1d);color:white}div#\:\$p>svg>foreignObject>section.extra a{color:rgb(145,255,209)}div#\:\$p>svg>foreignObject>section.exercise{background-color:#29366f;background-image:linear-gradient(to bottom,#20636a,#173742);color:white}div#\:\$p>svg>foreignObject>section.exercise a{color:rgb(211,173,255)}
/* @theme wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej */div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]{columns:initial!important;display:block!important;padding:0!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:before,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:before{display:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]{all:initial;display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container][data-marpit-advanced-background-direction=vertical]{flex-direction:column}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split]>div[data-marpit-advanced-background-container]{width:var(--marpit-advanced-background-split,50%)}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split=right]>div[data-marpit-advanced-background-container]{margin-left:calc(100% - var(--marpit-advanced-background-split, 50%))}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure{all:initial;background-position:center;background-repeat:no-repeat;background-size:cover;flex:auto;margin:0}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure>figcaption{position:absolute;border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content],div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo]{background:transparent!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo],div#\:\$p>svg[data-marpit-svg]>foreignObject[data-marpit-advanced-background=pseudo]{pointer-events:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background-split]{width:100%;height:100%}</style></head><body><div class="bespoke-marp-osc"><button data-bespoke-marp-osc="prev" tabindex="-1" title="Previous slide">Previous slide</button><span data-bespoke-marp-osc="page"></span><button data-bespoke-marp-osc="next" tabindex="-1" title="Next slide">Next slide</button><button data-bespoke-marp-osc="fullscreen" tabindex="-1" title="Toggle fullscreen (f)">Toggle fullscreen</button><button data-bespoke-marp-osc="presenter" tabindex="-1" title="Open presenter view (p)">Open presenter view</button></div><div id=":$p"><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="1" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej" lang="en-US" class="invert" data-marpit-pagination="1" style="--paginate:true;--class:invert;--heading-divider:5;--theme:wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej;" data-marpit-pagination-total="9"> /* @theme jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm */div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]{columns:initial!important;display:block!important;padding:0!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:before,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:before{display:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]{all:initial;display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container][data-marpit-advanced-background-direction=vertical]{flex-direction:column}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split]>div[data-marpit-advanced-background-container]{width:var(--marpit-advanced-background-split,50%)}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split=right]>div[data-marpit-advanced-background-container]{margin-left:calc(100% - var(--marpit-advanced-background-split, 50%))}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure{all:initial;background-position:center;background-repeat:no-repeat;background-size:cover;flex:auto;margin:0}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure>figcaption{position:absolute;border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content],div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo]{background:transparent!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo],div#\:\$p>svg[data-marpit-svg]>foreignObject[data-marpit-advanced-background=pseudo]{pointer-events:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background-split]{width:100%;height:100%}</style></head><body><div class="bespoke-marp-osc"><button data-bespoke-marp-osc="prev" tabindex="-1" title="Previous slide">Previous slide</button><span data-bespoke-marp-osc="page"></span><button data-bespoke-marp-osc="next" tabindex="-1" title="Next slide">Next slide</button><button data-bespoke-marp-osc="fullscreen" tabindex="-1" title="Toggle fullscreen (f)">Toggle fullscreen</button><button data-bespoke-marp-osc="presenter" tabindex="-1" title="Open presenter view (p)">Open presenter view</button></div><div id=":$p"><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="1" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm" lang="en-US" class="invert" data-marpit-pagination="1" style="--paginate:true;--class:invert;--heading-divider:5;--theme:jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm;" data-marpit-pagination-total="9">
<h1 id="introduction-to-c-and-net">Introduction to C# and .NET</h1> <h1 id="introduction-to-c-and-net">Introduction to C# and .NET</h1>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="2" data-marpit-fragments="4" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej" lang="en-US" class="invert" data-marpit-pagination="2" style="--paginate:true;--class:invert;--heading-divider:5;--theme:wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej;" data-marpit-pagination-total="9"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="2" data-marpit-fragments="4" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm" lang="en-US" class="invert" data-marpit-pagination="2" style="--paginate:true;--class:invert;--heading-divider:5;--theme:jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm;" data-marpit-pagination-total="9">
<h2 id="overview">Overview</h2> <h2 id="overview">Overview</h2>
<ul> <ul>
<li data-marpit-fragment="1">C#</li> <li data-marpit-fragment="1">C#</li>
@ -25,7 +25,7 @@
<li data-marpit-fragment="4">Base Class Library (BCL)</li> <li data-marpit-fragment="4">Base Class Library (BCL)</li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="3" data-marpit-fragments="5" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej" lang="en-US" class="invert" data-marpit-pagination="3" style="--paginate:true;--class:invert;--heading-divider:5;--theme:wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej;" data-marpit-pagination-total="9"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="3" data-marpit-fragments="5" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm" lang="en-US" class="invert" data-marpit-pagination="3" style="--paginate:true;--class:invert;--heading-divider:5;--theme:jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm;" data-marpit-pagination-total="9">
<h2 id="c">C#</h2> <h2 id="c">C#</h2>
<div class='columns' markdown='1'> <div class='columns' markdown='1'>
<div markdown='1'> <div markdown='1'>
@ -43,11 +43,11 @@
</div> </div>
</div> </div>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="4" data-marpit-fragments="6" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej" lang="en-US" class="invert" data-marpit-pagination="4" style="--paginate:true;--class:invert;--heading-divider:5;--theme:wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej;" data-marpit-pagination-total="9"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="4" data-marpit-fragments="6" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm" lang="en-US" class="invert" data-marpit-pagination="4" style="--paginate:true;--class:invert;--heading-divider:5;--theme:jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm;" data-marpit-pagination-total="9">
<h2 id="c-syntax-example">C# Syntax example</h2> <h2 id="c-syntax-example">C# Syntax example</h2>
<div class='columns' markdown='1'> <div class='columns' markdown='1'>
<div markdown='1'> <div markdown='1'>
<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-c#"><span class="hljs-keyword">using</span> System; <pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-keyword">using</span> System;
<span class="hljs-keyword">namespace</span> <span class="hljs-title">MyAwesomeProgram</span> <span class="hljs-keyword">namespace</span> <span class="hljs-title">MyAwesomeProgram</span>
{ {
@ -75,7 +75,7 @@
<li data-marpit-fragment="6">Try out the <a href="https://www.programiz.com/csharp-programming/online-compiler/">online compiler</a>!</li> <li data-marpit-fragment="6">Try out the <a href="https://www.programiz.com/csharp-programming/online-compiler/">online compiler</a>!</li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="5" data-marpit-fragments="6" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej" lang="en-US" class="invert" data-marpit-pagination="5" style="--paginate:true;--class:invert;--heading-divider:5;--theme:wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej;" data-marpit-pagination-total="9"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="5" data-marpit-fragments="6" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm" lang="en-US" class="invert" data-marpit-pagination="5" style="--paginate:true;--class:invert;--heading-divider:5;--theme:jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm;" data-marpit-pagination-total="9">
<h2 id="net">.NET</h2> <h2 id="net">.NET</h2>
<ul> <ul>
<li data-marpit-fragment="1">.NET (pronounced <em>dot net</em>) is Microsoft's software framework for building and running web services <li data-marpit-fragment="1">.NET (pronounced <em>dot net</em>) is Microsoft's software framework for building and running web services
@ -89,7 +89,7 @@
<li data-marpit-fragment="6">Type-safe and memory-safe thanks to GC and strict compilers</li> <li data-marpit-fragment="6">Type-safe and memory-safe thanks to GC and strict compilers</li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="6" data-marpit-fragments="11" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej" lang="en-US" class="invert" data-marpit-pagination="6" style="--paginate:true;--class:invert;--heading-divider:5;--theme:wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej;" data-marpit-pagination-total="9"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="6" data-marpit-fragments="11" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm" lang="en-US" class="invert" data-marpit-pagination="6" style="--paginate:true;--class:invert;--heading-divider:5;--theme:jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm;" data-marpit-pagination-total="9">
<h2 id="net-vs-net-framework">.NET vs .NET Framework</h2> <h2 id="net-vs-net-framework">.NET vs .NET Framework</h2>
<ul> <ul>
<li data-marpit-fragment="1"><em>.NET Framework</em> <li data-marpit-fragment="1"><em>.NET Framework</em>
@ -111,7 +111,7 @@
<li data-marpit-fragment="11">We will be using .NET Core as the .NET Framework is considered legacy</li> <li data-marpit-fragment="11">We will be using .NET Core as the .NET Framework is considered legacy</li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="7" data-marpit-fragments="4" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej" lang="en-US" class="invert" data-marpit-pagination="7" style="--paginate:true;--class:invert;--heading-divider:5;--theme:wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej;" data-marpit-pagination-total="9"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="7" data-marpit-fragments="4" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm" lang="en-US" class="invert" data-marpit-pagination="7" style="--paginate:true;--class:invert;--heading-divider:5;--theme:jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm;" data-marpit-pagination-total="9">
<h2 id="common-language-infrastructure-cli">Common Language Infrastructure (CLI)</h2> <h2 id="common-language-infrastructure-cli">Common Language Infrastructure (CLI)</h2>
<div class='columns32' markdown='1'> <div class='columns32' markdown='1'>
<div markdown='1'> <div markdown='1'>
@ -130,7 +130,7 @@
</div> </div>
</div> </div>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="8" data-marpit-fragments="3" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej" lang="en-US" class="invert" data-marpit-pagination="8" style="--paginate:true;--class:invert;--heading-divider:5;--theme:wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej;" data-marpit-pagination-total="9"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="8" data-marpit-fragments="3" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm" lang="en-US" class="invert" data-marpit-pagination="8" style="--paginate:true;--class:invert;--heading-divider:5;--theme:jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm;" data-marpit-pagination-total="9">
<h2 id="base-class-library-bcl">Base Class Library (BCL)</h2> <h2 id="base-class-library-bcl">Base Class Library (BCL)</h2>
<ul> <ul>
<li data-marpit-fragment="1"><a href="https://learn.microsoft.com/en-us/dotnet/standard/class-library-overview">Base Class Library</a> (BCL) is a set of libraries that every .NET implementation uses, mostly under the <code>System</code> namespace</li> <li data-marpit-fragment="1"><a href="https://learn.microsoft.com/en-us/dotnet/standard/class-library-overview">Base Class Library</a> (BCL) is a set of libraries that every .NET implementation uses, mostly under the <code>System</code> namespace</li>
@ -143,7 +143,7 @@
</li> </li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="9" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej" lang="en-US" class="exercise invert" data-marpit-pagination="9" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej;" data-marpit-pagination-total="9"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="9" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm" lang="en-US" class="exercise invert" data-marpit-pagination="9" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:jt1qn45ts973hqy674gnpigfw2yjy0wu42ji3bolvcm;" data-marpit-pagination-total="9">
<h2 id="assignments">Assignments</h2> <h2 id="assignments">Assignments</h2>
<p><a href="https://gitea.buutti.com/education/academy-assignments/src/branch/master/C%23%20Basics/1.%20C%23%20Basics%20Assignments">Assignments about this topic can be found here</a></p> <p><a href="https://gitea.buutti.com/education/academy-assignments/src/branch/master/C%23%20Basics/1.%20C%23%20Basics%20Assignments">Assignments about this topic can be found here</a></p>

@ -44,7 +44,7 @@ Source: [http://pypl.github.io/PYPL.html](http://pypl.github.io/PYPL.html)
<div class='columns' markdown='1'> <div class='columns' markdown='1'>
<div markdown='1'> <div markdown='1'>
```c# ```csharp
using System; using System;
namespace MyAwesomeProgram namespace MyAwesomeProgram

@ -13,10 +13,10 @@
/* buutti.css */ /* buutti.css */
/* @theme buutti */div#\:\$p>svg>foreignObject>section .columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns12{display:grid;grid-template-columns:1fr 2fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns21{display:grid;grid-template-columns:2fr 1fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns32{display:grid;grid-template-columns:3fr 2fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns23{display:grid;grid-template-columns:2fr 3fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns111{display:grid;grid-template-columns:1fr 1fr 1fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .centered{display:flex;flex-direction:column;justify-content:center;text-align:center}div#\:\$p>svg>foreignObject>section .tableborderless td,div#\:\$p>svg>foreignObject>section th{border:none!important;border-collapse:collapse}div#\:\$p>svg>foreignObject>section.extra{background-color:#5d275d;background-image:linear-gradient(to bottom,#401a40,#1d0c1d);color:white}div#\:\$p>svg>foreignObject>section.extra a{color:rgb(145,255,209)}div#\:\$p>svg>foreignObject>section.exercise{background-color:#29366f;background-image:linear-gradient(to bottom,#20636a,#173742);color:white}div#\:\$p>svg>foreignObject>section.exercise a{color:rgb(211,173,255)} /* @theme buutti */div#\:\$p>svg>foreignObject>section .columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns12{display:grid;grid-template-columns:1fr 2fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns21{display:grid;grid-template-columns:2fr 1fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns32{display:grid;grid-template-columns:3fr 2fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns23{display:grid;grid-template-columns:2fr 3fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .columns111{display:grid;grid-template-columns:1fr 1fr 1fr;gap:calc(var(--marpit-root-font-size, 1rem) * 1)}div#\:\$p>svg>foreignObject>section .centered{display:flex;flex-direction:column;justify-content:center;text-align:center}div#\:\$p>svg>foreignObject>section .tableborderless td,div#\:\$p>svg>foreignObject>section th{border:none!important;border-collapse:collapse}div#\:\$p>svg>foreignObject>section.extra{background-color:#5d275d;background-image:linear-gradient(to bottom,#401a40,#1d0c1d);color:white}div#\:\$p>svg>foreignObject>section.extra a{color:rgb(145,255,209)}div#\:\$p>svg>foreignObject>section.exercise{background-color:#29366f;background-image:linear-gradient(to bottom,#20636a,#173742);color:white}div#\:\$p>svg>foreignObject>section.exercise a{color:rgb(211,173,255)}
/* @theme oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl */div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]{columns:initial!important;display:block!important;padding:0!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:before,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:before{display:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]{all:initial;display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container][data-marpit-advanced-background-direction=vertical]{flex-direction:column}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split]>div[data-marpit-advanced-background-container]{width:var(--marpit-advanced-background-split,50%)}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split=right]>div[data-marpit-advanced-background-container]{margin-left:calc(100% - var(--marpit-advanced-background-split, 50%))}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure{all:initial;background-position:center;background-repeat:no-repeat;background-size:cover;flex:auto;margin:0}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure>figcaption{position:absolute;border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content],div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo]{background:transparent!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo],div#\:\$p>svg[data-marpit-svg]>foreignObject[data-marpit-advanced-background=pseudo]{pointer-events:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background-split]{width:100%;height:100%}</style></head><body><div class="bespoke-marp-osc"><button data-bespoke-marp-osc="prev" tabindex="-1" title="Previous slide">Previous slide</button><span data-bespoke-marp-osc="page"></span><button data-bespoke-marp-osc="next" tabindex="-1" title="Next slide">Next slide</button><button data-bespoke-marp-osc="fullscreen" tabindex="-1" title="Toggle fullscreen (f)">Toggle fullscreen</button><button data-bespoke-marp-osc="presenter" tabindex="-1" title="Open presenter view (p)">Open presenter view</button></div><div id=":$p"><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="1" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="1" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> /* @theme 8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p */div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]{columns:initial!important;display:block!important;padding:0!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:before,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:before{display:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]{all:initial;display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container][data-marpit-advanced-background-direction=vertical]{flex-direction:column}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split]>div[data-marpit-advanced-background-container]{width:var(--marpit-advanced-background-split,50%)}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split=right]>div[data-marpit-advanced-background-container]{margin-left:calc(100% - var(--marpit-advanced-background-split, 50%))}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure{all:initial;background-position:center;background-repeat:no-repeat;background-size:cover;flex:auto;margin:0}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure>figcaption{position:absolute;border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content],div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo]{background:transparent!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo],div#\:\$p>svg[data-marpit-svg]>foreignObject[data-marpit-advanced-background=pseudo]{pointer-events:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background-split]{width:100%;height:100%}</style></head><body><div class="bespoke-marp-osc"><button data-bespoke-marp-osc="prev" tabindex="-1" title="Previous slide">Previous slide</button><span data-bespoke-marp-osc="page"></span><button data-bespoke-marp-osc="next" tabindex="-1" title="Next slide">Next slide</button><button data-bespoke-marp-osc="fullscreen" tabindex="-1" title="Toggle fullscreen (f)">Toggle fullscreen</button><button data-bespoke-marp-osc="presenter" tabindex="-1" title="Open presenter view (p)">Open presenter view</button></div><div id=":$p"><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="1" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="1" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h1 id="variables-and-types">Variables and Types</h1> <h1 id="variables-and-types">Variables and Types</h1>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="2" data-marpit-fragments="9" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="2" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="2" data-marpit-fragments="9" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="2" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="overview">Overview</h2> <h2 id="overview">Overview</h2>
<ul> <ul>
<li data-marpit-fragment="1">Variables</li> <li data-marpit-fragment="1">Variables</li>
@ -30,7 +30,7 @@
<li data-marpit-fragment="9">String Interpolation</li> <li data-marpit-fragment="9">String Interpolation</li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="3" data-marpit-fragments="4" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="3" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="3" data-marpit-fragments="4" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="3" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="variables">Variables</h2> <h2 id="variables">Variables</h2>
<ul> <ul>
<li data-marpit-fragment="1">A variable can be thought of as a name for a certain address in computer's memory <li data-marpit-fragment="1">A variable can be thought of as a name for a certain address in computer's memory
@ -42,7 +42,7 @@
<li data-marpit-fragment="4">On more practical terms: We can assign values to named variables.</li> <li data-marpit-fragment="4">On more practical terms: We can assign values to named variables.</li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="4" data-marpit-fragments="3" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="4" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="4" data-marpit-fragments="3" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="4" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="declaring-variables">Declaring variables</h3> <h3 id="declaring-variables">Declaring variables</h3>
<ul> <ul>
<li data-marpit-fragment="1">Every variable declaration in C# requires the <em><strong>type</strong></em> and the <em><strong>name</strong></em> of the variable, for example:<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-built_in">int</span> x; <li data-marpit-fragment="1">Every variable declaration in C# requires the <em><strong>type</strong></em> and the <em><strong>name</strong></em> of the variable, for example:<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-built_in">int</span> x;
@ -56,7 +56,7 @@
</li> </li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="5" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="5" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="5" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="5" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="printing-to-console-with-consolewriteline">Printing to console with <code>Console.WriteLine</code></h3> <h3 id="printing-to-console-with-consolewriteline">Printing to console with <code>Console.WriteLine</code></h3>
<div class='columns' markdown='1'> <div class='columns' markdown='1'>
<div markdown='1'> <div markdown='1'>
@ -90,12 +90,12 @@ Console.WriteLine(example);
</div> </div>
</div> </div>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="6" data-marpit-fragments="4" data-paginate="true" data-class="extra invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="extra invert" data-marpit-pagination="6" style="--paginate:true;--class:extra invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="6" data-marpit-fragments="4" data-paginate="true" data-class="extra invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="extra invert" data-marpit-pagination="6" style="--paginate:true;--class:extra invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="extra-modifiers">Extra: Modifiers</h3> <h3 id="extra-modifiers">Extra: Modifiers</h3>
<ul> <ul>
<li data-marpit-fragment="1">A common modifier to add in front of a variable is <code>const</code>, short for <em><strong>constant</strong></em></li> <li data-marpit-fragment="1">A common modifier to add in front of a variable is <code>const</code>, short for <em><strong>constant</strong></em></li>
<li data-marpit-fragment="2">If we know that a value of a variable is never going to change during the execution of the script, we can set it to <code>const</code>:<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-c#"><span class="hljs-keyword">const</span> <span class="hljs-built_in">int</span> one = <span class="hljs-number">1</span>; <li data-marpit-fragment="2">If we know that a value of a variable is never going to change during the execution of the script, we can set it to <code>const</code>:<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-keyword">const</span> <span class="hljs-built_in">int</span> one = <span class="hljs-number">1</span>;
one = <span class="hljs-number">2</span>; <span class="hljs-comment">// raises an error</span> one = <span class="hljs-number">2</span>; <span class="hljs-comment">// raises an error</span>
</code></pre> </code></pre>
@ -104,7 +104,7 @@ one = <span class="hljs-number">2</span>; <span class="hljs-comment">// raises
<li data-marpit-fragment="4">Other modifiers include <em><strong>access modifiers</strong></em> introduced in <a href="7-classes-and-objects#access-modifiers">Lecture 7</a>.</li> <li data-marpit-fragment="4">Other modifiers include <em><strong>access modifiers</strong></em> introduced in <a href="7-classes-and-objects#access-modifiers">Lecture 7</a>.</li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="7" data-marpit-fragments="3" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="7" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="7" data-marpit-fragments="3" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="7" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="comments">Comments</h2> <h2 id="comments">Comments</h2>
<ul> <ul>
<li data-marpit-fragment="1">There are two basic ways to comment in C#:<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-comment">// This is a comment</span> <li data-marpit-fragment="1">There are two basic ways to comment in C#:<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-comment">// This is a comment</span>
@ -121,10 +121,10 @@ a) explain your code<br />
b) comment out actual code for testing and debugging</li> b) comment out actual code for testing and debugging</li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="8" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="8" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="8" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="8" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="data-types">Data types</h2> <h2 id="data-types">Data types</h2>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="9" data-marpit-fragments="6" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="9" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="9" data-marpit-fragments="6" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="9" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="what-is-a-data-type">What is a data type?</h3> <h3 id="what-is-a-data-type">What is a data type?</h3>
<ul> <ul>
<li data-marpit-fragment="1">Data type tells to a computer what type of data is stored in a variable.</li> <li data-marpit-fragment="1">Data type tells to a computer what type of data is stored in a variable.</li>
@ -141,7 +141,7 @@ b) comment out actual code for testing and debugging</li>
</li> </li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="10" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="10" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="10" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="10" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="primitive-data-types">Primitive data types</h2> <h2 id="primitive-data-types">Primitive data types</h2>
<table> <table>
<thead> <thead>
@ -199,7 +199,7 @@ b) comment out actual code for testing and debugging</li>
</table> </table>
<p>More types listed in the <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/built-in-types">C# reference</a>!</p> <p>More types listed in the <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/built-in-types">C# reference</a>!</p>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="11" data-marpit-fragments="1" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="11" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="11" data-marpit-fragments="1" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="11" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="data-type-examples">Data type examples</h3> <h3 id="data-type-examples">Data type examples</h3>
<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-built_in">double</span> airPressure = <span class="hljs-number">1.2</span>; <span class="hljs-comment">// Use for most decimal numbers</span> <pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-built_in">double</span> airPressure = <span class="hljs-number">1.2</span>; <span class="hljs-comment">// Use for most decimal numbers</span>
<span class="hljs-built_in">decimal</span> accountBalance = <span class="hljs-number">1.2</span>m; <span class="hljs-comment">// Use for accuracy (e.g. financial applications)</span> <span class="hljs-built_in">decimal</span> accountBalance = <span class="hljs-number">1.2</span>m; <span class="hljs-comment">// Use for accuracy (e.g. financial applications)</span>
@ -211,7 +211,7 @@ b) comment out actual code for testing and debugging</li>
<li data-marpit-fragment="1"><code>char</code> is only used for single characters, multi-character <em><strong>strings</strong></em> will be introduced in a bit.</li> <li data-marpit-fragment="1"><code>char</code> is only used for single characters, multi-character <em><strong>strings</strong></em> will be introduced in a bit.</li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="12" data-marpit-fragments="2" data-paginate="true" data-class="extra invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="extra invert" data-marpit-pagination="12" style="--paginate:true;--class:extra invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="12" data-marpit-fragments="2" data-paginate="true" data-class="extra invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="extra invert" data-marpit-pagination="12" style="--paginate:true;--class:extra invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="extra-casting-data-types">Extra: Casting data types</h2> <h2 id="extra-casting-data-types">Extra: Casting data types</h2>
<p>Data types can be <em><strong>cast</strong></em> to another either...</p> <p>Data types can be <em><strong>cast</strong></em> to another either...</p>
@ -239,17 +239,17 @@ Console.WriteLine((<span class="hljs-built_in">decimal</span>)a + b);
<li data-marpit-fragment="2"><a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/casting-and-type-conversions">C# Guide: Casting and type conversions</a></li> <li data-marpit-fragment="2"><a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/casting-and-type-conversions">C# Guide: Casting and type conversions</a></li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="13" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="exercise invert" data-marpit-pagination="13" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="13" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="exercise invert" data-marpit-pagination="13" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="assignments-variables">Assignments (variables)</h2> <h2 id="assignments-variables">Assignments (variables)</h2>
<p><a href="https://gitea.buutti.com/education/academy-assignments/src/branch/master/C%23%20Basics/2.1.%20Variables%20&amp;%20Types">Assignments about this topic can be found here</a></p> <p><a href="https://gitea.buutti.com/education/academy-assignments/src/branch/master/C%23%20Basics/2.1.%20Variables%20&amp;%20Types">Assignments about this topic can be found here</a></p>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="14" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="exercise invert" data-marpit-pagination="14" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="14" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="exercise invert" data-marpit-pagination="14" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="assignments-data-types">Assignments (data types)</h2> <h2 id="assignments-data-types">Assignments (data types)</h2>
<p><a href="https://gitea.buutti.com/education/academy-assignments/src/branch/master/C%23%20Basics/2.2.%20Data%20Types">Assignments about this topic can be found here</a></p> <p><a href="https://gitea.buutti.com/education/academy-assignments/src/branch/master/C%23%20Basics/2.2.%20Data%20Types">Assignments about this topic can be found here</a></p>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="15" data-marpit-fragments="7" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="15" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="15" data-marpit-fragments="7" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="15" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="arithmetic-operations">Arithmetic operations?</h2> <h2 id="arithmetic-operations">Arithmetic operations?</h2>
<ul> <ul>
<li data-marpit-fragment="1"><em><strong>Arithmetic operations</strong></em> are common mathematical operations: <li data-marpit-fragment="1"><em><strong>Arithmetic operations</strong></em> are common mathematical operations:
@ -264,7 +264,7 @@ Console.WriteLine((<span class="hljs-built_in">decimal</span>)a + b);
<li data-marpit-fragment="7">The operations are represented by <strong><em>arithmetic operators</em></strong></li> <li data-marpit-fragment="7">The operations are represented by <strong><em>arithmetic operators</em></strong></li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="16" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="16" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="16" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="16" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="arithmetic-operators">Arithmetic Operators</h2> <h2 id="arithmetic-operators">Arithmetic Operators</h2>
<table> <table>
<thead> <thead>
@ -321,7 +321,7 @@ Console.WriteLine((<span class="hljs-built_in">decimal</span>)a + b);
</tbody> </tbody>
</table> </table>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="17" data-marpit-fragments="3" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="exercise invert" data-marpit-pagination="17" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="17" data-marpit-fragments="3" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="exercise invert" data-marpit-pagination="17" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="exercise-1-trying-out-variables">Exercise 1: Trying Out Variables</h2> <h2 id="exercise-1-trying-out-variables">Exercise 1: Trying Out Variables</h2>
<ol> <ol>
@ -330,7 +330,7 @@ Console.WriteLine((<span class="hljs-built_in">decimal</span>)a + b);
<li data-marpit-fragment="3">Print the sum, difference, fraction and product of those values to the console.</li> <li data-marpit-fragment="3">Print the sum, difference, fraction and product of those values to the console.</li>
</ol> </ol>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="18" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="18" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="18" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="18" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="the-assignment-operator">The assignment operator</h2> <h2 id="the-assignment-operator">The assignment operator</h2>
<p>We have used the assignment operator <code>=</code> for assigning values for variables:</p> <p>We have used the assignment operator <code>=</code> for assigning values for variables:</p>
<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-built_in">int</span> x; <pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-built_in">int</span> x;
@ -344,7 +344,7 @@ x = <span class="hljs-number">25</span>;
</li> </li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="19" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="19" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="19" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="19" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="assignment-operators">Assignment operators</h3> <h3 id="assignment-operators">Assignment operators</h3>
<div class='columns' markdown='1'> <div class='columns' markdown='1'>
<div markdown='1'> <div markdown='1'>
@ -398,7 +398,7 @@ x = <span class="hljs-number">25</span>;
</div> </div>
</div> </div>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="20" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="20" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="20" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="20" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="assignment-operators-an-example">Assignment operators: An example</h3> <h3 id="assignment-operators-an-example">Assignment operators: An example</h3>
<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-built_in">int</span> uppercaseLetters = <span class="hljs-number">2</span>; <pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-built_in">int</span> uppercaseLetters = <span class="hljs-number">2</span>;
uppercaseLetters += <span class="hljs-number">4</span>; <span class="hljs-comment">// is now 6</span> uppercaseLetters += <span class="hljs-number">4</span>; <span class="hljs-comment">// is now 6</span>
@ -410,7 +410,7 @@ Console.WriteLine(uppercaseLetters);
Console.WriteLine(specialCharacters); Console.WriteLine(specialCharacters);
</code></pre> </code></pre>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="21" data-marpit-fragments="5" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="21" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="21" data-marpit-fragments="5" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="21" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="increment-and-decrement-operations">Increment and decrement operations</h3> <h3 id="increment-and-decrement-operations">Increment and decrement operations</h3>
<ul> <ul>
<li data-marpit-fragment="1">You can increment or decrement a variable value by 1 with dedicated short-hands <li data-marpit-fragment="1">You can increment or decrement a variable value by 1 with dedicated short-hands
@ -447,7 +447,7 @@ a--; <span class="hljs-comment">// a is now 0</span>
<li data-marpit-fragment="5"><code>++</code> and <code>--</code> are called the <em><strong>increment and decrement operators</strong></em></li> <li data-marpit-fragment="5"><code>++</code> and <code>--</code> are called the <em><strong>increment and decrement operators</strong></em></li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="22" data-marpit-fragments="3" data-paginate="true" data-class="extra invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="extra invert" data-marpit-pagination="22" style="--paginate:true;--class:extra invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="22" data-marpit-fragments="3" data-paginate="true" data-class="extra invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="extra invert" data-marpit-pagination="22" style="--paginate:true;--class:extra invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="extra-incrementdecrement-operation-precedence">Extra: Increment/decrement operation precedence</h3> <h3 id="extra-incrementdecrement-operation-precedence">Extra: Increment/decrement operation precedence</h3>
<ul> <ul>
@ -478,7 +478,7 @@ so its value is 3</p>
</div> </div>
</div> </div>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="23" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="23" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="23" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="23" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="strings">Strings</h2> <h2 id="strings">Strings</h2>
<ul> <ul>
<li data-marpit-fragment="1"><code>string</code> is a special type that contains an array of characters.<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-built_in">string</span> name = <span class="hljs-string">&quot;Sini Aalto&quot;</span>; <li data-marpit-fragment="1"><code>string</code> is a special type that contains an array of characters.<pre is="marp-pre" data-auto-scaling="downscale-only"><code class="language-csharp"><span class="hljs-built_in">string</span> name = <span class="hljs-string">&quot;Sini Aalto&quot;</span>;
@ -494,7 +494,7 @@ Console.WriteLine(fullName); <span class="hljs-comment">// Outputs &quot;Sini
</li> </li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="24" data-marpit-fragments="3" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="24" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="24" data-marpit-fragments="3" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="24" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="character-constants">Character Constants</h3> <h3 id="character-constants">Character Constants</h3>
<ul> <ul>
<li data-marpit-fragment="1">Character constants are preceded by a backslash <code>\</code> and can be used for formatting strings</li> <li data-marpit-fragment="1">Character constants are preceded by a backslash <code>\</code> and can be used for formatting strings</li>
@ -513,7 +513,7 @@ Kantola
<li data-marpit-fragment="3">All character constants are listed <a href="https://www.tutorialspoint.com/csharp/csharp_constants.htm">here</a></li> <li data-marpit-fragment="3">All character constants are listed <a href="https://www.tutorialspoint.com/csharp/csharp_constants.htm">here</a></li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="25" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="25" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="25" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="25" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="string-interpolation">String Interpolation</h3> <h3 id="string-interpolation">String Interpolation</h3>
<ul> <ul>
<li data-marpit-fragment="1">Concatenating multiple variables into one string with the <code>+</code> operator quickly becomes tedious</li> <li data-marpit-fragment="1">Concatenating multiple variables into one string with the <code>+</code> operator quickly becomes tedious</li>
@ -526,7 +526,7 @@ Console.WriteLine(<span class="hljs-string">$&quot;<span class="hljs-subst">{ani
</li> </li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="26" data-marpit-fragments="3" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="26" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="26" data-marpit-fragments="3" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="26" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h3 id="string-formatting">String Formatting</h3> <h3 id="string-formatting">String Formatting</h3>
<ul> <ul>
<li data-marpit-fragment="1">You can add <em><strong>format strings</strong></em> to change the way variables are interpolated into a string</li> <li data-marpit-fragment="1">You can add <em><strong>format strings</strong></em> to change the way variables are interpolated into a string</li>
@ -538,7 +538,7 @@ Console.WriteLine(<span class="hljs-string">$&quot;Pi to three digits: <span cla
</li> </li>
</ul> </ul>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="27" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="invert" data-marpit-pagination="27" style="--paginate:true;--class:invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="27" data-marpit-fragments="2" data-paginate="true" data-class="invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="invert" data-marpit-pagination="27" style="--paginate:true;--class:invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="user-input-with-consolereadline">User input with <code>Console.ReadLine()</code></h2> <h2 id="user-input-with-consolereadline">User input with <code>Console.ReadLine()</code></h2>
<div class='columns21' markdown='1'> <div class='columns21' markdown='1'>
<div markdown='1'> <div markdown='1'>
@ -555,7 +555,7 @@ Console.WriteLine(userInput);
</div> </div>
</div> </div>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="28" data-marpit-fragments="2" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="exercise invert" data-marpit-pagination="28" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="28" data-marpit-fragments="2" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="exercise invert" data-marpit-pagination="28" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="exercise-2-weekday-survey">Exercise 2: Weekday survey</h2> <h2 id="exercise-2-weekday-survey">Exercise 2: Weekday survey</h2>
<ol> <ol>
@ -563,7 +563,7 @@ Console.WriteLine(userInput);
<li data-marpit-fragment="2">Print <code>Have a nice &lt;weekday&gt;</code> to the console where <code>&lt;weekday&gt;</code> is replaced with the string the user wrote.</li> <li data-marpit-fragment="2">Print <code>Have a nice &lt;weekday&gt;</code> to the console where <code>&lt;weekday&gt;</code> is replaced with the string the user wrote.</li>
</ol> </ol>
</section> </section>
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="29" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl" lang="en-US" class="exercise invert" data-marpit-pagination="29" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:oycqwo2imspp4a3ntzxl6ko6u92i15xqrdqfd7tfo1gl;" data-marpit-pagination-total="29"> </foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="29" data-paginate="true" data-class="exercise invert" data-heading-divider="5" data-theme="8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p" lang="en-US" class="exercise invert" data-marpit-pagination="29" style="--paginate:true;--class:exercise invert;--heading-divider:5;--theme:8yiv4e0xl4wj3nyluwl608ntiyon4jevegr5ghaz83p;" data-marpit-pagination-total="29">
<h2 id="assignments-arithmetic-operations">Assignments (arithmetic operations)</h2> <h2 id="assignments-arithmetic-operations">Assignments (arithmetic operations)</h2>
<p><a href="https://gitea.buutti.com/education/academy-assignments/src/branch/master/C%23%20Basics/2.3.%20Arithmetic%20Operations">Assignments about this topic can be found here</a></p> <p><a href="https://gitea.buutti.com/education/academy-assignments/src/branch/master/C%23%20Basics/2.3.%20Arithmetic%20Operations">Assignments about this topic can be found here</a></p>

@ -89,7 +89,7 @@ namespace MyAwesomeProgram
* A common modifier to add in front of a variable is `const`, short for ***constant*** * A common modifier to add in front of a variable is `const`, short for ***constant***
* If we know that a value of a variable is never going to change during the execution of the script, we can set it to `const`: * If we know that a value of a variable is never going to change during the execution of the script, we can set it to `const`:
```c# ```csharp
const int one = 1; const int one = 1;
one = 2; // raises an error one = 2; // raises an error

Loading…
Cancel
Save