Skip to content

Instantly share code, notes, and snippets.

@janellbaxter
janellbaxter / Program.cs
Created September 25, 2018 04:24
ToastR 2.0 Example for Introduction to Programming showing classes, objects, and other concepts
using System;
/*
using static System.Console;
allows access to properties and methods
of the static class Console without having
to include the name of the class
instead of: Console.ReadKey();
we can use: ReadKey();
*/
@janellbaxter
janellbaxter / Item.cs
Last active September 25, 2018 04:25
ToastR 1.0 Example for Introduction to Programming showing classes, objects, and other concepts (in-progress)
using System;
namespace Toastr
{
class Item
{
public string Name;
public double Calories;
public double Price;
public string[] Ingredients = {"", "", "" };
@janellbaxter
janellbaxter / Penguin.cs
Created September 19, 2018 04:10
Experimental example for Introduction to Programming showing classes, objects, if/else and other programming conepts
using System;
namespace PenguinSuperHero
{
class Penguin
{
string Name = "Anonymous Penguin";
string Location = "Nowhere";
bool Superhero = false;
double Points = 0;
@janellbaxter
janellbaxter / MyMath.cs
Last active September 23, 2018 18:54
Try/catch example for Introduction to Programming class
using System;
namespace TryCatchExample
{
class MyMath
{
public int DivideBySelf(int _number)
{
int _result = 0;
@janellbaxter
janellbaxter / Bumblebee.cs
Created July 18, 2018 18:08
Simple programming exercise example built during the second class meeting of Introduction to Programming. Concepts discussed in the walk through: namespaces, variables, data types, console window input and output, a conditional statement, class, objects, class fields, class methods, converting from one data type to another, and concatenation.
//Bumblebee.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DayTwoBumblebee
{
@janellbaxter
janellbaxter / Fortune.cs
Created January 26, 2018 20:21
Simple C# console application that selects a random element from an array and displays it as a fortune.
/*
* Random Fortune
* by Your Name, Date
*
* This work is a derivative of
* "Random Fortune" by http://programmingisfun.com, used under CC BY.
* https://creativecommons.org/licenses/by/4.0/
*/
using System;
using static System.Console;
@janellbaxter
janellbaxter / 10.2 Framework-Utility-Class.cs
Last active February 26, 2017 20:15
Framework progress with example of a custom utility class; Programming is Fun
/*
* "C# Adventure Game" by http://programmingisfun.com, used under CC BY.
* https://creativecommons.org/licenses/by/4.0/
*/
using System;
using System.Globalization;
namespace Adventure
{
@janellbaxter
janellbaxter / Utility.cs
Last active February 26, 2017 20:15
Example of a custom utility class (beginning C# programming)
/*
* Example of a custom utility class (beginning C# programming)
* http://programmingisfun.com, used under CC BY.
* https://creativecommons.org/licenses/by/4.0/
*/
using System;
using System.Globalization;
class Utility
@janellbaxter
janellbaxter / PiF-Adventure-10.1-Framework-Progress.cs
Created February 20, 2017 20:37
10.1 Framework Progress; Programming is Fun: C# Adventure Game (Learn C#)
/*
* [Your Title]
* by Your Name, Date
*
* This work is a derivative of
* "C# Adventure Game" by http://programmingisfun.com, used under CC BY.
* https://creativecommons.org/licenses/by/4.0/
*/
using System;
@janellbaxter
janellbaxter / PiF-Adventure-9.6-Framework-Progress.cs
Created February 20, 2017 19:59
9.6 Framework Progress; Programming is Fun: C# Adventure Game (Learn C#)
/*
* [Your Title]
* by Your Name, Date
*
* This work is a derivative of
* "C# Adventure Game" by http://programmingisfun.com, used under CC BY.
* https://creativecommons.org/licenses/by/4.0/
*/
using System;